a ship carrying cargo containers

Kubernetes Cheat-sheet

kubectl get pods -n namespace ### get the id of the pod just made for given namespace

kubectl logs namespace-tag-6b59cf4fbc-k5wdc -n namespace ### show the logs of what’s happening to it

kubectl get ingress -A ### get a list of ingress points for all namespace

kubectl get svc -A ### get a list of all services running for all namespaces

kubectl exec -it container-tag-6b59cf4fbc-k5wdc -n namespace sh ### open container and run shell on it

helm template -f values.yaml . > deployChart.yaml ### run the chart against template but just output to file

helm install -name appName . -n namespace --create-namespace ### make stuff from current folder from Chart.yaml

helm install -name appName. -n namespace --debug --dry-run ### try out creation but don’t actually make

helm uninstall appName-n namespace ### delete stuff via helm

kubectl get pods --field-selector=status.phase!=Running -A ### get all the pods that are not running

kubectl get deployments -A ### get all the deployments

kubectl edit deployment spark-query -n namespace ### edit the one deployment ‘spark-query’

kubectl scale deployment portal -n namespace --replicas=1 ### add one pod to ‘portal’ service

kubectl get deploy -n namespace -o yaml ### output the deployment to new yaml file

kubectl edit deploy appName -n namespace ### edit the deployment in vi

kubectl edit cm appName -n namespace

kubectl describe pod container-tag-6b59cf4fbc-k5wdc -n namespace ### get details on pod

kubectl get secret -n namespace

kubectl edit secret default-token-qcnfb -n namespace

kubectl create secret generic azure-app-secret --from-literal=azurestorageaccountname=storageName --from-literal=azurestorageaccountkey=[key]  -n namespace

kubectl delete pod --all -n namespace ### delete all the pods in namespace


Posted

in

by

Tags: