From adb630d88e535911370fe971789391e7d68e1e73 Mon Sep 17 00:00:00 2001 From: lucperkins Date: Mon, 9 Jul 2018 13:49:23 -0700 Subject: [PATCH 1/4] Modify Resource Types section in kubectl cheat sheet --- .../en/docs/reference/kubectl/cheatsheet.md | 55 +++++-------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 632c3bc2aa..87bf02a899 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -241,47 +241,22 @@ $ kubectl taint nodes foo dedicated=special-user:NoSchedule ## Resource types -The following table includes a list of all the supported resource types and their abbreviated aliases: +List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [Kind](/docs/concepts/overview/working-with-objects/kubernetes-objects): -Resource type | Abbreviated alias --------------------- | -------------------- -`all` | -`certificatesigningrequests` |`csr` -`clusterrolebindings` | -`clusterroles` | -`componentstatuses` |`cs` -`configmaps` |`cm` -`controllerrevisions` | -`cronjobs` | -`customresourcedefinition` |`crd`, `crds` -`daemonsets` |`ds` -`deployments` |`deploy` -`endpoints` |`ep` -`events` |`ev` -`horizontalpodautoscalers` |`hpa` -`ingresses` |`ing` -`jobs` | -`limitranges` |`limits` -`namespaces` |`ns` -`networkpolicies` |`netpol` -`nodes` |`no` -`persistentvolumeclaims` |`pvc` -`persistentvolumes` |`pv` -`poddisruptionbudgets` |`pdb` -`podpreset` | -`pods` |`po` -`podsecuritypolicies` |`psp` -`podtemplates` | -`replicasets` |`rs` -`replicationcontrollers` |`rc` -`resourcequotas` |`quota` -`rolebindings` | -`roles` | -`secrets` | -`serviceaccount` |`sa` -`services` |`svc` -`statefulsets` |`sts` -`storageclasses` |`sc` +```console +$ kubectl api-resources +``` + +Other operations for exploring API resources: + +```console +$ kubectl api-resources --namespaced=true # All namespaced resources +$ kubectl api-resources --namespaced=false # All non-namespaced resources +$ kubectl api-resources -o name # All resources with simple output (just the resource name) +$ kubectl api-resources -o wide # All resources with expanded (aka "wide") output +$ kubectl api-resources --verbs=[list, get] # All resources that support the "list" and "get" request verbs +$ kubectl api-resources --api-group=extensions # All resources in the "extensions" API group +``` ### Formatting output From 202ff3b15d5780729888c06265971fc4865c49f9 Mon Sep 17 00:00:00 2001 From: lucperkins Date: Mon, 9 Jul 2018 13:52:42 -0700 Subject: [PATCH 2/4] Fix error in command syntax --- content/en/docs/reference/kubectl/cheatsheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 87bf02a899..55f59aed91 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -254,7 +254,7 @@ $ kubectl api-resources --namespaced=true # All namespaced resources $ kubectl api-resources --namespaced=false # All non-namespaced resources $ kubectl api-resources -o name # All resources with simple output (just the resource name) $ kubectl api-resources -o wide # All resources with expanded (aka "wide") output -$ kubectl api-resources --verbs=[list, get] # All resources that support the "list" and "get" request verbs +$ kubectl api-resources --verbs=list,get # All resources that support the "list" and "get" request verbs $ kubectl api-resources --api-group=extensions # All resources in the "extensions" API group ``` From 801c9d57659f2980f7a2b21e2b0054c65d1b7aea Mon Sep 17 00:00:00 2001 From: lucperkins Date: Mon, 9 Jul 2018 13:54:58 -0700 Subject: [PATCH 3/4] Change header level --- content/en/docs/reference/kubectl/cheatsheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 55f59aed91..e17919040c 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -239,7 +239,7 @@ $ kubectl cluster-info dump --output-directory=/path/to/cluster-state # Dump c $ kubectl taint nodes foo dedicated=special-user:NoSchedule ``` -## Resource types +### Resource types List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [Kind](/docs/concepts/overview/working-with-objects/kubernetes-objects): From 9a6089d73f63777647e6482fad073e29e0ac3b57 Mon Sep 17 00:00:00 2001 From: lucperkins Date: Thu, 12 Jul 2018 14:02:01 -0700 Subject: [PATCH 4/4] Change code block type to bash from console --- content/en/docs/reference/kubectl/cheatsheet.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 5002326ade..28eff23d6b 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -263,21 +263,13 @@ kubectl taint nodes foo dedicated=special-user:NoSchedule List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [Kind](/docs/concepts/overview/working-with-objects/kubernetes-objects): -```console -$ kubectl api-resources -``` - -### Resource types - -List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [Kind](/docs/concepts/overview/working-with-objects/kubernetes-objects): - -```console +```bash kubectl api-resources ``` Other operations for exploring API resources: -```console +```bash kubectl api-resources --namespaced=true # All namespaced resources kubectl api-resources --namespaced=false # All non-namespaced resources kubectl api-resources -o name # All resources with simple output (just the resource name)