Open tomsanlen opened 1 year ago
I0221 13:57:13.840507 30726 request.go:968] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"privileged-container","namespace":"metarget","selfLink":"/api/v1/namespaces/metarget/pods/privileged-container","uid":"a412bbad-8fbe-46c3-99d3-dc5bb11d316c","resourceVersion":"5737","creationTimestamp":"2023-02-21T05:05:28Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"name\":\"privileged-container\",\"namespace\":\"metarget\"},\"spec\":{\"containers\":[{\"args\":[\"while true; do sleep 30; done;\"],\"command\":[\"/bin/bash\",\"-c\",\"--\"],\"image\":\"ubuntu:latest\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"ubuntu\",\"securityContext\":{\"privileged\":true}}]}}\n"}},"spec":{"volumes":[{"name":"default-token-jvrqh","secret":{"secretName":"default-token-jvrqh","defaultMode":420}}],"containers":[{"name":"ubuntu","image":"ubuntu:latest","command":["/bin/bash","-c","--"],"args":["while true; do sleep 30; done;"],"resources":{},"volumeMounts":[{"name":"default-token-jvrqh","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent","securityContext":{"privileged":true}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","nodeName":"test-virtual-machine","securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true},"status":{"phase":"Pending","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z"},{"type":"Ready","status":"False","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z","reason":"ContainersNotReady","message":"containers with unready status: [ubuntu]"},{"type":"ContainersReady","status":"False","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z","reason":"ContainersNotReady","message":"containers with unready status: [ubuntu]"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z"}],"hostIP":"192.168.159.204","podIP":"10.244.0.5","podIPs":[{"ip":"10.244.0.5"}],"startTime":"2023-02-21T05:05:28Z","containerStatuses":[{"name":"ubuntu","state":{"waiting":{"reason":"ImagePullBackOff","message":"Back-off pulling image \"ubuntu:latest\""}},"lastState":{},"ready":false,"restartCount":0,"image":"ubuntu:latest","imageID":"","started":false}],"qosClass":"BestEffort"}} I0221 13:57:13.845361 30726 round_trippers.go:423] curl -k -v -XPOST -H "X-Stream-Protocol-Version: v4.channel.k8s.io" -H "X-Stream-Protocol-Version: v3.channel.k8s.io" -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" -H "User-Agent: kubectl/v1.16.6 (linux/amd64) kubernetes/e7f962b" 'https://192.168.159.204:6443/api/v1/namespaces/metarget/pods/privileged-container/exec?command=%2Fbin%2Fbash&container=ubuntu&stdin=true&stdout=true&tty=true' I0221 13:57:13.866381 30726 round_trippers.go:443] POST https://192.168.159.204:6443/api/v1/namespaces/metarget/pods/privileged-container/exec?command=%2Fbin%2Fbash&container=ubuntu&stdin=true&stdout=true&tty=true 500 Internal Server Error in 20 milliseconds I0221 13:57:13.866417 30726 round_trippers.go:449] Response Headers: I0221 13:57:13.866428 30726 round_trippers.go:452] Content-Length: 30 I0221 13:57:13.866432 30726 round_trippers.go:452] Content-Type: text/plain; charset=utf-8 I0221 13:57:13.866434 30726 round_trippers.go:452] Date: Tue, 21 Feb 2023 05:57:13 GMT F0221 13:57:13.866883 30726 helpers.go:114] error: unable to upgrade connection: container not found ("ubuntu")
当我运行这个./metarget cnv install privileged-container,并且进入容器时报了这个错 kubectl exec -it -n metarget privileged-container /bin/bash error: unable to upgrade connection: container not found ("ubuntu")
I0221 13:57:13.840507 30726 request.go:968] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"privileged-container","namespace":"metarget","selfLink":"/api/v1/namespaces/metarget/pods/privileged-container","uid":"a412bbad-8fbe-46c3-99d3-dc5bb11d316c","resourceVersion":"5737","creationTimestamp":"2023-02-21T05:05:28Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"name\":\"privileged-container\",\"namespace\":\"metarget\"},\"spec\":{\"containers\":[{\"args\":[\"while true; do sleep 30; done;\"],\"command\":[\"/bin/bash\",\"-c\",\"--\"],\"image\":\"ubuntu:latest\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"ubuntu\",\"securityContext\":{\"privileged\":true}}]}}\n"}},"spec":{"volumes":[{"name":"default-token-jvrqh","secret":{"secretName":"default-token-jvrqh","defaultMode":420}}],"containers":[{"name":"ubuntu","image":"ubuntu:latest","command":["/bin/bash","-c","--"],"args":["while true; do sleep 30; done;"],"resources":{},"volumeMounts":[{"name":"default-token-jvrqh","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent","securityContext":{"privileged":true}}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","nodeName":"test-virtual-machine","securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true},"status":{"phase":"Pending","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z"},{"type":"Ready","status":"False","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z","reason":"ContainersNotReady","message":"containers with unready status: [ubuntu]"},{"type":"ContainersReady","status":"False","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z","reason":"ContainersNotReady","message":"containers with unready status: [ubuntu]"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2023-02-21T05:05:28Z"}],"hostIP":"192.168.159.204","podIP":"10.244.0.5","podIPs":[{"ip":"10.244.0.5"}],"startTime":"2023-02-21T05:05:28Z","containerStatuses":[{"name":"ubuntu","state":{"waiting":{"reason":"ImagePullBackOff","message":"Back-off pulling image \"ubuntu:latest\""}},"lastState":{},"ready":false,"restartCount":0,"image":"ubuntu:latest","imageID":"","started":false}],"qosClass":"BestEffort"}} I0221 13:57:13.845361 30726 round_trippers.go:423] curl -k -v -XPOST -H "X-Stream-Protocol-Version: v4.channel.k8s.io" -H "X-Stream-Protocol-Version: v3.channel.k8s.io" -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" -H "User-Agent: kubectl/v1.16.6 (linux/amd64) kubernetes/e7f962b" 'https://192.168.159.204:6443/api/v1/namespaces/metarget/pods/privileged-container/exec?command=%2Fbin%2Fbash&container=ubuntu&stdin=true&stdout=true&tty=true' I0221 13:57:13.866381 30726 round_trippers.go:443] POST https://192.168.159.204:6443/api/v1/namespaces/metarget/pods/privileged-container/exec?command=%2Fbin%2Fbash&container=ubuntu&stdin=true&stdout=true&tty=true 500 Internal Server Error in 20 milliseconds I0221 13:57:13.866417 30726 round_trippers.go:449] Response Headers: I0221 13:57:13.866428 30726 round_trippers.go:452] Content-Length: 30 I0221 13:57:13.866432 30726 round_trippers.go:452] Content-Type: text/plain; charset=utf-8 I0221 13:57:13.866434 30726 round_trippers.go:452] Date: Tue, 21 Feb 2023 05:57:13 GMT F0221 13:57:13.866883 30726 helpers.go:114] error: unable to upgrade connection: container not found ("ubuntu")