Go 源码

使用 Go 源码安装 Kustomize。

需要先安装 Go

无需克隆源码库直接构建 kustomize CLI

  1. GOBIN=$(pwd)/ GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/v3

在本地克隆源码库构建 kustomize CLI

  1. # 需要 go 1.13 或更高版本
  2. unset GOPATH
  3. # 详见 https://golang.org/doc/go1.13#modules
  4. unset GO111MODULES
  5. # 拉取 repo
  6. git clone git@github.com:kubernetes-sigs/kustomize.git
  7. # 进入目录
  8. cd kustomize
  9. # 如果您不想从 HEAD 开始构建, 则可以选择切换特定的标签
  10. git checkout kustomize/v3.2.3
  11. # 开始构建
  12. (cd kustomize; go install .)
  13. # 运行
  14. ~/go/bin/kustomize version

Feedback

Was this page helpful?

Glad to hear it! Please tell us how we can improve.

Sorry to hear that. Please tell us how we can improve.