Explain the deployment spec recursively

Prints the full tree of nested fields; great for finding valid field names

kubectl explain deploy.spec --recursive | less

tool
kubectl73 commands
tags
kubectlk8stroubleshooting

More kubectl commands

  • kubectl rollout pause deploy/<name> -n <ns>; kubectl rollout resume deploy/<name> -n <ns>

    Make several edits without a rollout for each one, then resume to apply them all at once

  • kubectl apply view-last-applied deploy/<name> -n <ns> -o yaml

    Shows the last-applied-configuration annotation, so you can compare what you meant with the live state

  • kubectl get events -A --field-selector type=Warning --sort-by=.lastTimestamp

    Cluster-wide Warning events, newest last; a fast way to find failing workloads

  • kubectl get pods -A --field-selector status.phase=Failed

    Lists pods in the Failed phase in all namespaces, for cleanup or investigation

  • kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' svc/<name> -n <ns> --timeout=120s

    Waits in CI until a Service gets an external IP; works with any jsonpath field

all 73 kubectl commands