じぶんのkubectl version
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"}
マルチコンテナポッドの作成に従いました
ポッドを起動した後、1 つのコンテナーが稼働していますが、他のコンテナーは稼働していません。
kubectl get pods
NAME READY STATUS RESTARTS AGE
redis-django 1/2 CrashLoopBackOff 9 22m
それから私はしましたkubectl describe redis-django
。下部にError syncing pod, skipping
エラーが表示されました
31m <invalid> 150 {kubelet 172.25.30.21} spec.containers{frontend} Warning BackOff Back-off restarting failed docker container
25m <invalid> 121 {kubelet 172.25.30.21} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "frontend" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=frontend pod=redis-django_default(9f35ffcd-391e-11e6-b160-0022195df673)"
このエラーを解決するにはどうすればよいですか? 助けて!
ありがとう!
OS: Ubuntu 14
アップデート
以前は、 Creating Multi-Container Pod で見つかった以下の yaml ファイルを使用しました
apiVersion: v1
kind: Pod
metadata:
name: redis-django
labels:
app: web
spec:
containers:
- name: key-value-store
image: redis
ports:
- containerPort: 6379
- name: frontend
image: django
ports:
- containerPort: 8000
frontend
コンテナは開始されませんでした。次に、yaml ファイルを、redis
名前とポートが異なる 2 つのコンテナーに変更しました。しかし、結果は同じです(ポッドの同期中にエラーが発生し、スキップします)
後で、yaml ファイルを 1 つのdjango
コンテナーのみに変更しました。このポッドCrashLoopBackOff
のステータスとError syncing pod, skipping
更新-2
I tail -f /var/log/upstart/kublet.log
、同じエラーが発生しています。Kubelet は継続的にコンテナーを開始しようとしていますが、そうではありません!
I0623 12:15:13.943046 445 manager.go:2050] Back-off 5m0s restarting failed container=key-value-store pod=redis-django_default(94683d3c-392e-11e6-b160-0022195df673)
E0623 12:15:13.943100 445 pod_workers.go:138] Error syncing pod 94683d3c-392e-11e6-b160-0022195df673, skipping: failed to "StartContainer" for "key-value-store" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=key-value-store pod=redis-django_default(94683d3c-392e-11e6-b160-0022195df673)"
更新-3
root@vm1:~/kubernetes/cluster/ubuntu/binaries# kubectl describe pod redis-django
Name: redis-django
Namespace: default
Node: 192.168.1.10/192.168.1.10
Start Time: Thu, 23 Jun 2016 22:58:03 -0700
Labels: app=web
Status: Running
IP: 172.16.20.2
Controllers: <none>
Containers:
key-value-store:
Container ID: docker://8dbdd6826c354243964f0306427082223d3da49bf2aaf30e15961ea00362fe42
Image: redis
Image ID: docker://sha256:4465e4bcad80b5b43cef0bace96a8ef0a55c0050be439c1fb0ecd64bc0b8cce4
Port: 6379/TCP
QoS Tier:
cpu: BestEffort
memory: BestEffort
State: Running
Started: Thu, 23 Jun 2016 22:58:10 -0700
Ready: True
Restart Count: 0
Environment Variables:
frontend:
Container ID: docker://9c89602739abe7331b3beb3a79e92a7cc42e2a7e40e11618413c8bcfd0afbc16
Image: django
Image ID: docker://sha256:0cb63b45e2b9a8de5763fc9c98b79c38b6217df718238251a21c8c4176fb3d68
Port: 8000/TCP
QoS Tier:
cpu: BestEffort
memory: BestEffort
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 23 Jun 2016 22:58:41 -0700
Finished: Thu, 23 Jun 2016 22:58:41 -0700
Last State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 23 Jun 2016 22:58:22 -0700
Finished: Thu, 23 Jun 2016 22:58:22 -0700
Ready: False
Restart Count: 2
Environment Variables:
Conditions:
Type Status
Ready False
Volumes:
default-token-0oq7p:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-0oq7p
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
49s 49s 1 {default-scheduler } Normal Scheduled Successfully assigned redis-django to 192.168.1.10
48s 48s 1 {kubelet 192.168.1.10} spec.containers{key-value-store} Normal Pulling pulling image "redis"
43s 43s 1 {kubelet 192.168.1.10} spec.containers{key-value-store} Normal Pulled Successfully pulled image "redis"
43s 43s 1 {kubelet 192.168.1.10} spec.containers{key-value-store} Normal Created Created container with docker id 8dbdd6826c35
42s 42s 1 {kubelet 192.168.1.10} spec.containers{key-value-store} Normal Started Started container with docker id 8dbdd6826c35
37s 37s 1 {kubelet 192.168.1.10} spec.containers{frontend} Normal Started Started container with docker id 3872ceae75d4
37s 37s 1 {kubelet 192.168.1.10} spec.containers{frontend} Normal Created Created container with docker id 3872ceae75d4
30s 30s 1 {kubelet 192.168.1.10} spec.containers{frontend} Normal Created Created container with docker id d97b99b6780c
30s 30s 1 {kubelet 192.168.1.10} spec.containers{frontend} Normal Started Started container with docker id d97b99b6780c
29s 29s 1 {kubelet 192.168.1.10} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "frontend" with CrashLoopBackOff: "Back-off 10s restarting failed container=frontend pod=redis-django_default(9d0a966a-39d0-11e6-9027-000c293d51ab)"
42s 16s 3 {kubelet 192.168.1.10} spec.containers{frontend} Normal Pulling pulling image "django"
11s 11s 1 {kubelet 192.168.1.10} spec.containers{frontend} Normal Started Started container with docker id 9c89602739ab
38s 11s 3 {kubelet 192.168.1.10} spec.containers{frontend} Normal Pulled Successfully pulled image "django"
11s 11s 1 {kubelet 192.168.1.10} spec.containers{frontend} Normal Created Created container with docker id 9c89602739ab
29s 10s 2 {kubelet 192.168.1.10} spec.containers{frontend} Warning BackOff Back-off restarting failed docker container
10s 10s 1 {kubelet 192.168.1.10} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "frontend" with CrashLoopBackOff: "Back-off 20s restarting failed container=frontend pod=redis-django_default(9d0a966a-39d0-11e6-9027-000c293d51ab)"
コンテナーの場合frontend
: ログ メッセージが表示されない
root@vm1:~/kubernetes/cluster/ubuntu/binaries# kubectl logs redis-django -p -c frontend
root@vm1:~/kubernetes/cluster/ubuntu/binaries# kubectl logs redis-django -p -c key-value-store
Error from server: previous terminated container "key-value-store" in pod "redis-django" not found
root@vm1:~/kubernetes/cluster/ubuntu/binaries# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8dbdd6826c35 redis "docker-entrypoint.sh" 2 minutes ago Up 2 minutes k8s_key-value-store.f572c2d_redis-django_default_9d0a966a-39d0-11e6-9027-000c293d51ab_11101aea
8995bbf9f4f4 gcr.io/google_containers/pause:2.0 "/pause" 2 minutes ago Up 2 minutes k8s_POD.48e5231f_redis-django_default_9d0a966a-39d0-11e6-9027-000c293d51ab_c00025b0
root@vm1:~/kubernetes/cluster/ubuntu/binaries#