-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add document on kubectl's behavior regarding initializers #5505
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,9 +238,12 @@ $ kubectl get replicationcontroller <rc-name> | |
|
||
// 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 | ||
``` | ||
|
||
`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 | ||
// 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>. | ||
// Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller. | ||
$ 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. | ||
|
@@ -263,7 +269,10 @@ $ kubectl delete -f pod.yaml | |
// Delete all the pods and services that have the label 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if --all deletes uninitialized? Commenting just to doublecheck. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think so. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@ahmetb @caesarxuchao If flag Also kubernetes/kubernetes#51186 solved the bug when deleting uninitialized resources. I've re-tested using master branch, it works as expected. |
||
$ kubectl delete pods --all | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I remember correctly,
kubectl describe pods --include-uninitialized=false
is already the default setting, right? if so, it's not worth explaining here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmetb uninitialized pods are included as default. So passing this flag to override the default setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dixudx is right :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I recall that we decided not to include uninitialized for bulk update/list calls.
It is unintuitive that
kubectl get
does not include uninitialized by default, butkubectl describe
includes uninitialized by default. I'm not sure what's the reasoning behind that.