kubectl get
Jump to navigation
Jump to search
↑ https://stackoverflow.com/a/45046340/9269906
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
Possible resource types include (case insensitive): pods (po), services (svc), replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs), limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), namespaces (ns), endpoints (ep), horizontalpodautoscalers (hpa), serviceaccounts or secrets.
k get deploy,rs,ingress,svc,pods,cr,certificate,secrets,endpointslices,endpoints k events -A k logs nginx-ingress-controller k describe deploy,rs,ingress,svc,pods,cr,certificate,secrets,endpointslices,endpoints
Contents
Examples[edit]
kubectl get --helpkubectl get allkubectl get all -Akubectl get svc,pods,ingress,deployments.../...kubectl get apiserviceskubectl get api-resourceskubectl get certificateskubectl get --raw /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations | jqkubectl get clusterroleskubectl get crdkubectl get configmapkubectl get deploymentkubectl get endpointskubectl get eventskubectl get hpakubectl get limitrangekubectl get namespaceskubectl get pvckubectl get replicasetkubectl get statefulsetskubectl get networkpolicykubectl get nodeskubectl get nodes -wkubectl get podskubectl get pod PODNAME -n NAMESPACE -o yaml | kubectl replace --force -f -[1]kubectl get priorityclasskubectl get provisionerkubectl get psp eks.privilegedkubectl get secretkubectl get serviceskubectl get svckubectl get ServiceAccountkubectl get pod NAME_POD --namespace=MY_TEST_NAMESPACEkubectl get gatewaykubectl get ingresskubectl get vmskubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --ignore-not-found --show-kind -n your-namespace
kubectl get You must specify the type of resource to get. Use "kubectl api-resources" for a complete list of supported resources. error: Required resource not specified. Use "kubectl explain <resource>" for a detailed description of that resource (e.g. kubectl explain pods). See 'kubectl get -h' for help and examples
Errors[edit]
kubectl get nodes error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
Related terms[edit]
See also[edit]
creationTimestamp, ResourceVersion, SelfLink (deprecated)kubectl get: [all|componentstatus | pods | apiservices | events|event|nodes|replicaset|services|svc|namespaces|hpa|secret | deployments | serviceaccounts | endpoints | daemonset | networkpolicy],kubectl get -h- Kubectl information commands:
cluster-info|view|pods|nodes|services|version|describe | logs kubectl: [cp | config | wait | create|delete|edit | explain |,apply|exec|get|set|drain | uncordon | rolling-update|rollout|logs|run|auth|label | annotate|version|top|diff|debug|replace|describe|port-forward | proxy|scale|rollout|api-resources| expose deployment | expose | patch | attach | get endpoints | ~/.kube/config | kubectl logs --help | kubectl --help, kubectl-convert, kubectl autoscale, kubectl.kubernetes.io--dry-run
Advertising: