Skip to content

Kubernetes Cluster with 1 master node and 2 worker nodes provisioned with Vagrant. Installed with Callico

Notifications You must be signed in to change notification settings

karadalex/k8s-cluster-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Cluster Playground

Kubernetes Cluster with 1 master node and 2 worker nodes provisioned with Vagrant. Installed with Callico

Requirements

Vagrant installed

Instructions

Create and provision the Kubernetes cluster

vagrant up

Login to manager node

vagrant ssh manager1

You can configure memory and number of cpus in the Vagrantfile and then reload the machine with the following command

vagrant reload [vm-name]

To connect the cluster to the kubectl outside of the vagrannt nodes

vagrant ssh master
cat /home/vagrant/.kube/config

and copy the yaml data to the corresponding parts on you local kubectl file and then

kubectl config use-context kubernetes-admin@kubernetes

and verify whether you are in the correct cluster

kubectl get svc
kubectl get nodes

To install the dashboard, via your local kubectl

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.3.1/aio/deploy/recommended.yam
kubectl proxy

To get a bearer token follow this guide https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md or run the following from this diretory

kubectl apply -f admin-user.yaml
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"

and copy the output token to the browser

Troubleshooting

  • A worker (e.g. worker1) hasn't joined the cluster successfully during provisioning
vagrant ssh worker1
sudo kubeadm reset
sudo kubeadm join 10.0.0.10:6443 --token <TOKEN> --discovery-token-ca-cert-hash <SHA256>

Resources

About

Kubernetes Cluster with 1 master node and 2 worker nodes provisioned with Vagrant. Installed with Callico

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published