k3s/docs/user-guide/kubectl
Kubernetes Submit Queue 229d2df48a
Merge pull request #42873 from xilabao/add-apiresources-command
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add kubectl api-resources command

**What this PR does / why we need it**:
As the RBAC role need to be related to resources. I think we can use the command to get the supported resources. 

```
# ./cluster/kubectl.sh api-resources   
NAME                                  SHORTNAMES   APIGROUP                       NAMESPACED   KIND
bindings                                                                          true         Binding
componentstatuses                     cs                                          false        ComponentStatus
configmaps                            cm                                          true         ConfigMap
endpoints                             ep                                          true         Endpoints
events                                ev                                          true         Event
limitranges                           limits                                      true         LimitRange
namespaces                            ns                                          false        Namespace
nodes                                 no                                          false        Node
persistentvolumeclaims                pvc                                         true         PersistentVolumeClaim
persistentvolumes                     pv                                          false        PersistentVolume
pods                                  po                                          true         Pod
podtemplates                                                                      true         PodTemplate
replicationcontrollers                rc                                          true         ReplicationController
resourcequotas                        quota                                       true         ResourceQuota
secrets                                                                           true         Secret
serviceaccounts                       sa                                          true         ServiceAccount
services                              svc                                         true         Service
externaladmissionhookconfigurations                admissionregistration.k8s.io   false        ExternalAdmissionHookConfiguration
initializerconfigurations                          admissionregistration.k8s.io   false        InitializerConfiguration
customresourcedefinitions             crd          apiextensions.k8s.io           false        CustomResourceDefinition
apiservices                                        apiregistration.k8s.io         false        APIService
controllerrevisions                                apps                           true         ControllerRevision
daemonsets                            ds           apps                           true         DaemonSet
deployments                           deploy       apps                           true         Deployment
replicasets                           rs           apps                           true         ReplicaSet
statefulsets                          sts          apps                           true         StatefulSet
tokenreviews                                       authentication.k8s.io          false        TokenReview
localsubjectaccessreviews                          authorization.k8s.io           true         LocalSubjectAccessReview
selfsubjectaccessreviews                           authorization.k8s.io           false        SelfSubjectAccessReview
subjectaccessreviews                               authorization.k8s.io           false        SubjectAccessReview
horizontalpodautoscalers              hpa          autoscaling                    true         HorizontalPodAutoscaler
jobs                                               batch                          true         Job
certificatesigningrequests            csr          certificates.k8s.io            false        CertificateSigningRequest
daemonsets                            ds           extensions                     true         DaemonSet
deployments                           deploy       extensions                     true         Deployment
ingresses                             ing          extensions                     true         Ingress
networkpolicies                       netpol       extensions                     true         NetworkPolicy
podsecuritypolicies                   psp          extensions                     false        PodSecurityPolicy
replicasets                           rs           extensions                     true         ReplicaSet
networkpolicies                       netpol       networking.k8s.io              true         NetworkPolicy
poddisruptionbudgets                  pdb          policy                         true         PodDisruptionBudget
clusterrolebindings                                rbac.authorization.k8s.io      false        ClusterRoleBinding
clusterroles                                       rbac.authorization.k8s.io      false        ClusterRole
rolebindings                                       rbac.authorization.k8s.io      true         RoleBinding
roles                                              rbac.authorization.k8s.io      true         Role
podpresets                                         settings.k8s.io                true         PodPreset
storageclasses                        sc           storage.k8s.io                 false        StorageClass
```
**Which issue this PR fixes**: fixes https://github.com/kubernetes/kubernetes/issues/42932

**Special notes for your reviewer**:

**Release note**:

```release-note
add kubectl api-resources command to discovery of resources
```
2018-04-03 14:35:09 -07:00
..
kubectl.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_alpha.md Add documentation for alpha diff 2017-10-23 17:05:23 -07:00
kubectl_alpha_diff.md Add documentation for alpha diff 2017-10-23 17:05:23 -07:00
kubectl_annotate.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_api-resources.md add kubectl api-resources command 2018-03-09 17:47:17 +08:00
kubectl_api-versions.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_apply.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_apply_edit-last-applied.md add `kubectl apply edit-last-applied` subcommand 2017-05-26 00:20:48 +08:00
kubectl_apply_set-last-applied.md add apply-set-last-applied subcommand 2017-02-24 11:11:39 +08:00
kubectl_apply_view-last-applied.md Add apply view last-applied subcommand 2017-02-21 20:08:25 +08:00
kubectl_attach.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_auth.md add kubectl can-i to see if you can perform an action 2017-02-23 09:12:35 -05:00
kubectl_auth_can-i.md add kubectl can-i to see if you can perform an action 2017-02-23 09:12:35 -05:00
kubectl_auth_reconcile.md add reconcile command to kubectl auth 2017-08-30 16:04:00 -04:00
kubectl_autoscale.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_certificate.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_certificate_approve.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_certificate_deny.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_cluster-info.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_cluster-info_dump.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_completion.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_current-context.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_delete-cluster.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_delete-context.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_get-clusters.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_get-contexts.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_rename-context.md Add `kubeclt config rename-context` 2017-05-26 15:49:30 -03:00
kubectl_config_set-cluster.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_set-context.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_set-credentials.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_set.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_unset.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_use-context.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_config_view.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_convert.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_cordon.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_cp.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_clusterrole.md Added `kubectl create clusterrole` command. 2017-02-22 10:30:41 +08:00
kubectl_create_clusterrolebinding.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_configmap.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_deployment.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_job.md Fixes #47538: Add functionality for manually creating a Job instance from a CronJob 2018-02-22 14:30:37 +01:00
kubectl_create_namespace.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_poddisruptionbudget.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_priorityclass.md add create subcommand for priorityclass 2017-11-07 15:03:01 +08:00
kubectl_create_quota.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_role.md Added generated docs for kubectl create role command. 2017-02-10 13:10:47 +08:00
kubectl_create_rolebinding.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_secret.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_secret_docker-registry.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_secret_generic.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_secret_tls.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_service.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_service_clusterip.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_service_externalname.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_service_loadbalancer.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_service_nodeport.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_create_serviceaccount.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_delete.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_describe.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_drain.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_edit.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_exec.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_explain.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_expose.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_get.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_label.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_logs.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_options.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_patch.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_plugin.md Plugins are loaded under the 'kubectl plugin' command 2017-04-28 01:34:07 -03:00
kubectl_port-forward.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_proxy.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_replace.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rolling-update.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rollout.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rollout_history.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rollout_pause.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rollout_resume.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rollout_status.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_rollout_undo.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_run.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_scale.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_set.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_set_env.md Generated documentation for kubectl set env 2017-08-25 19:53:23 +08:00
kubectl_set_image.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_set_resources.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_set_selector.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_set_serviceaccount.md Changes for updating serviceaccount of a resource. 2017-08-14 12:41:19 +05:30
kubectl_set_subject.md add set rolebinding/clusterrolebinding command 2017-05-05 09:55:35 +08:00
kubectl_taint.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_top.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_top_node.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_top_pod.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_uncordon.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00
kubectl_version.md run hack/update-generated-docs.sh to strip munge tags 2017-02-16 10:17:17 -08:00