【问题标题】:Does Google Container Registry undergo issues?Google Container Registry 是否存在问题?
【发布时间】:2015-06-17 08:16:31
【问题描述】:

我在使用容器优化虚拟机时遇到了一个问题。我使用以下命令启动一个实例:

gcloud compute instances create "$instance_name" \
    --tags "http-server" \
    --image container-vm \
    --scopes storage-rw,logging-write \
    --metadata-from-file google-container-manifest="m2.yml" \
    --zone "$my_zone" \
    --machine-type "$my_machine_type"

m2.yml 在哪里:

version: v1beta2
containers:
  - name: nginx
    image: nginx

当我 ssh 到实例并查看 /var/log/docker.log 时,我看到了:

time="2015-06-17T07:42:59Z" level=error msg="Handler for GET /containers/{name:.*}/json returned error: no such id: kubelet" 
time="2015-06-17T07:42:59Z" level=error msg="HTTP Error: statusCode=404 no such id: kubelet" 
time="2015-06-17T07:42:59Z" level=info msg="GET /version" 
time="2015-06-17T07:42:59Z" level=info msg="+job version()" 
time="2015-06-17T07:42:59Z" level=info msg="-job version() = OK (0)" 
time="2015-06-17T07:42:59Z" level=info msg="GET /containers/docker-daemon/json" 
time="2015-06-17T07:42:59Z" level=info msg="+job container_inspect(docker-daemon)" 
no such id: docker-daemon
time="2015-06-17T07:42:59Z" level=info msg="-job container_inspect(docker-daemon) = ERR (1)" 
time="2015-06-17T07:42:59Z" level=error msg="Handler for GET /containers/{name:.*}/json returned error: no such id: docker-daemon" 
time="2015-06-17T07:42:59Z" level=error msg="HTTP Error: statusCode=404 no such id: docker-daemon" 

实例上没有运行容器,docker images -a 说:

REPOSITORY                       TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
gcr.io/google_containers/pause   0.8.0               2c40b0526b63        11 weeks ago         241.7 kB
<none>                           <none>              56ba5533a2db        11 weeks ago         241.7 kB
<none>                           <none>              511136ea3c5a        2.009460 years ago   0 B

容器引擎是否出现问题或我做错了什么?

更新1

我试了一下an example

version: v1 kind: Pod spec: containers: - name: simple-echo image: gcr.io/google_containers/busybox command: ['nc', '-p', '8080', '-l', '-l', '-e', 'echo', 'hello world!'] imagePullPolicy: Always ports: - containerPort: 8080 hostPort: 8080 protocol: TCP restartPolicy: Always dnsPolicy: Default

日志中还是报错:

evgeny@instance:~$ cat /var/log/docker.log | grep error
time="2015-06-18T16:28:56Z" level=error msg="Handler for GET /containers/{name:.*}/json returned error: no such id: kubelet" 
time="2015-06-18T16:28:56Z" level=error msg="HTTP Error: statusCode=404 no such id: kubelet" 
time="2015-06-18T16:28:56Z" level=error msg="Handler for GET /containers/{name:.*}/json returned error: no such id: docker-daemon" 
time="2015-06-18T16:28:56Z" level=error msg="HTTP Error: statusCode=404 no such id: docker-daemon" 
time="2015-06-18T16:28:56Z" level=error msg="Handler for GET /images/{name:.*}/json returned error: No such image: gcr.io/google_containers/busybox" 
time="2015-06-18T16:28:56Z" level=error msg="HTTP Error: statusCode=404 No such image: gcr.io/google_containers/busybox" 
time="2015-06-18T16:28:56Z" level=error msg="Handler for GET /containers/{name:.*}/json returned error: no such id: docker" 
time="2015-06-18T16:28:56Z" level=error msg="HTTP Error: statusCode=404 no such id: docker" 
time="2015-06-18T16:28:56Z" level=error msg="Handler for GET /images/{name:.*}/json returned error: No such image: gcr.io/google_containers/busybox" 
time="2015-06-18T16:28:56Z" level=error msg="HTTP Error: statusCode=404 No such image: gcr.io/google_containers/busybox" 

我正要通过反馈表发送反馈,但提交失败:relay__en.js?authuser=1:182 Uncaught TypeError: Cannot set property 'vmFeedbackData' of undefined。这样的故事。

【问题讨论】:

    标签: docker google-cloud-platform google-kubernetes-engine google-container-registry


    【解决方案1】:

    最新的容器 vm 镜像不支持 v1beta2 kubernetes API。您需要更新清单以使用 v1beta3 或 v1(具有相应的 yaml 更改)。

    container vm documentation 的最新版本显示了一个使用 v1 API 的 yaml 示例。

    【讨论】:

    • 如果它解决了您的问题,您可以接受答案吗?谢谢。
    【解决方案2】:

    我遇到了类似的问题,结果证明是我尝试使用的解决方案

    securityContext:
      privileged: true
    

    在不使用 Google Container 集群(即在 compute.v1.instancecompute.v1.instanceTemplate 上使用 google-container-manifest 元数据项)将 docker 映像加载到 GCE 实例时,Kubernetes 不支持该属性,因此它永远不会将图像正确加载到实例上。

    删除该属性解决了我的问题。

    【讨论】:

      猜你喜欢
      • 2022-07-21
      • 2020-04-23
      • 2017-06-03
      • 2016-06-30
      • 2022-01-27
      • 2018-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多