我試圖訪問一個吊艙的日誌在kubernetes集羣但發送以下其餘請求得到404
:無法訪問莢日誌
獲取API /命名空間/ myNameSpace對象/莢/ myPod /日誌
當我嘗試看看莢我碰到下面的狀態:
"metadata": {
"name": "podtest",
"generateName": "podtest-",
"namespace": "podtest01734160-58f9-4042-8f38-3e55d7d5beb3",
"selfLink": "/api/v1/namespaces/podtest01734160-58f9-4042-8f38-3e55d7d5beb3/pods/podtest-rc-no-env-hc5rl",
"uid": "dba5c41f-8307-11e5-96f2-005056976c6f",
"resourceVersion": "3595515",
"creationTimestamp": "2015-11-04T15:22:27Z",
"labels": {
"name": "kube-pod"
},
"annotations": {
"kubernetes.io/created-by": "{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicationController\",\"namespace\":\"podtest01734160-58f9-4042-8f38-3e55d7d5beb3\",\"name\":\"podtest-rc-no-env\",\"uid\":\"dba55f97-8307-11e5-96f2-005056976c6f\",\"apiVersion\":\"v1\",\"resourceVersion\":\"3594964\"}}"
}
},
"spec": {
"containers": [
{
"name": "podtest01734160-58f9-4042-8f38-3e55d7d5beb3",
"image": "dockertest",
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"dnsPolicy": "ClusterFirst",
"nodeName": "node-n2"
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "Ready",
"status": "True"
}
],
"hostIP": "172.29.225.12",
"podIP": "10.20.96.20",
"startTime": "2015-11-04T15:25:51Z",
"containerStatuses": [
{
"name": "podtest01734160-58f9-4042-8f38-3e55d7d5beb3",
"state": {
"running": {
"startedAt": "2015-11-04T15:28:43Z"
}
},
"lastState": {},
"ready": true,
"restartCount": 0,
"image": "dockertest",
"imageID": "docker://62457b12fc411b13fcaa122a946aefcac0c66df05ce1158d8d618ebe3af95362",
"containerID": "docker://baea3dc8cd7129704e205c76bf4ca57635659fec22774fcdcf197fb5c75ab433"
}
]
}
},
爲什麼我不能去的日誌?
請解釋爲什麼這個答案是正確的。 –
有兩點需要注意: 1.在metadata中它顯示「namespace」:「podtest01734160-58f9-4042-8f38-3e55d7d5beb3」但它不是myNamespace, 2.作爲iocanel的答案,api版本是必要的,更多的信息可以在這裏檢查: http://kubernetes.io/v1.1/docs/api-reference/v1/operations.html –