This project provides a set of scripts and Vagrant configurations to create a Kubernetes cluster using the latest version of Kubernetes. The cluster consists of a control plane node and multiple worker nodes, all provisioned using Vagrant with Hyper-V on Windows and the Ubuntu 22.04 (Jammy Jellyfish) base box.
Before setting up the Kubernetes cluster, ensure your system meets the following requirements:
-
Hardware Requirements:
- A Windows 10 or Windows Server 2016 (or later) machine with virtualization support.
- Minimum 16GB RAM (32GB or more recommended for better performance).
- At least 50GB of free disk space.
-
Software Requirements:
-
Network Requirements:
- A working internet connection for downloading necessary packages and container images.
- The ability to create and configure a Hyper-V external network switch.
-
Additional Notes:
- Ensure that your system's BIOS settings have virtualization technology enabled.
- If you're using Windows 10 Home edition, you'll need to upgrade to Pro, Enterprise, or Education to use Hyper-V.
- Disable any other virtualization software (like VirtualBox) that might interfere with Hyper-V.
Please make sure all these requirements are met before proceeding with the cluster setup.
Before provisioning the cluster, you need to create a Hyper-V external network switch. Run the following PowerShell script with administrator privileges:
# Name of the new virtual switch
$switchName = "Public Switch"
# Get the physical network adapter for the external switch
$netAdapter = Get-NetAdapter -Name "Ethernet"
# Create the new external virtual switch
New-VMSwitch -Name $switchName -NetAdapterName $netAdapter.Name -AllowManagementOS $true
Make sure to adjust the $netAdapter
name if your primary network adapter is named differently.
The project has the following directory structure:
.
├── common
│ ├── calico.yaml
│ ├── install.sh
│ ├── kubeadm-config.yaml
│ ├── local-path-storage.yaml
│ ├── metallb-native.yaml
│ └── nginx-ingress-controller-bm.yaml
├── control-plane
│ ├── configure.sh
│ └── Vagrantfile
├── images
├── node-worker
│ ├── configure.sh
│ ├── join.sh
│ ├── kube_config.yaml
│ └── Vagrantfile
├── test-apps
│ ├── config
│ │ ├── kubernetes-dashboard.values.yaml
│ │ └── letsencrypt-issuer.yaml
│ ├── helm-apps.sh
│ ├── nginx.yaml
│ ├── persistent-pod-local-path.yaml
│ └── test-cert-manager.yaml
└── workers
The Kubernetes cluster is set up with the following components:
- Kubernetes v1.30.0
- CRI-O 1.30.0
- Calico CNI plugin for networking
- Helm package manager for deploying applications
- NGINX Ingress Controller for exposing services
- Kubernetes Dashboard for cluster management
- cert-manager for automatic TLS certificate management
- Falco for runtime security monitoring
- Chaos Mesh for chaos engineering experiments
To provision the Kubernetes cluster, follow these steps:
- Ensure Hyper-V is enabled and the "Public Switch" network is created.
- Clone this repository.
- Navigate to the
control-plane
directory and runvagrant up
to provision the control plane node. - Navigate to the
node-worker
directory and runvagrant up
to provision the worker nodes. - Use
vagrant ssh control-plane
to SSH into the control plane node and verify the cluster status usingkubectl get nodes
. - Deploy the test applications by running the
helm-apps.sh
script in thetest-apps
directory.
You can customize the cluster configuration by modifying the following files:
common/kubeadm-config.yaml
: Kubernetes cluster configuration file used by kubeadm.control-plane/Vagrantfile
andnode-worker/Vagrantfile
: Vagrant configuration files for the control plane and worker nodes. You can adjust the number of worker nodes, resource allocation, and network settings here.test-apps/config
: Configuration files for the test applications.
- The MetalLB load balancer is currently not working and is commented out in the scripts.
- IPv6 support for Calico CNI is not fully configured.
- The Kubernetes Dashboard is accessible using the
kubectl proxy
command, but it is not exposed externally.
Please refer to the individual scripts and configuration files for more details on the specific steps and configurations applied during the provisioning process.
If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the project's GitHub repository.
Here is a summary of the key tasks and improvements to consider for the CoreOS-based solution:
Here's a concise to-do list with one checkbox per line using markdown:
- Create base image from CoreOS
- Fix persistent storage
- Enable IPv6 support
- Make operations idempotent
- Set up automated builds and testing
- Implement security hardening
- Create documentation
- Add monitoring and logging
This project is licensed under the MIT License.