Description:
- Doc and Cheatsheet
- Transform CLI command to and back of kube-apiserver’s api HTTPS call to control clusters
- Must be configured to store credentials for each sluster (different Kubernetes Context)
- stored in config file in
$HOME/.kube/config
- stored in config file in
kubectl helpandkubectl api-resources
Synopis:
kubectl [command] [TYPE] [NAME] [flags]- Types = Resourse types
- Use
kubectl api-resourcesfor a complete list of supported resources.
- Use
-cargument to specify which container
- Types = Resourse types
0. Common flags:
-h,--help-n,--namespace
1. Getting started:
- kubectl create
- kubectl get
- kubectl run
- kubectl expose
- kubectl delete
2. App management:
- kubectl apply
- kubectl annotate
- kubectl autoscale
- kubectl debug
- kubectl diff
- kubectl edit
- kubectl kustomize
- kubectl label
- kubectl patch
- kubectl replace
- kubectl rolleout
- kubectl rolleout history
- kubectl scale
-
kubectl set: Configure existing application resources.
- kubectl wait
3. Working with apps:
- kubectl attach
-
kubectl auth
- kubectl cp
- kubectl describe
- kubectl exec
- kubectl logs
- .
- kubectl top
4. Cluster management:
- kubectl api-versions
- kubectl api-resources
- kubectl cluster-info
- kubectl cordon
- kubectl drain
- kubectl taint