Cluster contextKubernetes
kubectl config get-contexts
List kubeconfig contexts and highlight the active one.
kubectl config get-contexts
kubectl context, workload inspection, scaling, and debugging tools.
List kubeconfig contexts and highlight the active one.
kubectl config get-contexts
Customize default namespaces or users for a context.
kubectl config set-context --current --namespace=<namespace>
kubectl get deployments
List workloads with wide details or watch for changes.
kubectl get pods -n <namespace> -o wide
Inspect detailed resource metadata and events.
kubectl describe pod <pod> -n <namespace>
Stream container logs or view historical entries.
kubectl logs <pod> -c <container> -n <namespace>
Scale deployments, statefulsets, or replicasets to desired counts.
kubectl scale deployment <name> --replicas=<count>
Monitor or rollback deployment rollouts.
kubectl rollout status deployment/<name>
Apply declarative configuration changes.
kubectl apply -f <manifest.yaml>
Run commands within containerized workloads.
kubectl exec -it <pod> -- /bin/sh
Forward local ports to pods or services for debugging.
kubectl port-forward deployment/<name> 8080:80
Fetch resource metrics for nodes or pods.
kubectl top nodes