π Cluster & Context Management
- π kubectl config get-contexts β List all contexts
- β kubectl config current-context β Show current context
- π§ kubectl config use-context CONTEXT_NAME β Switch context
- β kubectl config set-context β Modify context settings
- πΊοΈ kubectl cluster-info β Display cluster info
- π§ͺ kubectl version βshort β Show client and server version
- π kubectl config view β Show kubeconfig file details
- π£ kubectl delete-context CONTEXT_NAME β Delete context
π¦ Pod Management
- π kubectl get pods β List all pods
- π΅οΈββοΈ kubectl describe pod POD_NAME β Detailed pod info
- π οΈ kubectl edit pod POD_NAME β Edit pod configuration
- β kubectl delete pod POD_NAME β Delete pod
- π§ kubectl apply -f pod.yaml β Apply pod config from file
- π₯ kubectl create -f pod.yaml β Create pod from file
- π¦ kubectl get pods -o wide β Pod details with node info
- π kubectl rollout restart deployment DEPLOY_NAME β Restart pods
π Deployment Management
- π kubectl get deployments β List deployments
- π kubectl describe deployment DEPLOY_NAME β Deployment details
- π¦ kubectl create deployment nginx βimage=nginx β Create deployment
- π οΈ kubectl edit deployment DEPLOY_NAME β Edit deployment
- π₯ kubectl apply -f deploy.yaml β Apply from file
- β kubectl delete deployment DEPLOY_NAME β Delete deployment
- π kubectl rollout status deployment DEPLOY_NAME β Show rollout status
- π°οΈ kubectl rollout history deployment DEPLOY_NAME β Show rollout history
- β©οΈ kubectl rollout undo deployment DEPLOY_NAME β Rollback to previous version
π§± ReplicaSets & Replication
- π kubectl describe rs RS_NAME β Describe a ReplicaSet
- π kubectl get rs β List ReplicaSets
- β kubectl delete rs RS_NAME β Delete ReplicaSet
- π¦ kubectl scale deployment DEPLOY_NAME βreplicas=5 β Scale up/down
π§΅ Services Management
- π kubectl get svc β List all services
- π‘ kubectl expose deployment DEPLOY_NAME βtype=NodePort βport=80 β Expose service
- π₯ kubectl apply -f svc.yaml β Create service from file
- π kubectl describe svc SVC_NAME β Service details
- β kubectl delete svc SVC_NAME β Delete service
π Logs, Debug & Monitoring
- π kubectl logs POD_NAME β Show pod logs
- π kubectl logs -f POD_NAME β Stream pod logs
- π― kubectl exec -it POD_NAME β /bin/bash β Exec into a container
- π΅οΈ kubectl top pod β Resource usage of pods
- π΅οΈ kubectl top node β Resource usage of nodes
- π¦ kubectl port-forward svc/SVC_NAME 8080:80 β Port forward to service
π ConfigMap & Secrets
- π kubectl get configmaps β List ConfigMaps
- π₯ kubectl create configmap my-config βfrom-literal=key=value β Create ConfigMap
- π¦ kubectl apply -f configmap.yaml β Create from file
- π kubectl get secrets β List secrets
- π₯ kubectl create secret generic my-secret βfrom-literal=key=value β Create secret
- π kubectl describe secret SECRET_NAME β Secret details
π¦ Volumes & Storage
- π kubectl get pvc β List Persistent Volume Claims
- π₯ kubectl apply -f pvc.yaml β Apply PVC
- π¦ kubectl get pv β List Persistent Volumes
- π§± kubectl get storageclass β View StorageClasses
ποΈ Namespaces
- π kubectl get namespaces β List all namespaces
- π₯ kubectl create namespace my-ns β Create a namespace
- β kubectl delete namespace my-ns β Delete a namespace
- π kubectl config set-context βcurrent βnamespace=my-ns β Set default namespace
π§ͺ Jobs & CronJobs
- π₯ kubectl apply -f job.yaml β Create a job
- π kubectl get jobs β List jobs
- π₯ kubectl apply -f cronjob.yaml β Create a cronjob
- π kubectl get cronjobs β List CronJobs
- π΅οΈ kubectl describe job JOB_NAME β Describe job
π§° Custom Resources (CRDs)
- π kubectl get crds β List all CRDs
- π₯ kubectl apply -f crd.yaml β Apply a CRD
- π kubectl describe crd CRD_NAME β Describe CRD
π Networking & Ingress
- π kubectl get ingress β List ingress
- π₯ kubectl apply -f ingress.yaml β Apply ingress rule
- π kubectl describe ingress INGRESS_NAME β Ingress details
- π kubectl get networkpolicies β List network policies
π‘οΈ Security & RBAC
- π kubectl get roles,rolebindings β View roles and bindings
- π₯ kubectl apply -f role.yaml β Apply a role
- π₯ kubectl apply -f rolebinding.yaml β Bind role to user/service account
- π kubectl get serviceaccounts β List service accounts
- π₯ kubectl create serviceaccount my-sa β Create service account
π§Ή Cleanup & Troubleshooting
- π§Ή kubectl delete -f file.yaml β Delete resources from file
- π kubectl describe node NODE_NAME β Node details
- π kubectl get events β Show recent events
- π¦ kubectl get all β View all resources
- βοΈ kubectl api-resources β List all API resources
- π kubectl explain pod β Show API schema docs
π§ͺ Testing & YAML Generator (Bonus)
- π¦ kubectl run nginx βimage=nginx β Run a test pod
- π₯ kubectl create deployment nginx βimage=nginx βdry-run=client -o yaml β Generate YAML
- π₯ kubectl expose pod nginx βport=80 βdry-run=client -o yaml β YAML for a service
