kubernetes 无法提取图像"/posts:0.0.1 ":< myimage>rpc error:code = Unknown desc =来自dae的错误响应...如何解决Docker映像的这个问题? rpc error: code = Unknown desc = Error response from dae... How to fix this problem with docker image?

yduiuuwa  于 2023-03-01  发布在  Kubernetes
关注(0)|答案(3)|浏览(407)

无法提取图像"/posts:0.0.1 ":rpc错误:代码=未知desc =来自守护程序的错误响应:拒绝/posts的拉入访问,存储库不存在或可能需要"docker登录":拒绝:请求的资源访问被拒绝

    • Debian 10,minikube和kubectl安装和docker.如果我用这个映像运行docker-一切正常.**

pavel@debian:~$kubectl version客户端版本:{主要版本:"1",次要版本:"19",GitVersion:"v1.19.4",GitCommit:"123",GitTreeState:"干净",构建日期:"2020 - 11 - 11T13:17:17Z",目标版本:"go1.15.2",编译器:"gc",平台:"linux/amd64 "}服务器版本:版本信息{主要版本:"1",次要版本:"19",GitVersion:"v1.19.4",GitCommit:"123",GitTreeState:"干净",构建日期:"2020 - 11 - 11T13:09:17Z",目标版本:"go1.15.2",编译器:"gc",平台:"linux/amd64 "}
posts.yaml

apiVersion: v1
kind: Pod
metadata:
  name: posts
spec:
  containers:
    - name: posts
      image: <mylogin>/posts:0.0.1
    • kubectl应用-f员额. yaml**
    • debian:~$kubectl描述pod帖子**
Name:         posts
Namespace:    default
Priority:     0
Node:         minikube/192.168.49.2
Start Time:   Wed, 25 Nov 2020 07:06:47 +0400
Labels:       <none>
Annotations:  <none>
Status:       Pending
IP:           172.17.0.4
IPs:
  IP:  172.17.0.4
Containers:
  posts:
    Container ID:   
    Image:          <mylogin>/posts:0.0.1
    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-b9gkg (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  default-token-b9gkg:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-b9gkg
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                   From               Message
  ----     ------     ----                  ----               -------
  Normal   Scheduled  23m                   default-scheduler  Successfully assigned default/posts to minikube
  Normal   Pulling    21m (x4 over 23m)     kubelet            Pulling image "<mylogin>/posts:0.0.1"
  Warning  Failed     21m (x4 over 23m)     kubelet            Failed to pull image "<mylogin>/posts:0.0.1": rpc error: code = Unknown desc = Error response from daemon: pull access denied for <mylogin>/posts, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
  Warning  Failed     21m (x4 over 23m)     kubelet            Error: ErrImagePull
  Warning  Failed     7m53s (x63 over 23m)  kubelet            Error: ImagePullBackOff
  Normal   BackOff    2m58s (x84 over 23m)  kubelet            Back-off pulling image "<mylogin>/posts:0.0.1"
koaltpgm

koaltpgm1#

Minikube无法直接访问您的本地Docker存储库。我可以使用以下方法解决此问题:
小型立方体图象加载器
并且必须将imagePullPolicy设置为IfNotPresent。
希望我帮上忙了。

rqqzpn5f

rqqzpn5f2#

Minikube无法直接访问您的本地Docker存储库。有几种方法可以解决这个问题,在这里详细介绍:https://minikube.sigs.k8s.io/docs/handbook/pushing/
就我个人而言,我只是使用minikube cache add <image tag>将映像添加到Minikube缓存中,您需要将yaml文件中的imagePullPolicy更改为Never。这样,它将默认使用您缓存到minikube中的本地映像。您也可以在添加后重新加载缓存。如果您在将容器添加到集群之前使用Docker测试它们,这可能是最简单的方法。
您也可以给予其他方法,包括使用Minikube内部的守护进程直接构建容器映像。

2guxujil

2guxujil3#

映像名称不正确。请正确更新映像名称和标记。如果映像托管在专用注册表中,则需要创建具有登录专用注册表的凭据的注册表密码。有关进一步的帮助https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/,请访问以下链接

相关问题