选择一个同网段的服务器,安装kubectl ,开启内网访问
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
yum install -y kubectl && kubectl version
mkdir .kube
vim .kube/config
添加腾讯源
[root@ansible-5 ~]# helm repo add tkemarket https://market-tke.tencentcloudcr.com/chartrepo/opensource-stable
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /root/.kube/config
"tkemarket" has been added to your repositories
添加阿里源
[root@ansible-5 ~]# helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /root/.kube/config
"aliyun" has been added to your repositories
查看权限
[root@ansible-5 ~]# ll .kube/config
-rw-r--r-- 1 root root 5545 Sep 28 10:34 .kube/config
解决这个告警,修改权限即可 600 :
[root@ansible-5 ~]# ll .kube/config
-rw------- 1 root root 5545 Sep 28 10:34 .kube/config
[root@ansible-5 ~]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "tkemarket" chart repository
...Successfully got an update from the "aliyun" chart repository
Update Complete. ⎈Happy Helming!⎈