Google容器registry是否会出现问题?
我在使用容器优化的虚拟机时遇到了一个问题。 我使用以下命令启动一个实例:
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
上没有运行容器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
容器引擎是否会遇到一些问题,或者我做错了什么?
UPDATE1
我举了一个例子 :
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
。 这样的故事。
最新的容器虚拟机映像不支持v1beta2 kubernetes API。 您将需要更新您的清单使用v1beta3或v1(与相应的yaml更改)。
容器虚拟机文档的最新版本显示了使用v1 API的yaml示例。
我遇到了类似的问题,解决scheme竟然是我正在尝试使用的
securityContext: privileged: true
在不使用Google容器集群的情况下(例如,在compute.v1.instance
或compute.v1.instanceTemplate
上使用google-container-manifest
元数据项)将compute.v1.instance
镜像加载到GCE实例时,Kubernetes并不尊重该属性。它只是从来没有正确加载到实例上的图像。
删除该属性解决了我的问题。