Multinode k8s Cluster Deployment on CentOS7
First, clone this project thisproject
:
The prerequisite is to have virtualbox and vagrant on your system.
These VMs are all connected via an internal network named k8s-cluster on the second network interface eth1. The command to create the internal is shown below.
In fact each VM contains two Network Interfaces:
O&M: NAT and setup for SSH (to acces each node)
Internal Network to reach all the nodes
[win|mac] git clone https://github.com/davidgarciaMontreal/k8s_cluster_setup.git
[win|mac] cd k8s_cluster_setup/vagrant
[win|mac] vagrant up
Once the cluster is up you can access them with using the vagrant cli (note: you must under the directory k8s_cluster_setup/vagrant)
[win/macos] vagrant ssh master
[vagrant@master ~]$
or node-01 …
To join the cluster use the join command located in the master@~/current_config.log
[win|mac] vagrant ssh node-01
[vagrant@node-01 ~]$sudo kubeadm join 192.168.50.4:6443 --token uqv9vx.5pehqn6c172o900s --discovery-token-ca-cert-hash sha256:650d838c0f74b2510945241007e728f601e225d9637ed4947f35ccfe20abc544
Once logged in to the master node, generate the following token:
[vagrant@master ~]$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
Once you have generated the token on the master one, login with your browser to the following url:
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
To the extent possible under law, David Garcia has waived all copyright and related or neighboring rights to this work.