Quick Start

Create your first Kubernetes cluster in minutes

Make sure the prerequisites are installed.

1. Build the host binary

The host binary runs the vbox, vault and user commands from your machine. vagrant up builds the Linux binary for the VMs by itself.

git clone https://github.com/gilmararaujo/k8s-provisioner.git
cd k8s-provisioner

make deps
make build-darwin-arm64    # or build-darwin-amd64, build-linux-amd64, build-linux-arm64, build-windows-amd64

Or download a pre-built binary.

2. Create the cluster

cd vagrant
vagrant up

This creates four VMs and installs everything:

VMIPRole
storage192.168.56.20NFS server, HashiCorp Vault, lab DNS (CoreDNS + etcd)
controlplane192.168.56.10Kubernetes control plane
node01192.168.56.11Worker
node02192.168.56.12Worker

When it finishes, vagrant up exports the lab CAs to vagrant/certs/ and prints the host setup commands for your OS, with the CA fingerprints.

3. Promiscuous mode (MetalLB)

The Vagrantfile enables promiscuous mode on every up, reload and resume. If LoadBalancer IPs (192.168.56.200-250) are not reachable from the host, enable it again:

../build/k8s-provisioner-darwin-arm64 vbox promisc        # macOS Apple Silicon
../build/k8s-provisioner-linux-amd64 vbox promisc         # Linux
..\build\k8s-provisioner-windows-amd64.exe vbox promisc   # Windows

Why? MetalLB announces LoadBalancer IPs with ARP (Layer 2 mode). VirtualBox blocks that traffic between the VMs and the host unless promiscuous mode is on.

4. Access the cluster

# Copy the admin kubeconfig (it already points at https://192.168.56.10:6443)
vagrant ssh controlplane -c 'sudo cat /etc/kubernetes/admin.conf' > ~/.kube/config-lab

export KUBECONFIG=~/.kube/config-lab
kubectl get nodes

Expected output:

NAME           STATUS   ROLES           AGE   VERSION
controlplane   Ready    control-plane   12m   v1.37.x
node01         Ready    <none>          10m   v1.37.x
node02         Ready    <none>          10m   v1.37.x

5. Host setup (DNS + trusted CAs)

Run the commands vagrant up printed, from the vagrant/ directory. They point lab.internal at the lab DNS and trust the lab and Vault CAs. See Host Setup for the commands per OS and why each one is needed.

6. Open the web UIs

Every UI is published by ExternalDNS and served over HTTPS by the Istio ingress gateway:

URLServiceLogin
https://grafana.lab.internalGrafana (the k8s-lab dashboard is preinstalled)“Sign in with Keycloak”, or admin + password from Vault
https://prometheus.lab.internalPrometheusnone
https://alertmanager.lab.internalAlertmanagernone
https://kiali.lab.internal/kialiKiali (service mesh)none (anonymous)
https://keycloak.lab.internalKeycloak admin consoleadmin + password from Vault
https://vault.lab.internal:8200HashiCorp Vault UIroot token
https://karpor.lab.internalKarpor (only when enabled)none

Read a password from Vault with the CLI on the controlplane:

vagrant ssh controlplane -c \
  'sudo k8s-provisioner vault get k8s-provisioner/grafana/admin password -c /etc/k8s-provisioner/config.yaml'

7. kubectl login via Keycloak (OIDC)

The API server trusts Keycloak as an OIDC provider: k8s-admins → cluster-admin, k8s-developers → view. A ready-made kubeconfig is stored in Vault.

# Fetch the OIDC kubeconfig (from the vagrant/ directory)
vagrant ssh controlplane -c \
  'sudo k8s-provisioner vault get k8s-provisioner/kubeconfig-oidc config -c /etc/k8s-provisioner/config.yaml' \
  > ~/.kube/config-oidc

# Password of the test user k8sadmin (group k8s-admins)
vagrant ssh controlplane -c \
  'sudo k8s-provisioner vault get k8s-provisioner/keycloak/users/k8sadmin password -c /etc/k8s-provisioner/config.yaml'

# A browser opens for the Keycloak login
KUBECONFIG=~/.kube/config-oidc kubectl get nodes

Requires kubelogin and step 5. See Keycloak for adding users.

Pre-built Binaries

Download from GitHub Releases (each release has a checksums.txt):

PlatformBinary
macOS Apple Siliconk8s-provisioner-darwin-arm64
macOS Intelk8s-provisioner-darwin-amd64
Linux x64k8s-provisioner-linux-amd64
Linux ARM64k8s-provisioner-linux-arm64
Windows x64k8s-provisioner-windows-amd64.exe

Next Steps

  • Host Setup: what the DNS and CA commands do, and what to redo after recreating the lab
  • Configuration: customize versions, components and VMs
  • Components: deep dive into each component