不太会玩这个,原理可以在这儿写的,老师我重新写一个
cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://wnk1ohoc.mirror.aliyuncs.com"],
"insecure-registries":["hub.h3c.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
cat ~/.docker/config.json
{
"auths": {
"hub.aicloud.com": {
"auth": "YWljbG91ZDphYmMxMjMhQQ=="
},
"hub.h3c.com": {
"auth": "YWljbG91ZDphYmMxMjMhQQ=="
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.6 (linux)"
}
}
kubectl get pod
NAME READY STATUS RESTARTS AGE
aicloud-user-5dd9467947-9rzr7 1/1 Running 0 2d15h
nginx-demo-7f5c4c6f9b-pptl9 1/1 Running 0 2d21h
rabbitmq-54bd996b58-wcnbh 1/1 Running 0 2d18h
redis-jfx6j 1/1 Running 0 2d18h
tomcat-demo-6bd76b4bb7-sdjhx 0/1 ImagePullBackOff 0 6m37s
kubectl describe pods tomcat-demo-6bd76b4bb7-sdjhx
Name: tomcat-demo-6bd76b4bb7-sdjhx
Namespace: dev-szc
Priority: 0
PriorityClassName: <none>
Node: k8s-worker01/10.90.14.173
Start Time: Mon, 20 May 2019 09:44:47 +0800
Labels: app=tomcat-demo
pod-template-hash=6bd76b4bb7
Annotations: cni.projectcalico.org/podIP: 172.22.4.11/32
Status: Pending
IP: 172.22.4.11
Controlled By: ReplicaSet/tomcat-demo-6bd76b4bb7
Containers:
tomcat-demo:
Container ID:
Image: hub.h3c.com/base/tomcat:8.0.51-alpine
Image ID:
Port: 8080/TCP
Host Port: 0/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-fhx9w (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-fhx9w:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-fhx9w
Optional: false
QoS Class: BestEffort
Node-Selectors: node=worker
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 6m58s default-scheduler Successfully assigned dev-szc/tomcat-demo-6bd76b4bb7-sdjhx to k8s-worker01
Normal SandboxChanged 6m55s kubelet, k8s-worker01 Pod sandbox changed, it will be killed and re-created.
Warning Failed 6m11s (x3 over 6m56s) kubelet, k8s-worker01 Failed to pull image "hub.h3c.com/base/tomcat:8.0.51-alpine": rpc error: code = Unknown desc = Error response from daemon: pull access denied for hub.h3c.com/base/tomcat, repository does not exist or may require 'docker login'
Warning Failed 6m11s (x3 over 6m56s) kubelet, k8s-worker01 Error: ErrImagePull
Normal BackOff 5m34s (x7 over 6m54s) kubelet, k8s-worker01 Back-off pulling image "hub.h3c.com/base/tomcat:8.0.51-alpine"
Normal Pulling 5m21s (x4 over 6m56s) kubelet, k8s-worker01 Pulling image "hub.h3c.com/base/tomcat:8.0.51-alpine"
Warning Failed 112s (x22 over 6m54s) kubelet, k8s-worker01 Error: ImagePullBackOff