Scale a deployment

Changes the number of replicas right away

kubectl scale deployment/<name> --replicas=3 -n <ns>

tool
kubectl73 commands
tags
deployments

More kubectl commands

  • kubectl get events -A --sort-by='.lastTimestamp'

    Recent cluster events, oldest first; handy for a post-incident review

  • kubectl apply --server-side --dry-run=server -f file.yaml

    Checks the manifest against the live API server without changing anything

  • kubectl get deployment/<name> -n <ns> -o yaml

    Current state of the resource without managedFields; a good base for a new manifest

  • kubectl delete pod <name> -n <ns> --grace-period=0 --force

    Removes a pod stuck in Terminating right away; use with care

  • kubectl cp <ns>/<pod>:/remote/path ./local-path

    Copies a file from a running container to your machine

all 73 kubectl commands