Kubernetes cluster
A vagrant script for setting up a Kubernetes cluster using Kubeadm
Pre-requisites
How to Run
Execute the following vagrant command to start a new Kubernetes cluster, this will start one master and two nodes:
vagrant up
You can also start invidual machines by vagrant up k8s-head, vagrant up k8s-node-1 and vagrant up k8s-node-2
If more than two nodes are required, you can edit the servers array in the Vagrantfile
servers = [
{
:name => "k8s-node-3",
:type => "node",
:box => "ubuntu/xenial64",
:box_version => "20180831.0.0",
:eth1 => "192.168.205.13",
:mem => "2048",
:cpu => "2"
}
]
As you can see above, you can also configure IP address, memory and CPU in the servers array.
Clean-up
Execute the following command to remove the virtual machines created for the Kubernetes cluster.
vagrant destroy -f
You can destroy individual machines by vagrant destroy k8s-node-1 -f
Licensing
Order of operations
SOURCE:
https://github.com/rootsongjc/kubernetes-vagrant-centos-cluster/blob/master/install.sh
echo "deploy kubernetes dashboard"
kubectl apply -f /vagrant/addon/dashboard/kubernetes-dashboard.yaml
echo "create admin role token"
kubectl apply -f /vagrant/yaml/admin-role.yaml
echo "the admin role token is:"
kubectl -n kube-system describe secret `kubectl -n kube-system get secret|grep admin-token|cut -d " " -f1`|grep "token:"|tr -s " "|cut -d " " -f2
echo "login to dashboard with the above token"
echo https://172.17.8.101:`kubectl -n kube-system get svc kubernetes-dashboard -o=jsonpath='{.spec.ports[0].port}'`
echo "install traefik ingress controller"
kubectl apply -f /vagrant/addon/traefik-ingress/
Official CLI Order ( tested )
-
make allow-scheduling-on-master
-
make generate-certs-dashboard
-
make apply-certs-dashboard
-
make create-dashboard
-
make describe-dashboard
-
make debug-cluster
-
make create-nfs-client
-
make create-heapster
-
make create-metrics-server
-
make create-ingress-nginx
-
make create-echoserver
-
make create-npd
-
make create-prometheus-operator
-
make create-efk
-
make create-ingress-traefik
Git Issues to keep track of
- kubernetes/dashboard#2723
- https://superuser.com/questions/1356984/why-does-my-linux-system-stutter-unless-i-continuously-drop-caches