当前位置:首页 > 服务端 > Kubernetes(K8S) 拉取镜像 ImagePullBackOff pull access denied

Kubernetes(K8S) 拉取镜像 ImagePullBackOff pull access denied

 K8S 拉取阿里云镜像  第一次用时,没注意 授权,所以在 kubectl apply 后一直出现  ImagePullBackOff

[root@k8smaster ~]# kubectl apply -f javademo1.yaml 
deployment.apps/javademo1 created
[root@k8smaster ~]# kubectl get pods
NAME                         READY   STATUS             RESTARTS   AGE
javademo1-55d6f5df9b-z2nqt   0/1     ImagePullBackOff   0          25s
nginx-f89759699-5hkdw        1/1     Running            0          5d1h 
[root@k8smaster ~]# kubectl describe pod javademo1-55d6f5df9b-z2nqt  
Name:         javademo1-55d6f5df9b-z2nqt
Namespace:    default
Priority:     0
Node:         k8snode1/172.16.3.182
Start Time:   Tue, 18 Oct 2022 19:13:56 +0800
Labels:       app=javademo1
              pod-template-hash=55d6f5df9b
Annotations:  <none>
Status:       Pending
IP:           10.244.1.3
IPs:
  IP:           10.244.1.3
Controlled By:  ReplicaSet/javademo1-55d6f5df9b
Containers:
  vipsoft:
    Container ID:   
    Image:          registry.cn-shanghai.aliyuncs.com/vipsoft/vipsoft:1.0
    Image ID:       
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-q7lps (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  default-token-q7lps:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-q7lps
    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  15m                   default-scheduler  Successfully assigned default/javademo1-55d6f5df9b-cq4mt to k8snode1
  Normal   Pulling    13m (x4 over 15m)     kubelet            Pulling image "registry.cn-shanghai.aliyuncs.com/vipsoft/vipsoft:1.0"
  Warning  Failed     13m (x4 over 15m)     kubelet            Failed to pull image "registry.cn-shanghai.aliyuncs.com/vipsoft/vipsoft:1.0": rpc error: code = Unknown desc = Error response from daemon: pull access denied for registry.cn-shanghai.aliyuncs.com/vipsoft/vipsoft, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
  Warning  Failed     13m (x4 over 15m)     kubelet            Error: ErrImagePull
  Warning  Failed     10m (x21 over 15m)    kubelet            Error: ImagePullBackOff
  Normal   BackOff    5m11s (x43 over 15m)  kubelet            Back-off pulling image "registry.cn-shanghai.aliyuncs.com/vipsoft/vipsoft:1.0"

解决方案,详见:K8S 拉取阿里云镜像 1、2 两步

最后执行 

[root@k8smaster ~]# kubectl replace -f javademo1.yaml

 

作者:VipSoft
来源链接:https://www.cnblogs.com/vipsoft/p/16805598.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125119.html

分享给朋友:

“Kubernetes(K8S) 拉取镜像 ImagePullBackOff pull access denied” 的相关文章