🦄

Claudio Petrini

Kubernetes cheat sheet

Commands

Get information about pod

kubectl describe pods mypodname

Get Kubernetes secret in YAML format

kubectl get secret <name> -o yaml

Add label to a pod

kubectl label pods <pod> key=value

Apply changes from url

kubectl apply -f url

Scale with a parametric number of replicas

kubectl scale deployment <name> --replicas #

Open an SSH shell on the pod:

kubectl exec -it <pod> -- /bin/bash

Investigate deployment

kubectl get deployment <name> -o yaml

Show labels

kubectl get pods --show-labels

Made with love in Rome.