$ show mvallim/kubernetes-under-the-hood
This repository provides documentation and automation scripts for setting up a Kubernetes cluster from scratch using VirtualBox. It includes shell scripts for creating and configuring VM images with cloud-init, configuration files for various Kubernetes components (etcd, control plane, worker nodes, HAProxy load balancers), and detailed documentation explaining the setup process. The repository serves as an educational guide for understanding Kubernetes infrastructure components and how they interact, rather than a deployable application itself. The main value lies in the well-structured automation scripts and comprehensive documentation that walk users through building a complete Kubernetes cluster with high availability features.
The LLM identified 4 files worth highlighting for reuse:
A well-crafted shell script for creating VirtualBox VM instances with cloud-init configuration. It handles parameter parsing, processes template files with variable substitution, attaches the generated ISO to VMs, configures hardware resources, and optionally starts the VM. The script demonstrates good shell scripting practices with proper input validation, error handling, and modular design. It could be reused for other VM automation tasks with minimal modification to paths and configuration file locations.
A focused script for configuring network interfaces on VirtualBox VMs using VBoxManage. It reads YAML configuration to set up different network types (NAT, internal, host-only) and applies them to the specified VM. The script is loosely coupled, depends only on standard bash utilities and VBoxManage, and shows clear separation of concerns. It could be easily adapted for other network automation tasks in VirtualBox environments.
A simple but effective script for configuring CPU and memory resources on VirtualBox VMs. It reads YAML configuration to set the number of processors and memory allocation, then applies these settings using VBoxManage. The script exemplifies the Unix philosophy of doing one thing well, with minimal dependencies and clear error handling. It could be reused in any VirtualBox automation workflow requiring resource configuration with almost no changes.
A script for configuring storage disks on VirtualBox VMs. It reads YAML definitions to create and attach virtual hard disks with specified sizes, formats, and variants. The script handles the complete storage lifecycle from disk creation to attachment, showing good practices in resource management and error checking. It could be repurposed for other storage automation scenarios in VirtualBox with minimal adjustments to the configuration format and paths.