Kubernetes Cheat Sheet

From Gejoreuy
Jump to navigation Jump to search



Run Kubernetes Dashboard

Run this comand from kubernetes master.

[root@gejoreuy-kubmaster ~]# kubectl proxy --address
Starting to serve on [::]:8001

Then setup tunnels in Putty from localhost to port 8001.

Leave Kubernetes Master

Run below command in kubernetes node that want to leave the master.

[root@gejoreuy-kubnode2 ~]# kubeadm reset

Delete Node

After some node leave, this node which left has status NotReady in kubernetes master.

[root@gejoreuy-kubmaster ~]# kubectl get nodes
gejoreuy-kubmaster   Ready      master   16h   v1.17.3
gejoreuy-kubnode1    Ready      <none>   16h   v1.17.3
gejoreuy-kubnode2    NotReady   <none>   16h   v1.17.3

Scalling Deployments

To scaling up or scalling down deployment services in Kubernetes.

[root@gejoreuy-kubmaster ~]# kubectl -n [namespace] scale --replicas=[replica-count] deployment/[service-name] --insecure-skip-tls-verify=true