Kubernetes

Changelog
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md

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
kubectl -n ingress-nginx get pods

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

Deploy apache

kubectl create deployment apache --image=httpd
kubectl scale deployment --replicas 3 apache
kubectl expose deployment apache --type=LoadBalancer --name=apache --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

Documentation
https://kubernetes.io/docs/reference/kubectl/cheatsheet/ - kubectl Cheat Sheet
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands

Configuration

# ~/.kube/config 
apiVersion: v1
clusters:
- cluster:
    server: https://10.11.22.33:6443
  name: api-server
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []
foo.bar

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