Provision a three nodes Kubernetes cluster with an NFS server using Vagrant and Docker compose. This is a local cluster intended to be used for local development and testing.
- Vagrant
- Virtualbox
- Docker Desktop (macOS and Windows) or docker daemon and docker CLI (linux)
The bin
directory contains four scripts:
up.sh
: brings up the NFS server and the Kubernetes clusterpause.sh
: pauses the NFS server container and shuts down the VMs of the clusterresume.sh
: unpauses the NFS server container and boots up the VMs of the clusterdown.sh
: cleans all the used resources
The cluster has three nodes:
Node | VM | OS | CPUs | Memory | IP |
---|---|---|---|---|---|
master-01 | k8s.local.master-01 | Ubuntu 22.04 | 2 | 2048 | 192.168.56.29 |
worker-01 | k8s.local.worker-01 | Ubuntu 22.04 | 1 | 1024 | 192.168.56.30 |
worker-02 | k8s.local.worker-02 | Ubuntu 22.04 | 1 | 1024 | 192.168.56.31 |
To ssh
into one of the nodes, cd
into the cluster
directory and run vagrant ssh <node_name>
.
kubectl
is installed on the master-01 node with the alias k
.
- A Kubernetes dashboard is available at: http://192.168.56.29:30000/
- The cluster has a default storage class named
nfs-client
that will dynamically provision Persistent Volumes in the NFS server. - Manifest files placed under the directory specified by the variable
RESOURCES_PATH
in theVagrantfile
will be copied under/vagrant/.resources
in the master node and will be automatically applied when the master node is finished bootstraping.
- Replace the extensive use of the
yq
command withKustomize
. - Upgrade to Kubernetes v1.27