kubectl get pods -A
kubectl get services -A
kubectl delete pods POD_NAME --grace-period=0 --wait=false --force=true
kubectl delete services SERVICE_NAME --namespace NAMESPACE
kubectl apply -f PATH_TO_CONFIG.yaml
kubectl delete -f PATH_TO_CONFIG.yaml
kubectl rollout restart deployment -n NAMESPACE DEPLOYMENT_NAME
kubectl cp --retries=-1 POD_NAME:PATH_INSIDE_POD PATH_ON_HOST
Dropping out copy after 0 retries
error: unexpected EOF
imagePullPolicy
as Never
deployment.yaml
: imagePullPolicy: Never
kubectl cp LOCAL_PATH NAMESPACE/POD_NAME:PATH_IN_POD
-c
argument for specific containerkubectl exec -it POD_NAME -C CONTAINER_NAME -- SHELL
kubectl drain NODE_ID
--force
to force the removalkubectl port-forward pods/POD_NAME PORT_IN_LOCAL:PORT_IN_KUBE -n NAMESPACE
kubectl port-forward deployment/DEPLOYMENT_NAME PORT_IN_LOCAL:PORT_IN_KUBE -n NAMESPACE
kubectl port-forward replicaset/REPLICA_SET_NAME PORT_IN_LOCAL:PORT_IN_KUBE -n NAMESPACE
kubectl port-forward service/SERVICE_NAME PORT_IN_LOCAL:PORT_IN_KUBE -n NAMESPACE
kill -9 $(pidof kubectl)
--request-timeout=<value>