en:dev:env:kubernetes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:dev:env:kubernetes [2019/01/05 19:30] alexejsaileren:dev:env:kubernetes [2019/03/27 21:45] alexejsailer
Line 1: Line 1:
 ====== Kubernetes ====== ====== Kubernetes ======
 +
 +This is a smal how-to to setup a kmaster and a knode.
  
 With ubuntu 16.04 With ubuntu 16.04
Line 109: Line 111:
 apt-mark hold kubelet kubeadm kubectl apt-mark hold kubelet kubeadm kubectl
 </sxh> </sxh>
 +
 +**//From here all operations should be done only on kmaster//**
 +
  
   * check cgroup driver   * check cgroup driver
Line 143: Line 148:
 kubeadm init --apiserver-advertise-address=192.168.56.201 --pod-network-cidr=192.168.0.0/16 kubeadm init --apiserver-advertise-address=192.168.56.201 --pod-network-cidr=192.168.0.0/16
 </sxh> </sxh>
 +
 +  * you should see the following:
 +
 +<sxh bash;>
 +
 +  mkdir -p $HOME/.kube
 +  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
 +  sudo chown $(id -u):$(id -g) $HOME/.kube/config
 +
 +You should now deploy a pod network to the cluster.
 +Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
 +  https://kubernetes.io/docs/concepts/cluster-administration/addons/
 +
 +You can now join any number of machines by running the following on each node
 +as root:
 +
 +  kubeadm join 192.168.56.201:6443 --token usymgb.c5s530zqqs89napy --discovery-token-ca-cert-hash sha256:dadb42d6961e21cba21265dc345c23e1bf33bf9dcd26c96b4dd7eb9b66522614
 +
 +</sxh>
 +
  
 <sxh bash;> <sxh bash;>
Line 193: Line 218:
  
 <sxh bash;> <sxh bash;>
-kubectl proxykubectl proxy+kubectl proxy
 </sxh> </sxh>
  
Line 202: Line 227:
   * to reach it from the host os you can tunnel the port 8001 from kmaster to your host   * to reach it from the host os you can tunnel the port 8001 from kmaster to your host
  
 +So now the kmaster is running. For the knode you have to repeate all operations above until the bold message which says: **From here all operations should be done only on kmaster**. Just set a diffrent host **knode** and a new static IP **192.168.56.202**
 +
 +After all operations were executed successfully do the connection. To join type in the above join statement. This is exactly what you got as message after starting kubernetes on master:** Refere to the output above, it is the same!**
 +
 +<sxh bash;>
 +sudo kubeadm join 192.168.56.201:6443 --token usymgb.c5s530zqqs89napy --discovery-token-ca-cert-hash sha256:dadb42d6961e21cba21265dc345c23e1bf33bf9dcd26c96b4dd7eb9b66522614
 +</sxh>
 +
 +Sources:
 +
 +https://kubernetes.io/
  
  
  • en/dev/env/kubernetes.txt
  • Last modified: 2020/03/05 21:23
  • by 127.0.0.1