setting current context and finding running pod's YAML (#13665)
This commit is contained in:
parent
b809bdcba0
commit
cc09428797
|
|
@ -69,6 +69,9 @@ kubectl config use-context my-cluster-name # set the default context t
|
|||
# add a new cluster to your kubeconf that supports basic auth
|
||||
kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword
|
||||
|
||||
# permanently save the namespace for all subsequent kubectl commands in that context.
|
||||
kubectl config set-context --current --namespace=ggckad-s2
|
||||
|
||||
# set a context utilizing a specific username and namespace.
|
||||
kubectl config set-context gce --user=cluster-admin --namespace=foo \
|
||||
&& kubectl config use-context gce
|
||||
|
|
@ -142,6 +145,8 @@ kubectl get pods --all-namespaces # List all pods in all namespaces
|
|||
kubectl get pods -o wide # List all pods in the namespace, with more details
|
||||
kubectl get deployment my-dep # List a particular deployment
|
||||
kubectl get pods --include-uninitialized # List all pods in the namespace, including uninitialized ones
|
||||
kubectl get pod my-pod -o yaml # Get a pod's YAML
|
||||
kubectl get pod my-pod -o yaml --export # Get a pod's YAML without cluster specific information
|
||||
|
||||
# Describe commands with verbose output
|
||||
kubectl describe nodes my-node
|
||||
|
|
|
|||
Loading…
Reference in New Issue