- 安装完helm后,安装tiller客户端,执行以下命令:
helm init --upgrade --tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.7 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
注意用与helm相同的tiller版本。
- 查看安装进度,可以看到tiller镜像拉取失败了。
[root@k8s-master myshop]# kubectl get pod --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-789f6df884-v75cm 1/1 Running 14 9d
kube-system calico-node-cn8gl 0/1 CrashLoopBackOff 374 9d
kube-system calico-node-gtfvv 0/1 CrashLoopBackOff 381 9d
kube-system calico-node-w4f99 0/1 Running 372 9d
kube-system coredns-7ff77c879f-7cdrn 1/1 Running 13 9d
kube-system coredns-7ff77c879f-9k9d9 1/1 Running 3 37h
kube-system etcd-k8s-master 1/1 Running 15 9d
kube-system kube-apiserver-k8s-master 1/1 Running 19 9d
kube-system kube-controller-manager-k8s-master 1/1 Running 16 9d
kube-system kube-proxy-29qhg 1/1 Running 15 9d
kube-system kube-proxy-f94b7 1/1 Running 11 9d
kube-system kube-proxy-zv972 1/1 Running 11 9d
kube-system kube-scheduler-k8s-master 1/1 Running 16 9d
kube-system kuboard-8b8574658-xnvmv 1/1 Running 1 17h
kube-system tiller-deploy-7bb58bcdc8-qkdb8 0/1 ImagePullBackOff 0 7m52s
- 查看详情,可以看到是去拉取阿里云的镜像失败
[root@k8s-master myshop]# kubectl describe pod tiller-deploy-7bb58bcdc8-qkdb8 -n kube-system
Name: tiller-deploy-7bb58bcdc8-qkdb8
Namespace: kube-system
Priority: 0
Node: k8s-node-02/192.168.1.141
Start Time: Tue, 02 Jun 2020 12:52:40 +0800
Labels: app=helm
name=tiller
pod-template-hash=7bb58bcdc8
Annotations: cni.projectcalico.org/podIP: 10.244.44.237/32
cni.projectcalico.org/podIPs: 10.244.44.237/32
Status: Pending
IP: 10.244.44.237
IPs:
IP: 10.244.44.237
Controlled By: ReplicaSet/tiller-deploy-7bb58bcdc8
Containers:
tiller:
Container ID:
Image: registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.7
Image ID:
Ports: 44134/TCP, 44135/TCP
Host Ports: 0/TCP, 0/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Liveness: http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
Readiness: http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
Environment:
TILLER_NAMESPACE: kube-system
TILLER_HISTORY_MAX: 0
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-dgdsp (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-dgdsp:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-dgdsp
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 8m41s default-scheduler Successfully assigned kube-system/tiller-deploy-7bb58bcdc8-qkdb8 to k8s-node-02
Normal Pulling 4m7s (x4 over 8m40s) kubelet, k8s-node-02 Pulling image "registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.7"
Warning Failed 3m6s (x4 over 7m39s) kubelet, k8s-node-02 Failed to pull image "registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.7": rpc error: code = Unknown desc = Error: image google_containers/tiller:v2.16.7 not found
Warning Failed 3m6s (x4 over 7m39s) kubelet, k8s-node-02 Error: ErrImagePull
Normal BackOff 2m36s (x7 over 7m38s) kubelet, k8s-node-02 Back-off pulling image "registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.16.7"
Warning Failed 2m36s (x7 over 7m38s) kubelet, k8s-node-02 Error: ImagePullBackOff
- 修改镜像源,可以从docker search tiller里面选取一个镜像,我这是用sapcc/tiller替换了原来的镜像。
kubectl edit deployment tiller-deploy -n kube-system
image: sapcc/tiller:v2.16.7
- 修改完报错,查看tiller是否安装成功:
[root@k8s-master myshop]# helm version
Client: &version.Version{SemVer:"v2.16.7", GitCommit:"5f2584fd3d35552c4af26036f0c464191287986b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.7", GitCommit:"5f2584fd3d35552c4af26036f0c464191287986b", GitTreeState:"clean"}