Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
en:dev:env:kubernetes [2019/01/05 19:30] – alexejsailer | en: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 | ||
</ | </ | ||
+ | |||
+ | **//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/ | kubeadm init --apiserver-advertise-address=192.168.56.201 --pod-network-cidr=192.168.0.0/ | ||
</ | </ | ||
+ | |||
+ | * you should see the following: | ||
+ | |||
+ | <sxh bash;> | ||
+ | |||
+ | mkdir -p $HOME/.kube | ||
+ | sudo cp -i / | ||
+ | sudo chown $(id -u):$(id -g) $HOME/ | ||
+ | |||
+ | You should now deploy a pod network to the cluster. | ||
+ | Run " | ||
+ | https:// | ||
+ | |||
+ | You can now join any number of machines by running the following on each node | ||
+ | as root: | ||
+ | |||
+ | kubeadm join 192.168.56.201: | ||
+ | |||
+ | </ | ||
+ | |||
<sxh bash;> | <sxh bash;> | ||
Line 193: | Line 218: | ||
<sxh bash;> | <sxh bash;> | ||
- | kubectl | + | kubectl proxy |
</ | </ | ||
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: | ||
+ | </ | ||
+ | |||
+ | Sources: | ||
+ | |||
+ | https:// | ||