From c510570402938f93a556495e4dc95729e6efeb39 Mon Sep 17 00:00:00 2001 From: Di Xu Date: Sun, 17 Sep 2017 20:55:41 +0800 Subject: [PATCH] add document on kubectl's behavior regarding initializers --- docs/user-guide/kubectl-cheatsheet.md | 10 ++++++---- docs/user-guide/kubectl-overview.md | 11 ++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/user-guide/kubectl-cheatsheet.md b/docs/user-guide/kubectl-cheatsheet.md index db16eed44bc38..8f3551d29fa12 100644 --- a/docs/user-guide/kubectl-cheatsheet.md +++ b/docs/user-guide/kubectl-cheatsheet.md @@ -104,6 +104,7 @@ $ kubectl get services # List all services in the names $ 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 # Describe commands with verbose output $ kubectl describe nodes my-node @@ -193,10 +194,11 @@ $ kubectl scale --replicas=5 rc/foo rc/bar rc/baz # Scale mult ## Deleting Resources ```console -$ kubectl delete -f ./pod.json # Delete a pod using the type and name specified in pod.json -$ kubectl delete pod,service baz foo # Delete pods and services with same names "baz" and "foo" -$ kubectl delete pods,services -l name=myLabel # Delete pods and services with label name=myLabel -$ kubectl -n my-ns delete po,svc --all # Delete all pods and services in namespace my-ns +$ kubectl delete -f ./pod.json # Delete a pod using the type and name specified in pod.json +$ kubectl delete pod,service baz foo # Delete pods and services with same names "baz" and "foo" +$ kubectl delete pods,services -l name=myLabel # Delete pods and services with label name=myLabel +$ kubectl delete pods,services -l name=myLabel --include-uninitialized # Delete pods and services, including uninitialized ones, with label name=myLabel +$ kubectl -n my-ns delete po,svc --all # Delete all pods and services, including uninitialized ones, in namespace my-ns, ``` ## Interacting with running Pods diff --git a/docs/user-guide/kubectl-overview.md b/docs/user-guide/kubectl-overview.md index 5170ed715039f..37736071a5998 100644 --- a/docs/user-guide/kubectl-overview.md +++ b/docs/user-guide/kubectl-overview.md @@ -238,6 +238,12 @@ $ kubectl get replicationcontroller // List all replication controllers and services together in plain-text output format. $ kubectl get rc,services + +// List all daemon sets, including uninitialized ones, in plain-text output format. +$ kubectl get ds --include-uninitialized + +// List all daemon sets, not including uninitialized ones, in plain-text output format. +$ kubectl get ds --include-uninitialized=false ``` `kubectl describe` - Display detailed state of one or more resources. @@ -263,7 +269,10 @@ $ kubectl delete -f pod.yaml // Delete all the pods and services that have the label name=. $ kubectl delete pods,services -l name= -// Delete all pods. +// Delete all the pods and services that have the label name=, including uninitialized ones. +$ kubectl delete pods,services -l name= --include-uninitialized + +// Delete all pods, including uninitialized ones. $ kubectl delete pods --all ```