如何編譯 Istio?
本文將指導你如何在 macOS 上編譯 Istio 二進位制檔案。
構建前的準備
在正式開始構建前, 參考這篇文件 ,以下是我的構建環境資訊:
- macOS 12.3.1 Darwin AMD64
- Docker Desktop 4.8.1(78998)
- Docker Engine v20.10.14
開始構建
參考 這篇文件 編譯 Istio。
首先在 GitHub 上
下載 Istio 程式碼,將程式碼下載到 $GOPATH/src/istio.io/istio
目錄下,下文中的命令都在該根目錄下執行。
執行下面的命令下載 Istio 依賴的包,這些包將下載到 vendor
目錄下:
go mod vendor
然後執行下面的命令構建 Istio:
sudo make build
如果你沒有在命令前加 sudo
,你還是可能遇到下面的錯誤:
fatal: unsafe repository ('/work' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /work fatal: unsafe repository ('/work' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /work Makefile.core.mk:170: *** "TAG cannot be empty". Stop. make: *** [build] Error 2
構建完的二進位制檔案將儲存在 out
目錄下,其目錄結構如下:
out ├── darwin_amd64 │ ├── bug-report │ ├── client │ ├── envoy │ ├── extauthz │ ├── install-cni │ ├── istio-cni │ ├── istio-cni-taint │ ├── istio-iptables │ ├── istio_is_init │ ├── istioctl │ ├── logs │ ├── operator │ ├── pilot-agent │ ├── pilot-discovery │ ├── release │ └── server └── linux_amd64 ├── envoy ├── envoy-centos ├── logs └── release
同時構建出了 linux_amd64
和 darwin_amd64
架構的二進位制檔案。
總結
以上就是在 macOS 上構建 Istio 的過程,如果你已經下載好了構建所需要的的 Docker 映象,那麼構建時間將不超過一分鐘。
參考
「其他文章」
- 自 2020 年以來全球的開源商業化軟體融資情況
- IstioCon 2022 回顧及錄影、PPT 分享
- Beyond Istio OSS —— Istio 服務網格的現狀及未來
- 如何在 Istio 中整合 SPRIRE?
- 什麼是零信任?
- 為什麼 Istio 要使用 SPIRE 做身份認證?
- 再見 KataCoda!
- 如何編譯 Istio?
- Istio 資料平面 Pod 啟動過程詳解
- Istio 中的各元件埠及功能詳解
- Istio sidecar 中的流量型別及 iptables 規則詳解
- Tetrate 公司開源專案介紹
- 跨越鴻溝:理解鴻溝理論
- 網易開源 Istio 擴充套件專案 Slime 簡介——基於 Istio 的智慧服務網格管理器
- 服務網格現狀之我見
- 如何理解 Istio Ingress, 它與 API Gateway 有什麼區別?
- 如何除錯 Kubernetes 中的微服務 ——proxy、sidecar 還是 service mesh?
- Jimmy Song:為什麼山寨幣持有者不關心比特幣 Taproot 升級?
- Zoom OBS B 站直播配置手冊
- Istio 開源四週年回顧與展望