This repository provides a Vagrantfile to automate the setup of virtual machines required for Kubernetes the Hard Way by Kelsey Hightower.
Setting up the virtual machines manually can be time-consuming and complex, especially for those not deeply familiar with virtualization. To simplify this process for students and professionals, I've created a Vagrantfile that automates the provisioning of the necessary environment. This allows you to focus on learning Kubernetes without the overhead of manual VM configuration.
- Mac with ARM architecture
- Vagrant installed
- VMware Desktop plugin for Vagrant
-
Install Vagrant
brew tap hashicorp/tap brew install hashicorp/tap/hashicorp-vagrant
-
Install VMware Desktop Plugin for Vagrant
vagrant plugin install vagrant-vmware-desktop
-
Clone the Repository
git clone https://github.com/azalio/kubernetes-the-hard-way.git cd kubernetes-the-hard-way
-
Start the Virtual Machines
vagrant up
This command will create four virtual machines configured according to the requirements of Kubernetes the Hard Way.
- Vagrantfile: Automates the setup of the virtual machines.
- encryption-config.yaml: Necessary for completing the practice as of November 2024.
With the virtual machines up and running, you can proceed with the steps outlined in Kelsey Hightower's Kubernetes the Hard Way tutorial.
Feel free to open issues or submit pull requests if you have suggestions or encounter any issues.
As part of developing an advanced Kubernetes course for senior engineers, I recognized the need for hands-on practice. Manually assembling a Kubernetes cluster provides invaluable insights but can be daunting without the right setup. By automating the virtual machine provisioning with Vagrant, I aimed to:
- Reduce Setup Time: Eliminate the hassle of manual VM configuration.
- Enhance Learning: Allow learners to focus on Kubernetes concepts rather than infrastructure setup.
- Facilitate Teaching: Provide a consistent environment for all students in the course.
Let's make Kubernetes the Hard Way more accessible and focus on mastering the essentials!
This tutorial walks you through setting up Kubernetes the hard way. This guide is not for someone looking for a fully automated tool to bring up a Kubernetes cluster. Kubernetes The Hard Way is optimized for learning, which means taking the long route to ensure you understand each task required to bootstrap a Kubernetes cluster.
The results of this tutorial should not be viewed as production ready, and may receive limited support from the community, but don't let that stop you from learning!
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
The target audience for this tutorial is someone who wants to understand the fundamentals of Kubernetes and how the core components fit together.
Kubernetes The Hard Way guides you through bootstrapping a basic Kubernetes cluster with all control plane components running on a single node, and two worker nodes, which is enough to learn the core concepts.
Component versions:
- kubernetes v1.28.x
- containerd v1.7.x
- cni v1.3.x
- etcd v3.4.x
This tutorial requires four (4) ARM64 based virtual or physical machines connected to the same network. While ARM64 based machines are used for the tutorial, the lessons learned can be applied to other platforms.
- Prerequisites
- Setting up the Jumpbox
- Provisioning Compute Resources
- Provisioning the CA and Generating TLS Certificates
- Generating Kubernetes Configuration Files for Authentication
- Generating the Data Encryption Config and Key
- Bootstrapping the etcd Cluster
- Bootstrapping the Kubernetes Control Plane
- Bootstrapping the Kubernetes Worker Nodes
- Configuring kubectl for Remote Access
- Provisioning Pod Network Routes
- Smoke Test
- Cleaning Up