You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project sets up a local Kubernetes cluster using Vagrant and VirtualBox. It creates two Ubuntu 22.04 virtual machines: one master node and one worker node with automatic installation of Docker, Kubernetes components, and necessary configurations.
8
+
This project sets up a local Kubernetes cluster using Vagrant and VirtualBox. It creates two Ubuntu 24.04 virtual machines: one control plane node and one worker node with automatic installation of Docker, Kubernetes components, and necessary configurations.
<td>Automated VM provisioning with Ubuntu 22.04</td>
48
+
<td>Automated VM provisioning with Ubuntu 24.04</td>
49
49
</tr>
50
50
<tr>
51
51
<td align="center">🌐</td>
@@ -71,19 +71,19 @@ graph TB
71
71
72
72
## 🖥 Cluster Configuration
73
73
74
-
> **Note about IP Addressing**: This configuration uses `192.168.63.1` and `192.168.63.2` for the master and worker nodes respectively. You can modify these IPs in the `Vagrantfile` to use any IP addresses from your router's IP range that are outside the DHCP scope. Make sure to choose IPs that won't conflict with other devices on your network.
74
+
> **Note about IP Addressing**: This configuration uses `192.168.63.11` and `192.168.63.12` for the control plane and worker nodes respectively. You can modify these IPs in the `Vagrantfile` to use any IP addresses from your router's IP range that are outside the DHCP scope. Make sure to choose IPs that won't conflict with other devices on your network.
75
75
76
76
<table>
77
77
<tr>
78
-
<th width="50%">Master Node</th>
78
+
<th width="50%">Control Plane Node</th>
79
79
<th width="50%">Worker Node</th>
80
80
</tr>
81
81
<tr>
82
82
<td>
83
83
84
84
```yaml
85
-
IP: 192.168.63.1
86
-
Hostname: master
85
+
IP: 192.168.63.11
86
+
Hostname: cplane
87
87
Memory: 2048MB
88
88
CPUs: 2
89
89
Role: Control Plane
@@ -93,7 +93,7 @@ Role: Control Plane
93
93
<td>
94
94
95
95
```yaml
96
-
IP: 192.168.63.2
96
+
IP: 192.168.63.12
97
97
Hostname: worker
98
98
Memory: 2048MB
99
99
CPUs: 2
@@ -110,7 +110,7 @@ Role: Worker
110
110
111
111
## Quick Start
112
112
113
-
> **💡 Tip**: Before starting, you may want to adjust the IP addresses in the `Vagrantfile` if the default IPs (`192.168.63.1, 192.168.63.2`) conflict with your network setup. Edit the `private_network` IP settings in the Vagrantfile to match your network requirements.
113
+
> **💡 Tip**: Before starting, you may want to adjust the IP addresses in the `Vagrantfile` if the default IPs (`192.168.63.11, 192.168.63.12`) conflict with your network setup. Edit the `private_network` IP settings in the Vagrantfile to match your network requirements.
114
114
115
115
1. Clone this repository:
116
116
```bash
@@ -123,9 +123,9 @@ cd vagrant
123
123
vagrant up
124
124
```
125
125
126
-
3. SSH into the master node:
126
+
3. SSH into the control plane node:
127
127
```bash
128
-
vagrant ssh master
128
+
vagrant ssh cplane
129
129
```
130
130
131
131
4. SSH into the worker node:
@@ -163,11 +163,11 @@ vagrant destroy
163
163
164
164
After the VMs are up and running, follow these steps to initialize your Kubernetes cluster:
### NOTE: Control Plane script 'cluster_init.sh' wraps steps 1. and 2.
191
+
192
+
For ease of use, a single script `cluster_init.sh` was created as a function of the "vagrant up" command for the control plane(s) that performs all of the above steps:
193
+
* k8s image pull
194
+
* kubeadm init
195
+
* local copy of "kube config"
196
+
* Weave CNI install
197
+
198
+
and can be run with the vagrant command:
199
+
```bash
200
+
vagrant ssh cplane -c "./cluster_init.sh"
201
+
```
202
+
190
203
### 3. Join Worker Node
191
204
192
-
Copy the `kubeadm join` command from the master node's initialization output and run it on the worker node with sudo privileges.
205
+
Copy the `kubeadm join` command from the control plane node's initialization output and run it on the worker node with sudo privileges.
206
+
207
+
### NOTE: Control Plane script 'join_cmd.sh' shows the 'join' command
208
+
209
+
For ease of use, script `join_cmd.sh` was created to display the join command for use on worker nodes with this vagrant command:
210
+
```bash
211
+
vagrant ssh cplane -c "./join_cmd.sh"
212
+
```
193
213
194
214
### 4. Verify Cluster Status
195
215
196
-
After joining the worker node, verify the cluster status from the master node:
216
+
After joining the worker node, verify the cluster status from the control plane node:
197
217
198
218
```bash
199
219
# Check node status
@@ -203,7 +223,7 @@ kubectl get nodes
203
223
Expected output (it may take a few minutes for the nodes to be ready):
0 commit comments