kubectl annotate po [pod_name] [annotation]
kubectl annotateno [node_name]
Updating resources
Notes
Service account
kubectl edit sa [sa_name]
kubectl delete sa [sa_name]
Daemon set
kubectl edit ds [ds_name] -n kube-system
kubectl delete ds [ds_name]
Service
kubectl edit svc [svc_name]
kubectl delete svc [svc_name]
Stateless/Namespaced
kubectl edit deploy [deploy_name]
kubectl delete deploy [deploy_name]
kubectl expose deploy [deploy_name] --port=80 --type=NodePort
kubectl scale deploy [deploy_name] --replicas=5
kubectl delete ns
kubectl edit ns [ns_name]
Node/Pod
kubectl delete node [node_name]
kubectl delete pod [pod_name]
kubectl edit node [node_name]
kubectl edit pod [pod_name]
clear
kubectl drain [node_name] # empty the node
Maintain/Schedulable
kubectl cordon [node_name] # node maintenance
kubectl uncordon [node_name] # node is schedulable
Label
kubectl label [node_name] disktype=ssd
kubectl label [pod_name] env=prod
Taint
kubectl taint [node_name] [taint_name]
Comments