问题描述 今天使用 Helm 安装 Rancher 过程中,突然报 failed to download
?nginx-ingress helm install rancher rancher-latest/rancher --logtostderr \
--namespace cattle-system \
--set hostname=rancher.local.wwj.icuError: failed to download "rancher-latest/rancher" (hint: running `helm repo update` may help)
helm 增加
--debug
参数,看到是因为访问 https://releases.rancher.com 403 了。使用浏览器打开,发现被 Cloudflare 拦截了请求,需要验证。浏览器验证后,可以访问,但命令行没有办法进行验证。
?rancher helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set hostname=rancher.local.wwj.icuinstall.go:159: [debug] Original chart version: ""
Error: failed to fetch https://releases.rancher.com/server-charts/latest/rancher-2.4.5.tgz : 403 Forbidden
helm.go:84: [debug] failed to fetch https://releases.rancher.com/server-charts/latest/rancher-2.4.5.tgz : 403 Forbidden
helm.sh/helm/v3/pkg/getter.(*HTTPGetter).get
/home/circleci/helm.sh/helm/pkg/getter/httpgetter.go:73
helm.sh/helm/v3/pkg/getter.(*HTTPGetter).Get
/home/circleci/helm.sh/helm/pkg/getter/httpgetter.go:41
helm.sh/helm/v3/pkg/downloader.(*ChartDownloader).DownloadTo
/home/circleci/helm.sh/helm/pkg/downloader/chart_downloader.go:97
helm.sh/helm/v3/pkg/action.(*ChartPathOptions).LocateChart
/home/circleci/helm.sh/helm/pkg/action/install.go:667
main.runInstall
/home/circleci/helm.sh/helm/cmd/helm/install.go:171
main.newInstallCmd.func1
/home/circleci/helm.sh/helm/cmd/helm/install.go:117
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main
/home/circleci/helm.sh/helm/cmd/helm/helm.go:83
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1357
由于机器目前无法切换网络,难道命令行只能这么被拦截了?
解决方案 以
rancher-latest v2.4.5
仓库为例,在浏览器手动下载以下文件:- https://releases.rancher.com/server-charts/latest/index.yaml
- https://releases.rancher.com/server-charts/latest/rancher-2.4.5.tgz
- https://wuweijie.oss-cn-shenzhen.aliyuncs.com/kubernetes/rancher/index.yaml
- https://wuweijie.oss-cn-shenzhen.aliyuncs.com/kubernetes/rancher/rancher-2.4.5.tgz
helm repo add rancher-latest-private https://wuweijie.oss-cn-shenzhen.aliyuncs.com/kubernetes/rancher
使用刚才添加的仓库安装:
helm install rancher rancher-latest-private/rancher \
--namespace cattle-system \
--set hostname=rancher.local.wwj.icu
文章图片
【踩坑|Helm 安装 Rancher 过程中 403 的解决方案 | 因使用公网 IP 请求被 Cloudflare 拦截】问题解决!
推荐阅读
- linux|2022年云原生趋势
- 个人日记|K8s中Pod生命周期和重启策略
- k8s|Scheduling Framework 与 Extender对比及详细介绍
- k8s|k8s(六)(配置管理与集群安全机制)
- 云原生应用之旅—Kubernetes成长记 | 第十站(获取云原生旅行秘籍)
- Kubernetes实战|Kubernetes实战(十九)-CA证书制作
- Kubernetes实战|Kubernetes实战(二十)- Etcd 集群部署
- Kubernetes实战|Kubernetes实战(二十二)-kubernetes二进制文件方式部署集群(下)
- 如何彻底删除EKS中一直卡在Terminating的Namespace
- Matlab 与gazebo spawnModel from MATLAB 连接报错 failed to create a /gazebo/get_model_state service client