我是靠谱客的博主 寂寞大白,这篇文章主要介绍kubebuilder init问题:dial tcp 172.217.163.49:443: connect: connection refused,现在分享给大家,希望可以做个参考。
在使用kubebuilder命令初始化operator项目时,报错:modernc.org/cc@v1.0.0: Get "https://proxy.golang.org/modernc.org/cc/@v/v1.0.0.mod": dial tcp 172.217.163.49:443: connect: connection refused。详细报错如下:
Writing scaffold for you to edit...
Get controller runtime:
$ go get sigs.k8s.io/controller-runtime@v0.5.0
go: sigs.k8s.io/controller-runtime@v0.5.0 requires
k8s.io/apiextensions-apiserver@v0.17.2 requires
k8s.io/code-generator@v0.17.2 requires
gonum.org/v1/netlib@v0.0.0-20190331212654-76723241ea4e requires
modernc.org/cc@v1.0.0: Get "https://proxy.golang.org/modernc.org/cc/@v/v1.0.0.mod": dial tcp 172.217.163.49:443: connect: connection refused
解决方法:
执行如下命令:
go env -w GOPROXY=https://goproxy.cn
在使用init初始化创建项目即可。
但是又出现如下“C compiler "gcc" not found”的错误:
# runtime/cgo
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in $PATH
使用命令安装gcc即可解决:
yum install gcc
最后再次使用kubebuilder创建项目:
kubebuilder init --domain lailin.xyz --repo github.com/mohuishou/blog-code/k8s-operator/02-kubebuilder
完成!!
最后
以上就是寂寞大白最近收集整理的关于kubebuilder init问题:dial tcp 172.217.163.49:443: connect: connection refused的全部内容,更多相关kubebuilder内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复