WARNING: These instructions must be run as root
, and will expose all standard Kubernetes ports and a few non-standard ports to potential security attacks. Use at your own risk.
Create a Kubernetes clusters. Tested on Ubuntu baremetal and AWS EC2.
- Ubuntu 18.04
- Docker
git clone https://github.com/mingfang/docker-kubernetes-master
cd docker-kubernetes-master
./build
./run
The Master is now running
Note: Tested on Ubuntu 18.04. Newer versions should work but not tested.
git clone https://github.com/mingfang/docker-kubernetes-node
cd docker-kubernetes-node
./build
- On the Master, run
docker exec kmaster /bootstrap-tokens.sh
to generate the keys needed. - On the Node, run the command printed by #4. Should look something like this
KUBELET_TOKEN=s.oKCwIqfs7LGbIHJv666K9oFV PROXY_TOKEN=s.4TkiUcFsscWufhHUOzPjKgxn ./run <master-host>
The Node is now running. Repeat for every host that runs the Nodes.
alias kubectl='docker exec kmaster kubectl'
on the Master hostkubectl get nodes
- You should see all the Nodes running
NAME LABELS STATUS
192.168.1.160 host=minux,kubernetes.io/hostname=192.168.1.160 Ready
192.168.1.162 host=vm2,kubernetes.io/hostname=192.168.1.162 Ready
192.168.1.163 host=vm3,kubernetes.io/hostname=192.168.1.163 Ready
192.168.1.164 host=vm4,kubernetes.io/hostname=192.168.1.164 Ready
192.168.1.168 host=vm1,kubernetes.io/hostname=192.168.1.168 Ready