This is a set of bash scripts and config file that I used to setup a custumized kubernetes cluster. I recommend you using minikube or follow other solutions in kubernetes's website if you don't have special requirement. This is only for thoes who has to setup a custumized kubernetes cluster, especially in bare-matel environment(it should also work in virtual machines, though), for some reason. I also recommend you reading Creating a Custom Cluster from Scratch and Deploying Kubernetes with Calico Networking on Ubuntu to better understand what it's doing.
It works on amd64 linux system. Kubernetes version is v1.5.4; Calico(for overlay network) version is v1.0.2
Run it on the master machine. It will setup the master services. For worker nodes, currently it only setup the master machine as the first worker node. Scripts for other worker nodes may (or may not :-P) come soon.
(not sure if the setup script works... I myself only used the reset one. It's great if anyone could
provide some feed back _(:з」∠)_
)
- install docker from any source you like, and start it
- get this machine's IP and fill it in the file ./ip
- run setup.sh
- wait a few seconds
This does three things:
- start the services of the master
- connect the command line management tool kubectl to the master
- set current machine as the first working node and connect it to the master
To check if it works:
- run
docker ps
, if you see containers with name "api server", "scheduler", etc., then kubernetes master is successfully setup - run
kubectl get pods
, if you get meaningful result(or "no resources"), then kubectl is successfully connected to the master. If it complains the ip of master is incorrect, then it failed to connect to the master. - run
kubectl get nodes
, if you see a node, then this machine is successfully setup as a worker node. If you see no resources, then this setup has failed.
If the ip does not change, then no need to do anything
- get this machine's IP and fill it in the file ./ip
- run reset.sh
- wait a few seconds
- (optional) reboot