kubernetes/pkg/kubectl/cmd
Kubernetes Submit Queue aedeccda95 Merge pull request #28352 from vefimova/fix_22986-1
Automatic merge from submit-queue

Added warning msg for `kubectl get`

- added warning description regarding terminated pods to `get` long help message
  - added printing of warning message in case of `get pods` if there are hidden pods

Fixes #22986  (initiall PR and discussion are here #26417)

## **Output examples:**
### # kubectl get pods
```
NAME                       READY     STATUS             RESTARTS   AGE
dapi-test-pod1             0/1       Terminating        0          22h
liveness-http              0/1       CrashLoopBackOff   11245      22d
ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2336       8d
  info: 1 completed object(s) was(were) not shown in pods list. Pass --show-all to see all objects.

```

### #  kubectl get pods,namespaces
```
NAME                          READY     STATUS             RESTARTS   AGE
po/dapi-test-pod1             0/1       Terminating        0          22h
po/liveness-http              1/1       Running            11242      22d
po/ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2335       8d
 info: 1 completed object(s) was(were) not shown in pods list. Pass --show-all to see all objects.

NAME             STATUS    AGE
ns/default       Active    89d
ns/kube-system   Active    41d
```

### # kubectl get pods -a
```
NAME                       READY     STATUS             RESTARTS   AGE
busybox                    0/1       Error              0          27d
dapi-test-pod1             0/1       Terminating        0          22h
liveness-http              0/1       CrashLoopBackOff   11245      22d
ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2336       8d
```

### # kubectl get -h
```
Display one or many resources.

Possible resource types include (case insensitive): pods (aka 'po'), services (aka 'svc'), deployments (aka 'deploy'),
replicasets (aka 'rs'), replicationcontrollers (aka 'rc'), nodes (aka 'no'), events (aka 'ev'), limitranges (aka 'limits'),
persistentvolumes (aka 'pv'), persistentvolumeclaims (aka 'pvc'), resourcequotas (aka 'quota'), namespaces (aka 'ns'),
serviceaccounts (aka 'sa'), ingresses (aka 'ing'), horizontalpodautoscalers (aka 'hpa'), daemonsets (aka 'ds'), configmaps (aka 'cm'),
componentstatuses (aka 'cs), endpoints (aka 'ep'), petsets (alpha feature, may be unstable) and secrets.

This command will hide resources that have completed. For instance, pods that are in the Succeeded or Failed phases.
You can see the full results for any resource by providing the '--show-all' flag.

By specifying the output as 'template' and providing a Go template as the value
of the --template flag, you can filter the attributes of the fetched resource(s).

Examples:

.........
````
2016-08-17 05:11:50 -07:00
..
config fix register.go files up + add test import 2016-08-11 17:06:54 -07:00
rollout kubectl: refactor rollout history to be more configurable 2016-07-12 10:36:14 +02:00
set Use patch when recording commands in kubectl set image 2016-07-21 15:33:34 -07:00
util Merge pull request #28509 from juanvallejo/jvallejo_update-human-readable-printer-signature 2016-08-12 07:27:56 -07:00
annotate_test.go Merge pull request #27977 from ciwang/move-storage-examples 2016-07-08 21:45:38 -07:00
annotate.go fix annotate.go single resource check 2016-07-27 10:41:05 -04:00
apiversions.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00
apply_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
apply.go kubectl apply add --overwrite flag 2016-07-18 00:32:13 -04:00
attach_test.go Fix Windows terminal handling 2016-07-20 13:37:14 -04:00
attach.go Make more messages respect --quiet flag 2016-08-08 14:24:44 -07:00
autoscale.go Add validation conditions for autoscale 2016-08-16 09:41:28 +08:00
clusterinfo_dump_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
clusterinfo_dump.go 24133 fix: --no-headers works with custom columns now 2016-07-07 10:04:09 +02:00
clusterinfo.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
cmd_test.go Added warning msg for kubectl get 2016-08-15 22:49:37 +00:00
cmd.go Added warning msg for kubectl get 2016-08-15 22:49:37 +00:00
completion.go Add zsh compatibility note completion cmd help 2016-08-11 13:49:44 -04:00
convert.go 24133 fix: --no-headers works with custom columns now 2016-07-07 10:04:09 +02:00
create_configmap_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
create_configmap.go add alias for createconfigmap 2016-08-04 10:35:15 +08:00
create_deployment_test.go Add "create deployment" sub-command 2016-08-08 13:24:30 +10:00
create_deployment.go Add "create deployment" sub-command 2016-08-08 13:24:30 +10:00
create_namespace_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
create_namespace.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00
create_quota_test.go Add --scopes to kubectl-create-quota and add tests 2016-07-26 14:12:35 +02:00
create_quota.go replace improper create quota alias 2016-08-04 08:02:14 -04:00
create_secret_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
create_secret.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00
create_service_test.go Add "create service" sub-commands 2016-08-08 12:31:21 +10:00
create_service.go Add "create service" sub-commands 2016-08-08 12:31:21 +10:00
create_serviceaccount_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
create_serviceaccount.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00
create_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
create.go Add "create deployment" sub-command 2016-08-08 13:24:30 +10:00
delete_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
delete.go Make more messages respect --quiet flag 2016-08-08 14:24:44 -07:00
describe_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
describe.go Support --all-namespaces in kubectl describe 2016-07-08 11:45:38 -04:00
drain_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
drain.go Merge pull request #26237 from duglin/UseConstant 2016-07-01 16:55:39 -07:00
edit.go Validation logic applied to edited file 2016-07-15 13:02:19 +02:00
exec_test.go Fix Windows terminal handling 2016-07-20 13:37:14 -04:00
exec.go Make more messages respect --quiet flag 2016-08-08 14:24:44 -07:00
explain.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00
expose_test.go Merge pull request #29523 from fraenkel/service_names_rfc1035 2016-08-02 10:33:16 -07:00
expose.go Merge pull request #29921 from andreykurilin/kubectl_typos 2016-08-03 13:43:32 -07:00
get_test.go Added warning msg for kubectl get 2016-08-15 22:49:37 +00:00
get.go Added warning msg for kubectl get 2016-08-15 22:49:37 +00:00
help.go Fix kubectl help command 2016-07-28 17:47:03 +03:00
label_test.go Merge pull request #27977 from ciwang/move-storage-examples 2016-07-08 21:45:38 -07:00
label.go Refactor Printer arguments 2016-07-14 16:23:02 +03:00
logs_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
logs.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00
namespace.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
patch_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
patch.go Refactor Printer arguments 2016-07-14 16:23:02 +03:00
portforward_test.go expose ready/stop channel 2016-08-12 15:45:57 +02:00
portforward.go expose ready/stop channel 2016-08-12 15:45:57 +02:00
proxy.go Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
replace_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
replace.go Merge pull request #30247 from ardnaxelarak/28695_suppress_noisy_output 2016-08-12 21:34:14 -07:00
rollingupdate_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
rollingupdate.go fix kubectl rolling update empty file cause panic issue 2016-07-26 02:37:55 -04:00
run_test.go Make sure --record=false is acknowledged when passed to commands 2016-07-15 11:24:05 -04:00
run.go Merge pull request #30247 from ardnaxelarak/28695_suppress_noisy_output 2016-08-12 21:34:14 -07:00
scale.go add timeout units to cmds help example 2016-08-03 16:36:51 -04:00
stop.go Make more messages respect --quiet flag 2016-08-08 14:24:44 -07:00
taint_test.go Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
taint.go Run goimports 2016-08-02 15:12:39 +03:00
top_node_test.go Implement kubectl top command with subcommands. 2016-08-11 17:25:18 +02:00
top_node.go Implement kubectl top command with subcommands. 2016-08-11 17:25:18 +02:00
top_pod_test.go Implement kubectl top command with subcommands. 2016-08-11 17:25:18 +02:00
top_pod.go Implement kubectl top command with subcommands. 2016-08-11 17:25:18 +02:00
top_test.go Implement kubectl top command with subcommands. 2016-08-11 17:25:18 +02:00
top.go Implement kubectl top command with subcommands. 2016-08-11 17:25:18 +02:00
version.go Merge pull request #26977 from joe2far/fix-help-strings 2016-07-07 00:12:22 -07:00