You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
k8s-for-docker-desktop/k8s命令

9 lines
398 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

K8S进入容器方法
前言
k8s如何进入一个pod里有多个容器的方法
方法1
kubectl --namespace=kube-system exec -it kube-dns-1336009800-15b1h --container nginx -- sh
kubectl --namespace=kube-system exec -it kube-dns-1336009800-15b1h -c nginx -- sh
注释:--namespace 为命名空间kube-dns为pod的名字-c或-container为Pod里其中的一个容器名字