List kubeconfig contexts

Show all contexts in current kubeconfig

kubectl config get-contexts

tool
kubectl73 commands
tags
config

More kubectl commands

  • KUBECONFIG=~/.kube/config:~/.kube/cluster2.yaml kubectl config view --flatten > ~/.kube/merged.yaml

    Combine multiple kubeconfig files into one

  • kubectl config set-context --current --namespace=<ns>

    Avoid typing -n on every command for this context

  • kubectl cluster-info

    Show API server and CoreDNS endpoints

  • kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{": "}{range .status.conditions[*]}{.type}={.status},{" "}{end}{"\n"}{end}'

    Show all conditions per node (Ready, MemoryPressure, DiskPressure)

  • kubectl create job --from=cronjob/<name> manual-run -n <ns>

    Immediately run a CronJob as a one-off Job

all 73 kubectl commands