更新:如果我使用googlekubernetes引擎站点界面和deploy按钮,也是一样的。
gcloud auth configure-docker
docker pull kennethreitz/httpbin
docker tag kennethreitz/httpbin:latest gcr.io/<proj-id>/images/httpbin:v1.0
docker push gcr.io/<proj-id>/images/httpbin:v1.0
kubectl run test --image=gcr.io/<proj-id>/images/httpbin:v1.0
然后我得到一张图片:
kubectl describe pod test-5f447f48f4-kcpg9
Name: test-5f447f48f4-kcpg9
Namespace: default
Node: <proj-id>-cluster-default-pool-f398e01b-5kmb/10.132.0.2
Start Time: Tue, 28 Aug 2018 09:08:43 +0200
Labels: pod-template-hash=1900390490
run=test
Annotations: kubernetes.io/limit-ranger=LimitRanger plugin set: cpu request for container test
Status: Pending
IP: 10.16.1.46
Controlled By: ReplicaSet/test-5f447f48f4
Containers:
test:
Container ID:
Image: gcr.io/<proj-id>/images/httpbin:v1.0
Image ID:
Port: <none>
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Requests:
cpu: 100m
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-9mcms (ro)
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
default-token-9mcms:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-9mcms
Optional: false
QoS Class: Burstable
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 5m default-scheduler Successfully assigned test-5f447f48f4-kcpg9 to <proj-id>-cluster-default-pool-f398e01b-5kmb
Normal SuccessfulMountVolume 5m kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb MountVolume.SetUp succeeded for volume "default-token-9mcms"
Normal SandboxChanged 5m (x3 over 5m) kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb Pod sandbox changed, it will be killed and re-created.
Normal BackOff 5m (x6 over 5m) kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb Back-off pulling image "gcr.io/<proj-id>/images/httpbin:v1.0"
Normal Pulling 4m (x3 over 5m) kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb pulling image "gcr.io/<proj-id>/images/httpbin:v1.0"
Warning Failed 4m (x3 over 5m) kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb Failed to pull image "gcr.io/<proj-id>/images/httpbin:v1.0": rpc error: code = Unknown desc = Error response from daemon: repository gcr.io/<proj-id>/images/httpbin not found: does not exist or no pull access
Warning Failed 4m (x3 over 5m) kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb Error: ErrImagePull
Warning Failed 31s (x23 over 5m) kubelet, <proj-id>-cluster-default-pool-f398e01b-5kmb Error: ImagePullBackOff
在云壳中:
docker images
更新:我可以在浏览器控制台中看到图像(
https://console.cloud.google.com/gcr/images/projId/
),如果复制路径,它与下面的路径相同-只是使用另一个项目id。
kubectl run aName——图片=gcr.io/projectid/myimages/myimage:v1.0版
ImagePullBackOff
kubectl描述pod aName。。。
Failed to pull image "myimages/myimage:v1.0": rpc error: code = Unknown desc = Error response from daemon: repository myimages/myimage not found: does not exist or no pull access
"or no pull access"
但我该怎么解决呢?