K8s Kubectl

less than 1 minute read

This is a reminder of kubectl commands for those like me who won’t use kubectl often.

Getting Stuff

Basics:

kubectl get all # Get deployments, pods, services etc.
kubectl get pod 
kubectl get configmap
kubectl get secret
kubectl get node # What the cluster is running on.

More info:

kubectl get all -o wide
kubectl get node -o wide # Gives us IP address to the cluster

Get full details of something:

kubectl describe pod pod-name
kubectl describe svc service-name

Checking logs

kubectl logs podname
kubectl logs podname -f # Stream logs

Deploying stuff

kubectl apply -f ./config.yaml