项目作者: davidgarciaMontreal

项目描述 :
Multinode k8s Cluster Deployment on CentOS7
高级语言: Ruby
项目地址: git://github.com/davidgarciaMontreal/k8s_cluster_setup.git
创建时间: 2018-12-23T20:13:40Z
项目社区:https://github.com/davidgarciaMontreal/k8s_cluster_setup

开源协议:

下载


Multi-Node k8s Cluster

Usage

First, clone this project thisproject:
The prerequisite is to have virtualbox and vagrant on your system.

  1. master
  2. node-01
  3. node-02
  4. node-03

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:

  1. O&M: NAT and setup for SSH (to acces each node)


    Network Interface One


    Clicking on the “Port Forwarding” button will show you the following seting for the master node:


    Network Interface One Port Forwarding Setting

  2. Internal Network to reach all the nodes


Network Interface Two Port Internal Network k8s-cluster

  1. [win|mac] git clone https://github.com/davidgarciaMontreal/k8s_cluster_setup.git
  2. [win|mac] cd k8s_cluster_setup/vagrant
  3. [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)

  1. [win/macos] vagrant ssh master
  2. [vagrant@master ~]$

or node-01 …

To join the cluster use the join command located in the master@~/current_config.log

  1. [win|mac] vagrant ssh node-01
  2. [vagrant@node-01 ~]$sudo kubeadm join 192.168.50.4:6443 --token uqv9vx.5pehqn6c172o900s --discovery-token-ca-cert-hash sha256:650d838c0f74b2510945241007e728f601e225d9637ed4947f35ccfe20abc544

Generate A Bearer Token for the Web UI

Once logged in to the master node, generate the following token:

  1. [vagrant@master ~]$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')

WEB UI URL on your local env

Once you have generated the token on the master one, login with your browser to the following url:

  1. http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

License

CC0

To the extent possible under law, David Garcia has waived all copyright and related or neighboring rights to this work.