kubectl#
Links#
Display Resources#
all:
kubectl get all -A -o widecustom resource definitions:
kubectl get crdingressroutes (custom resource definition from Traefik):
kubectl get ingressroutes -Acomponent statuses:
kubectl get cslist Longhorn replica:
kubectl get replica -A
Create Resources#
expose deployment:
kubectl expose deploy <deployment_name> --port <port_number>- more
Delete Resources#
delete all from namespace:
kubectl delete all --all -n <namespace>
Special Commands#
execute bash on pod:
kubectl exec --stdin --tty <pod_name> -- /bin/bashstop / start a pod:
kubectl scale --replicas=<0/1> <deployment_name>schedule Pods on the control-plane:
kubectl taint nodes --all node-role.kubernetes.io/master-write yaml for kubectl command to file:
kubectl <command> --dry-run=client -o yaml > <file>.yamlconvert config file to configmap:
kubectl create configmap <config_map_name> --from-file=<config_file_name> --dry-run=client -o yaml > <filename>.yaml