【发布时间】:2016-01-22 01:45:11
【问题描述】:
one-shot Pod 的状态码有两种,通过 API 或命令运行:
kubectl run --restart=Never --image test:v0.1 ....
pod 将输出文件生成到 NFS 服务器,并且我已成功获取文件。
kubectl get pods -ao wide:
NAME READY STATUS RESTARTS AGE
test-90 0/1 ExitCode:0 0 23m 192.168.1.43
test-91 0/1 ExitCode:0 0 23m 192.168.1.43
test-92 0/1 ExitCode:0 0 23m 192.168.1.43
test-93 0/1 ExitCode:0 0 23m 192.168.1.43
test-94 0/1 Error 0 23m 192.168.1.46
test-95 0/1 Error 0 23m 192.168.1.46
test-96 0/1 Error 0 23m 192.168.1.46
test-97 0/1 Error 0 23m 192.168.1.46
test-98 0/1 Error 0 23m 192.168.1.46
test-99 0/1 ExitCode:0 0 23m 192.168.1.43
ExitCode:0 pod 的描述:
Name: test-99
Namespace: default
Image(s): test:v0.1
Node: 192.168.1.43/192.168.1.43
Status: Succeeded
Replication Controllers: <none>
Containers:
test:
State: Terminated
Exit Code: 0
Ready: False
Restart Count: 0
Error pod 的描述:
Name: test-98
Namespace: default
Image(s): test:v0.1
Node: 192.168.1.46/192.168.1.46
Status: Succeeded
Replication Controllers: <none>
Containers:
test:
State: Terminated
Reason: Error
Exit Code: 0
Ready: False
Restart Count: 0
他们的 NFS 卷:
Volumes:
input:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: 192.168.1.46
Path: /srv/nfs4/input
ReadOnly: false
output:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: 192.168.1.46
Path: /srv/nfs4/output
ReadOnly: false
default-token-nmviv:
Type: Secret (a secret that should populate this volume)
SecretName: default-token-nmviv
kubectl logs 不返回任何内容,因为容器只生成输出文件。
提前致谢!
【问题讨论】:
-
你使用什么版本的 kubernetes?
kubectl version -
@Yu-JuHong Kubernetes 1.1.2 在 Ubuntu 14.04 上,任何传递到 pod 的命令都会返回错误状态。
-
我在使用 Kubernetes v1.1.4 时遇到了同样的问题,你找到原因了吗?我实际上只是按照简单的 hello-world 示例,将 restartPolicy 设置为 Never。
-
@zyxue 还没有。一个合理的解释是quickly existing。但是如果
ExitCode 0是正常的,那Error呢?我尝试在本地机器上运行 docker,在 docker 中调试,所有这些都工作正常。 XD
标签: docker kubernetes nfs