add document on kubectl's behavior regarding initializers (#5505)
This commit is contained in:
@@ -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 --all-namespaces # List all pods in all namespaces
|
||||||
$ kubectl get pods -o wide # List all pods in the namespace, with more details
|
$ 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 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
|
# Describe commands with verbose output
|
||||||
$ kubectl describe nodes my-node
|
$ kubectl describe nodes my-node
|
||||||
@@ -193,10 +194,11 @@ $ kubectl scale --replicas=5 rc/foo rc/bar rc/baz # Scale mult
|
|||||||
## Deleting Resources
|
## Deleting Resources
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ kubectl delete -f ./pod.json # Delete a pod using the type and name specified in pod.json
|
$ 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 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 # 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 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
|
## Interacting with running Pods
|
||||||
|
|||||||
@@ -238,9 +238,12 @@ $ kubectl get replicationcontroller <rc-name>
|
|||||||
|
|
||||||
// List all replication controllers and services together in plain-text output format.
|
// List all replication controllers and services together in plain-text output format.
|
||||||
$ kubectl get rc,services
|
$ kubectl get rc,services
|
||||||
|
|
||||||
|
// List all daemon sets, including uninitialized ones, in plain-text output format.
|
||||||
|
$ kubectl get ds --include-uninitialized
|
||||||
```
|
```
|
||||||
|
|
||||||
`kubectl describe` - Display detailed state of one or more resources.
|
`kubectl describe` - Display detailed state of one or more resources, including the uninitialized ones by default.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
// Display the details of the node with name <node-name>.
|
// Display the details of the node with name <node-name>.
|
||||||
@@ -252,6 +255,9 @@ $ kubectl describe pods/<pod-name>
|
|||||||
// Display the details of all the pods that are managed by the replication controller named <rc-name>.
|
// Display the details of all the pods that are managed by the replication controller named <rc-name>.
|
||||||
// Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller.
|
// Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller.
|
||||||
$ kubectl describe pods <rc-name>
|
$ kubectl describe pods <rc-name>
|
||||||
|
|
||||||
|
// Describe all pods, not including uninitialized ones
|
||||||
|
$ kubectl describe pods --include-uninitialized=false
|
||||||
```
|
```
|
||||||
|
|
||||||
`kubectl delete` - Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources.
|
`kubectl delete` - Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources.
|
||||||
@@ -263,7 +269,10 @@ $ kubectl delete -f pod.yaml
|
|||||||
// Delete all the pods and services that have the label name=<label-name>.
|
// Delete all the pods and services that have the label name=<label-name>.
|
||||||
$ kubectl delete pods,services -l name=<label-name>
|
$ kubectl delete pods,services -l name=<label-name>
|
||||||
|
|
||||||
// Delete all pods.
|
// Delete all the pods and services that have the label name=<label-name>, including uninitialized ones.
|
||||||
|
$ kubectl delete pods,services -l name=<label-name> --include-uninitialized
|
||||||
|
|
||||||
|
// Delete all pods, including uninitialized ones.
|
||||||
$ kubectl delete pods --all
|
$ kubectl delete pods --all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user