kubectl get deployments -AShow deployments across namespaces.
Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, autoscaling, rollouts, and workload maintenance.
Create, inspect, and roll out Deployment changes.
kubectl get deployments -AShow deployments across namespaces.
kubectl describe deployment web -n paymentsInspect rollout state, replicas, and events.
kubectl set image deployment/web web=ghcr.io/acme/web:2.4.1 -n paymentsRoll out a new container image.
kubectl set resources deployment/web -c web --limits=cpu=500m,memory=512Mi --requests=cpu=200m,memory=256Mi -n paymentsUpdate requests and limits from the CLI.
kubectl set env deployment/web APP_ENV=production -n paymentsSet or update environment variables.
kubectl rollout status deployment/web -n paymentsBlock until the rollout finishes or fails.
kubectl rollout history deployment/web -n paymentsList deployment revisions.
kubectl rollout undo deployment/web -n paymentsRoll back to the previous revision.
kubectl rollout undo deployment/web --to-revision=3 -n paymentsRoll back to a chosen revision.
kubectl rollout restart deployment/web -n paymentsTrigger a restart without changing the image.
Operate stateful and node-wide workloads.
kubectl get statefulsets -AShow StatefulSets across namespaces.
kubectl describe statefulset postgres -n dataInspect ordinal pods, PVCs, and update strategy.
kubectl scale statefulset postgres --replicas=3 -n dataChange StatefulSet replica count.
kubectl rollout status statefulset/postgres -n dataWait for StatefulSet updates to finish.
kubectl get daemonsets -AShow DaemonSets across namespaces.
kubectl describe daemonset node-exporter -n observabilityInspect node coverage and update status.
kubectl rollout restart daemonset/node-exporter -n observabilityTrigger a rolling restart for a DaemonSet.
kubectl rollout status daemonset/node-exporter -n observabilityWatch daemonset rollout status.
Run batch and scheduled workloads.
kubectl get jobs -AShow Jobs across namespaces.
kubectl describe job db-migrate -n dataInspect completions, pods, and failures.
kubectl delete job db-migrate -n dataRemove a finished or failed Job.
kubectl create job --from=cronjob/nightly-backup manual-backup-20260305 -n opsTrigger an ad hoc run from an existing CronJob.
kubectl get cronjobs -AShow CronJobs across namespaces.
kubectl describe cronjob nightly-backup -n opsInspect the cron schedule, history limits, and concurrency policy.
kubectl patch cronjob nightly-backup -n ops -p '{"spec":{"suspend":true}}'Pause CronJob scheduling without deleting it.
kubectl patch cronjob nightly-backup -n ops -p '{"spec":{"suspend":false}}'Resume a suspended CronJob.
Scale workloads manually and automatically.
kubectl autoscale deployment web --cpu-percent=70 --min=2 --max=10 -n paymentsCreate a HorizontalPodAutoscaler for a deployment.
kubectl get hpa -AShow HorizontalPodAutoscalers.
kubectl describe hpa web -n paymentsInspect metrics, thresholds, and scaling recommendations.
kubectl scale replicaset web-7cbb9f9d44 --replicas=0 -n paymentsDirectly scale a ReplicaSet when needed.
kubectl get rs -n paymentsShow ReplicaSets created by Deployments.
kubectl describe rs web-7cbb9f9d44 -n paymentsInspect pod template and controller ownership.
Shortcuts for live workload operations.
kubectl wait --for=condition=Ready pod -l app=web -n payments --timeout=180sWait on readiness conditions.
kubectl wait --for=condition=Available deployment/web -n payments --timeout=180sBlock until a deployment is available.
kubectl patch deployment web --subresource=scale -p '{"spec":{"replicas":8}}' -n paymentsUpdate the scale subresource directly.
kubectl get pods -n payments -o custom-columns=NAME:.metadata.name,OWNER:.metadata.ownerReferences[0].nameShow which controller owns each pod.
kubectl drain worker-02 --ignore-daemonsets --delete-emptydir-dataSafely evict workloads before maintenance.
kubectl uncordon worker-02Allow new pods to schedule on a node again.
kubectl cordon worker-02Mark a node unschedulable.