四月 9–11 日去舊金山參加 Google Cloud 的 Next ’19 大會,收穫頗大。

這場大會,同一時段就有近 30 場專題演講同時進行,議程滿滿,勢必得做取捨。基於工作需要及個人興趣,我主要選擇與容器相關的場次:service mesh、Windows containers、混合雲、資安實務。

我發現,光是這些場次,就得花很大力氣去消化、實驗與應用。

我們這些所謂的「台港團」會在 GCPUG Taipei 舉辦一場分享會。因為自己不克參加,便以這篇文章,針對我鎖定的核心議題:Istio,做一番重點摘要,以饗讀者。

以下內容,不完全按照 Next ’19 的議程時間順序,而是依照我主觀的排列。

看完後,對於 Istio 應該就有不錯的全面認知了。

漸進式導入 Istio

很有意思的演講,很適合作為 Istio 入門。

【演講】Incrementally Adopting Istio 【重點摘要】

  • 3:20 - 微服務面臨的挑戰。

  • 6:18 - Istio 的 control plane 三大元件,就是設計來一一對應這些問題的。

  • 10:38 - Istio 的 telemetry 機制。

  • 11:42 - Istio 的 traffic 管理機制。

  • 15:10 - Istio 的 security 機制。

  • 16:27 - 在 GKE 安裝 Istio 的方法及使用建議。

  • 19:11 - 接下來就是一系列的漸進式示範。

Istio 的 Traffic:宏觀角度

在 Istio + Envoy 體系中,是透過 control plane 的 Pilot 元件及 xDS 協定,去管理 data plane 的 Envoy 網路流量。

以此為基礎,Google Cloud 推出 Traffic Director 服務,用統一的 control plane、透過同樣的 xDSv2 API,去管理 GCP 能觸及的 GKE、GCE,甚至自建的 Kubernetes cluster;也藉此處理 GCP 之專屬特性。

某種意義上,可以把 Traffic Director 視為將 Istio 的 Pilot 元件託管給 Google Cloud。

這場演講,儘管旨在廣告宣傳 Google 自家的 Traffic Director 服務,但講員之一 Prajakta Joshi 非常厲害,對於一般性的 service mesh 觀念也介紹得非常生動。

這一場值得全程觀看。我僅摘錄部分重點。

【演講】Traffic Director and Envoy-Based L7 ILB for Production-Grade Service Mesh and Istio 【重點摘要】

  • 1:21 - 很中肯的觀點:將 service mesh 視為 “SDN for services”。

  • 4:45 - Istio 簡介。

  • 5:48 - 介紹 Istio 的 Pilot 流量管理議題。

  • 6:40 - 正式介紹 Traffic Director。

  • 14:45 - Live demo: global load balancing。

  • 23:45 - 介紹 service mesh 流量控制的特色:“change traffic flow without changing code”,以及 traffic splitting、traffic steering、fault injection、mirroring (shadowing)、load balancing、circuit breaking、outlier detection 等高檔特性。

  • 29:39 - Live demo: traffic splitting。

  • 35:37 - 預告 Traffic Director 的產品路線圖。

  • 42:56 - 某客戶的 monolith 階段性轉型經驗。

講員 Prajakta Joshi 另一場演講 “Strategies for Bringing Kubernetes, Istio, Traffic Director, and Envoy to Brownfield with Walmart, Google, Tetrate” 也很棒,可惜並未釋出投影片及錄影。精彩內容,就留在我的手機相簿裡面啦。

Istio 的 Traffic:實踐角度

我聽了 Megan O’Keefe 兩場硬底子的演講。

第一場演講,以大量實例現場展示 Istio 的 traffic rules。

【演講】Istio in Production: Day 2 Traffic Routing 【重點摘要】

  • 2:18 - Istio 與 Envoy 簡介。

  • 9:13 - Live demo: rollout。

  • 13:45 - Live demo: content-based routing。

  • 16:48 - Live demo: circuit breaking。

  • 20:46 - Live demo: chaos testing。

  • 24:48 - Live demo: ingress and egress。

  • 36:26 - Istio 1.1 現況。

  • 37:18 - Istio 導入建議:“start slow and incrementally”。

  • 38:36 - Istio 還能夠做什麼?

第二場演講,就更硬碰硬的處理 Istio 每天都可能遇到的幾個實踐問題,以及如何查找問題、解決問題的過程。三段 live demo,涵蓋 Istio control plane 的三大元件:Pilot、Mixer、Citadel,非常扎實。

【演講】Debugging Istio: How to Fix a Broken Service Mesh 【重點摘要】

  • 0:35 - Service mesh 是要解決甚麼問題?Istio 的 control plane 就是設計來一一對應這些問題的。

  • 2:54 - 可是,Istio 又會連帶引入哪些複雜度?

  • 4:46 - Live demo: traffic management.

  • 20:47 - Live demo: telemetry.

  • 27:58 - Live demo: security.

  • 44:23 - 除錯工具推薦清單。

這兩場 Megan O’Keefe 的演講,雖然硬底子,卻十分具體,可操作性高,值得全程觀看。

從 SRE 角度看 Istio

這一場,只能說,非常非常非常精彩。

對於讀過 Google 的 SRE 一書的人來說,看到 SLO、error budget 之類的觀念,居然可以在 Istio 上面如此實現,真是大開眼界。

【演講】Understanding SLOs and Error Budgets With Istio 【重點摘要】

  • 1:40 - SLI/SLO/SLA 基本觀念。

  • 7:41 - “uptime” 的新觀點。

  • 9:04 - 將 error budget 視為 “amount of SLOs you can spend”。

  • 13:49 - Live demo!

  • 28:02 - 客戶證言:Schlumberger 公司。

把 VM 也帶進 Service Mesh

Service mesh 並不是容器的專利;古老的 VM 其實也可以納入治理體系。

透過 Istio 的 mesh expansion 機制,VM 只要安裝 node agent 及 Envoy proxy,即可登記為 Kubernetes/Istio cluster 的 service entry 資源,進行 service discovery 等互動。

【演講】Istio Service Mesh for VM Native 【重點摘要】

  • 8:00 - 介紹 Istio 的 mesh expansion 機制。

  • 11:04 - 具體步驟。

  • 13:23 - Live demo!

Windows Containers

自從 3 月底 Kubernetes 1.14 宣布正式支援 Windows 之後1,我就很期待到 Next ’19 現場眼見為憑。

這一場值得全程觀看。我僅摘錄部分重點。

【演講】Windows Containers in Google Kubernetes Engine 【重點摘要】

  • 7:50 - “I have a dream…”
  • 12:15 - Windows host OS and base image requirements
  • 17:23 - Which to containerize?
  • 22:14 - Kubernetes 1.14 stable supports Windows containers and Windows Server 2019
  • 25:44 - Limitations for Windows containers (for now)
  • 28:16 - GKE “is working on supporting Windows containers” (preview now)
  • 30:40 - Live demo!
  • 37:00 - Early Access Program (EAP)

API 視角

不管你想在容器化、微服務、service mesh 路線走到多遠,「API 管理」一直都是需要持續關注的一環。

針對這議題,Next ’19 是以 Apigee 為主軸2,分別介紹 Apigee 如何與 service mesh 和 serverless 技術搭配運用。

【演講】APIs, Microservices, and the Service Mesh 【重點摘要】

  • 3:21 - 介紹 mTLS。

  • 7:06 - 用 Istio 在 control plane 層次確保 mTLS 之類的 policy。

  • 12:47 - 介紹 service mesh 時代的 API 管理架構。

  • 33:09 - 什麼時候才需要 service mesh?

【演講】API Management for Serverless and Multi-Cloud 【重點摘要】

  • 13:35 - 示範 Cloud Run 與 Apigee。

  • 24:15 - 示範 Cloud Functions 與 Apigee。

這麼多乾貨,值得花點力氣好好消化。

投影片

2019-07-02 補充

兩個月後,應 GCPUG Taipei 之邀,我還是在 Meetup #48 給了一場分享。投影片在此: