DEV Community

Munisekhar Udavalapati
Munisekhar Udavalapati

Posted on

1

kubernetes documentation

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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free β†’

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay