or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
體驗 Istio 強大的 Service Mesh 能力
歡迎來到 Kubernetes Summit'20 共筆
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →共筆入口:https://hackmd.io/@k8ssummit/20
手機版請點選上方 按鈕展開議程列表。
這是 Will 保哥 在 Kubernetes Summit 2020 實戰工作坊 體驗 Istio 強大的 Service Mesh 能力 的課前準備文件。請有意參加這場實戰工作坊的朋友,請務必事先安裝好實作環境!
回報實作進度: https://github.com/doggy8088/IstioHOL/issues
課前準備
前置條件 (Prerequisites)
本次實戰工作坊需要學員參考本篇文章進行環境設定,以確保實作順利:
wsl.exe --set-default-version 2
將之後安裝的 Distro 預設都調整為 WSL 2 版本安裝 KinD 命令列工具
On Mac (homebrew)
On Windows
使用 Chocolatey 安裝 Kind 套件
如果你已經安裝過 Docker Desktop for Windows 的話,請改用以下命令安裝:
也可透過 PowerShell 下載 Windows 執行檔
On Linux
驗證安裝版本
安裝 Kubectl 命令列工具
On Mac (homebrew)
On Windows
On Linux
驗證安裝版本
安裝 kubectx 與 kubens 工具
安裝 kubectx 與 kubens 工具
安裝 k9s 工具
安裝 k9s 工具
驗證安裝版本
建立 KinD 叢集
建立一個有 1 個 control-plane nodes 與 1 個 worker nodes 的 KinD 叢集:
先建立
kind-2nodes.yaml
檔案建立叢集
如果你從 Windows 建立叢集,但想在 WSL 2 操作 kubectl 的話,請執行以下命令:
測試 kubectl 叢集連線
測試 Kubernetes 與 Networking 可否正常運作
建立
mynginx.yaml
檔案建立 mynginx 服務
測試服務連線是否正常
http://localhost/
移除 mynginx 服務
Istio 新手上路
安裝 Istio 服務
下載 Istio
安裝 Istio 之前的檢查
安裝 Istio 服務 (Installation Guides)
我們將用 Install with Istioctl 文件的說明進行安裝。
測試環境可以用
demo
這個 Profile 來進行安裝,但正式環境不建議使用demo
Profile 喔!設定
default
這個 namespace 啟用自動注入 Sidecar 的 Label列出目前所有 namespace 的
istio-injection
狀態部署 Istio 範例應用程式 (
bookinfo
)開放應用程式給外部網路連線
驗證 Istio 設定是否正確 (因為太容易設定錯誤了,特別寫了一個工具專門用來檢查)
決定 ingress 的 IP 與 Ports
先取得
istio-system
負責對外的istio-ingressgateway
服務資訊由於 KinD 內的服務沒辦法透過
type: LoadBalancer
取得 IP 地址,因此必須手動改成type: NodePort
才行!請修改
spec.type
為NodePort
,並調整.spec.ports[*].nodePort
的 Port 埠號。name: http2
的nodePort
調整為30080
name: https
的nodePort
調整為30443
在 Windows 10 開啟瀏覽器,透過 Istio Gateway 瀏覽網頁!
當你連到 http://localhost/ 將會看到 HTTP 404 錯誤頁面。
當你連到 http://localhost/productpage 就會看到 BookInfo Sample 的首頁!
重新整理 http://localhost/productpage 網頁可以看到不同的 Book Reviews 內容(來自不同的 Pod 執行結果)
服務監控
安裝 Grafana 與 Prometheus 服務
安裝 Grafana 與 Prometheus
開啟 Grafana dashboard 查看 Istio 相關監控數據
透過以下命令可以啟動一個 Proxy 端點,讓你可以透過本機進行瀏覽
壓力測試
流量監控
安裝 Kiali 服務
安裝 Kiali 為 Istio Addons
開啟 Kiali dashboard 查看 Istio 的所有流量資訊
透過以下命令可以啟動一個 Proxy 端點,讓你可以透過本機進行瀏覽
參考下圖進行報表顯示設定,對網站進行壓力測試後,就會看見流量的即時動畫!
壓力測試
清空資源
移除 bookinfo 應用程式
移除 Istio 安裝
刪除 kind 叢集
tags:
k8ssummit20
k8s