β¨ What is StackOpsys?
StackOpsys is a personal project I'm building to automate the end-to-end deployment of Kubernetes clusters on Proxmox VE using key Infrastructure as Code (IaC) tools:
- π§ Packer β builds custom base images
- βοΈ Terraform β provisions virtual machines on Proxmox
- π¦ Ansible β installs packages and connects the nodes to the cluster
- βΈοΈ Kubeadm β orchestrates the Kubernetes cluster
- π₯οΈ Proxmox VE β local virtualization environment
π οΈ Project Status
So far, Iβve completed the Packer phase by creating a secure base image with Ubuntu Server 24.04 LTS that includes system configurations to run Kubernetes properly:
- Swap disabled
- Kernel modules loaded (
br_netfilter
,overlay
) - sysctl network parameters applied
- Firewall configured with
firewalld
and required ports open
This forms a solid base for a fully reproducible cluster deployment.
π¦ Using Packer in StackOpsys
What does this module do?
It creates a custom image in Proxmox VE, ideal for Terraform use. Itβs also prepared for integration with Ansible and Kubeadm.
Requirements:
- A working Proxmox VE setup
- API Token with permissions to create VMs
- Packer version β₯ 1.8
π§ͺ Installing Packer
πΉ On Ubuntu
sudo apt-get update
sudo apt-get install -y unzip
curl -fsSL https://releases.hashicorp.com/packer/1.9.4/packer_1.9.4_linux_amd64.zip -o packer.zip
unzip packer.zip
sudo mv packer /usr/local/bin/
packer --version
πΉ On macOS
brew tap hashicorp/tap
brew install hashicorp/tap/packer
packer --version
π How to Use Packer in StackOpsys
1οΈβ£ Initialize the environment
git clone https://github.com/rtaparay/StackOpsys.git
cd packer/base-images
packer init -upgrade .
β Validate the template with custom variables
packer validate -var-file=dev.pkrvars.hcl .
ποΈ Build the image (interactive mode if errors occur)
packer build -on-error=ask -var-file="dev.pkrvars.hcl" .
π Detailed build with logs
PACKER_LOG=1 packer build -on-error=ask -var-file="dev.pkrvars.hcl" . 2>&1 | tee logs/packer-build-$(date +"%Y-%m-%d_%H:%M:%S").log
π Project Structure (so far)
packer
βββ base-images
β βββ files
β β βββ 99-pve.cfg
β βββ http
β β βββ meta-data
β β βββ user-data
β βββ logs
β βββ dev.pkrvars.hcl
β βββ scripts
β β βββ install-kubeadm.sh
β βββ ubuntu-server-noble.pkr.hcl
β βββ variables.pkr.hcl
π Preconfigured Network Security
The image enables firewalld and opens the required ports for Kubernetes:
Port/Range | Protocol | Function | Used By |
---|---|---|---|
6443 | TCP | Kubernetes API | kube-apiserver |
2379-2380 | TCP | etcd | etcd |
10250 | TCP | Kubelet API | kubelet |
10251 | TCP | kube-scheduler | kube-scheduler |
10252 | TCP | kube-controller-manager | kube-controller-manager |
π What's Next?
Next phases include:
- Terraform for automatic VM creation in Proxmox using this image
- Ansible for installing packages and joining nodes to the cluster
- Kubeadm for control-plane initialization and networking
All under a clean, modular and fully repeatable flow.
π€ Want to follow or contribute?
π Project in progress. You can follow it or drop suggestions here:
π github.com/rtaparay/stackopsys
π§ Final Thoughts
StackOpsys is more than a script or templateβit's a complete approach to building infrastructure from scratch, with full control, best practices, and freedom to scale.
If you're into DevOps, Kubernetes, IaC or building your own Proxmox lab, this might be useful to you!
Thanks for reading π»βοΈ
Top comments (0)