Kubernetes

kubectl Cheat Sheet
https://kubernetes.io/docs/reference/kubectl/cheatsheet/

Dump Kubernetes Objects
kubectl get componentstatuses
kubectl get configmaps
kubectl get daemonsets
kubectl get deployments
kubectl get events
kubectl get endpoints
kubectl get horizontalpodautoscalers
kubectl get ingress
kubectl get jobs
kubectl get limitranges
kubectl get nodes
kubectl get namespaces
kubectl get pods
kubectl get pods --all-namespaces -o wide
kubectl get persistentvolumes
kubectl get persistentvolumeclaims
kubectl get quota
kubectl get resourcequotas
kubectl get replicasets
kubectl get replicationcontrollers
kubectl get secrets
kubectl get serviceaccounts
kubectl get services

Access Kubernetes cluster without floating IP
CLUSTER_JUMPHOST=1.2.3.4
CLUSTER_MASTER=10.0.0.5
sshuttle --python /usr/bin/python3 --remote ubuntu@${CLUSTER_JUMPHOST} ${CLUSTER_MASTER}/32
export no_proxy=$no_proxy,10.0.0.5

Deploy nginx

kubectl create deployment nginx --image=nginx
kubectl scale deployment --replicas 2 nginx
kubectl get pods -o wide
# kubectl create service nodeport nginx --tcp=80:80
kubectl expose deployment nginx --type=LoadBalancer --name=nginx --port=80

Debug
systemctl list-units --failed
systemctl status kubelet.service
systemctl status kube-apiserver.service
kubectl get pods --all-namespaces -o wide
kubectl -v=7 get nodes
kubectl logs -f -n default nginx-5c7588df-8k5lh

Links
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md
https://github.com/coreos/matchbox/tree/master/examples/terraform/bootkube-install