【go语言系列】安装k8s的controller相关组件:deepcopy-gen和controller-gen

deepcopy-gen

1
2
3
4
5
6
go get -u k8s.io/code-generator/...
# 上面如果不成功,手工安装各种工具
git clone https://github.com/kubernetes/code-generator
cd code-generator
go build -o deepcopy-gen cmd/deepcopy-gen/main.go
cp deepcopy-gen ~/go_projects/bin/ # 放到/usr/local/bin下也可以

参考: https://www.cxyzjd.com/article/ch717828/106008698

controller-gen

下载地址:https://github.com/kubernetes-sigs/controller-tools/releases

1
2
3
4
5
6
7
# wget https://github.com/kubernetes-sigs/controller-tools/archive/refs/tags/v0.8.0.tar.gz
# tar -zxvf v0.8.0.tar.gz
# cd controller-tools-0.8.0
# go build -a -o controller-gen cmd/controller-gen/main.go
# mv controller-gen /usr/local/bin/
# controller-gen --version
Version: (devel)

参考:

https://support.huaweicloud.com/devg-osc/osc_ss_0052.html


【go语言系列】安装k8s的controller相关组件:deepcopy-gen和controller-gen
http://example.com/2022/05/22/go/【go语言系列】安装k8s的controller相关组件:deepcopy-gen和controller-gen/
作者
ningan123
发布于
2022年5月22日
许可协议