View Cluster Resources
kubectl get pods # List all pods
kubectl get deployments # List all deployments
kubectl get services # List all services
Inspect Specific Resources
kubectl describe pod # Get details about a specific pod
kubectl describe deployment # Get details about a specific deployment
Inspect Logs
kubectl logs # Get logs of a specific pod
kubectl logs -c # If there are multiple containers in the pod
Execute Commands in Pods
kubectl exec -it -- /bin/bash # Open a shell in a running pod
kubectl exec -it -- printenv # View environment variables inside a pod
Create and Expose a Deployment in a Local Cluster
kubectl create deployment hello-world --image=nginx
kubectl expose deployment hello-world --type=NodePort --port=80
kubectl get all
Top comments (0)