0

1 つのフォルダーをポッドにコピーしたいのですが、以下のコマンドを使用し

kubectl cp keys $POD:/home/oracle/

ていますPOD フォルダーがコピーされていることがわかります。

次のコマンドを実行するには、 ctrl+で閉じる必要があります。c

以下はデバッグログです

```

kubectl cp test $POD:/home/oracle/ -v=8
 loader.go:357] Config loaded from file /root/.kube/config
 round_trippers.go:414] GET https://192.168.3.236:6443/api/v1/namespaces/default/pods/xnode-2-56cb894476-w9thk
 round_trippers.go:421] Request Headers:
 round_trippers.go:424]     Accept: application/json, */*
 round_trippers.go:424]     User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
 round_trippers.go:439] Response Status: 200 OK in 25 milliseconds
 round_trippers.go:442] Response Headers:
 round_trippers.go:445]     Content-Type: application/json
 round_trippers.go:445]     Content-Length: 2594
 round_trippers.go:445]     Date: Fri, 23 Mar 2018 03:34:50 GMT
 request.go:873] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"xnode-2-56cb894476-w9thk","generateName":"xnode-2-56cb894476-","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/xnode-2-56cb894476-w9thk","uid":"bd88c607-2db6-11e8-aa6f-525400ddd5c6","resourceVersion":"1213768","creationTimestamp":"2018-03-22T09:52:32Z","labels":{"pod-template-hash":"1276450032","run":"xnode-2"},"ownerReferences":[{"apiVersion":"extensions/v1beta1","kind":"ReplicaSet","name":"xnode-2-56cb894476","uid":"bd78a06e-2db6-11e8-aa6f-525400ddd5c6","controller":true,"blockOwnerDeletion":true}]},"spec":{"volumes":[{"name":"default-token-mf6z4","secret":{"secretName":"default-token-mf6z4","defaultMode":420}}],"containers":[{"name":"xnode-2","image":"engg-nexus.com:8511/ms-linux","args":["/bin/bash"],"env":[{"name":"JAVA_HOME","value":"/usr/orps/java/jdk1.8.0_144"},{"name":"DISPLAY","value":":1"}],"resources":{},"volumeMounts":[{"name":"default-token-mf6z4","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/s [truncated 1570 chars]
 round_trippers.go:414] POST https://192.168.3.236:6443/api/v1/namespaces/default/pods/xnode-2-56cb894476-w9thk/exec?command=test&command=-d&command=%2Fhome%2Foracle%2F%2Fconfig&container=xnode-2&container=xnode-2&stderr=true&stdout=true
 round_trippers.go:421] Request Headers:
 round_trippers.go:424]     X-Stream-Protocol-Version: v4.channel.k8s.io
 round_trippers.go:424]     X-Stream-Protocol-Version: v3.channel.k8s.io
 round_trippers.go:424]     X-Stream-Protocol-Version: v2.channel.k8s.io
 round_trippers.go:424]     X-Stream-Protocol-Version: channel.k8s.io
 round_trippers.go:424]     User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
 round_trippers.go:439] Response Status: 101 Switching Protocols in 75 milliseconds
 round_trippers.go:442] Response Headers:
 round_trippers.go:445]     Connection: Upgrade
 round_trippers.go:445]     Upgrade: SPDY/3.1
 round_trippers.go:445]     X-Stream-Protocol-Version: v4.channel.k8s.io
 round_trippers.go:445]     Date: Fri, 23 Mar 2018 03:34:50 GMT
 round_trippers.go:414] GET https://192.168.3.236:6443/api/v1/namespaces/default/pods/xnode-2-56cb894476-w9thk
 round_trippers.go:421] Request Headers:
 round_trippers.go:424]     Accept: application/json, */*
 round_trippers.go:424]     User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
 round_trippers.go:439] Response Status: 200 OK in 4 milliseconds
 round_trippers.go:442] Response Headers:
 round_trippers.go:445]     Content-Length: 2594
 round_trippers.go:445]     Date: Fri, 23 Mar 2018 03:34:50 GMT
 round_trippers.go:445]     Content-Type: application/json
 request.go:873] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"xnode-2-56cb894476-w9thk","generateName":"xnode-2-56cb894476-","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/xnode-2-56cb894476-w9thk","uid":"bd88c607-2db6-11e8-aa6f-525400ddd5c6","resourceVersion":"1213768","creationTimestamp":"2018-03-22T09:52:32Z","labels":{"pod-template-hash":"1276450032","run":"xnode-2"},"ownerReferences":[{"apiVersion":"extensions/v1beta1","kind":"ReplicaSet","name":"xnode-2-56cb894476","uid":"bd78a06e-2db6-11e8-aa6f-525400ddd5c6","controller":true,"blockOwnerDeletion":true}]},"spec":{"volumes":[{"name":"default-token-mf6z4","secret":{"secretName":"default-token-mf6z4","defaultMode":420}}],"containers":[{"name":"xnode-2","image":"engg-nexus.com:8511/ms-linux","args":["/bin/bash"],"env":[{"name":"JAVA_HOME","value":"/usr/orps/java/jdk1.8.0_144"},{"name":"DISPLAY","value":":1"}],"resources":{},"volumeMounts":[{"name":"default-token-mf6z4","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/s [truncated 1570 chars]
 round_trippers.go:414] POST https://192.168.3.236:6443/api/v1/namespaces/default/pods/xnode-2-56cb894476-w9thk/exec?command=tar&command=xf&command=-&command=-C&command=%2Fhome%2Foracle%2F%2Fconfig&container=xnode-2&container=xnode-2&stderr=true&stdin=true&stdout=true
 round_trippers.go:421] Request Headers:
 round_trippers.go:424]     X-Stream-Protocol-Version: v4.channel.k8s.io
 round_trippers.go:424]     X-Stream-Protocol-Version: v3.channel.k8s.io
 round_trippers.go:424]     X-Stream-Protocol-Version: v2.channel.k8s.io
 round_trippers.go:424]     X-Stream-Protocol-Version: channel.k8s.io
 round_trippers.go:424]     User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
 round_trippers.go:439] Response Status: 101 Switching Protocols in 69 milliseconds
 round_trippers.go:442] Response Headers:
 round_trippers.go:445]     Connection: Upgrade
 round_trippers.go:445]     Upgrade: SPDY/3.1
 round_trippers.go:445]     X-Stream-Protocol-Version: v4.channel.k8s.io
 round_trippers.go:445]     Date: Fri, 23 Mar 2018 03:34:50 GMT

```

4

1 に答える 1

0

これは、クライアント側が入力ストリームを閉じないという docker クライアントのバグが原因である可能性があります。

docker の問題 についてはhttps://github.com/moby/moby/issues/36516を、kubectl への影響についてはhttps://github.com/kubernetes/kubernetes/issues/61557を参照してください。

于 2018-03-23T16:00:10.330 に答える