0

我在使用容器優化的虛擬機時遇到了一個問題。我啓動一個實例用下面的命令:Google容器註冊表是否出現問題?

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 

容器引擎是否會遇到一些問題或者我做錯了什麼?

UPDATE1

我給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

,它仍然是錯誤日誌中:

[email protected]:~$ 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" 

我正準備通過反饋表發送反饋,但提交失敗th:relay__en.js?authuser=1:182 Uncaught TypeError: Cannot set property 'vmFeedbackData' of undefined。這樣的故事。

回答

2

最新的容器虛擬機映像不支持v1beta2 kubernetes API。您將需要更新您的清單以使用v1beta3或v1(以及相應的yaml更改)。

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

+0

謝謝你的迴應。 –

+0

如果它解決了你的問題,你能接受答案嗎?謝謝。 –

0

我遇到類似的問題和解決方案竟然是,我試圖用裝載碼頭工人形象到劍橋實例時

securityContext: 
    privileged: true 

Kubernetes不接受該財產不使用谷歌容器集羣(即在compute.v1.instancecompute.v1.instanceTemplate上使用google-container-manifest元數據項),所以它只是從不將圖像正確加載到實例上。

刪除該屬性解決了我的問題。