Skip to content

KlopfiNet/terraform

Repository files navigation

terraform-kubernetes

Repo contains IaC code to bootstrap kubernetes node machines.

Built for Proxmox 8.1.3.

Usage

  1. Copy .env.example to .env and adjust.
  2. source .env
  3. Create secret.tfvars:
pve_password = ""
  1. Initialize:
terraform init #-backend-config=backend.conf
  1. (Optional) Prepare a few env vars:
export TF_LOG="" # Set to DEBUG if need be
export VAULT_ADDR="http://10.0.1.152:8200"
export VAULT_TOKEN="..."
  1. Execute:
make plan
make apply # Caution: auto-approve

make extract-configs

Talos

# Get talos config
terraform output -json | jq .kubernetes.value.talos_machine_config -r > $HOME/.talos/config

# Get talos kubeconfig
terraform output -json | jq .kubernetes.value.talos_kubeconfig -r > $HOME/.kube/config

# Get talos nodes (e.g. for talosctl health --endpoints ...)
terraform output -json | jq .kubernetes.value.talos_nodes -r

# Get talos image data (debugging)
terraform output -json | jq .kubernetes.value.talos_image_data
terraform output -json | jq .kubernetes.value.talos_image_data.talos_image_factory_schematic.schematic -r

About

General Terraform repository

Resources

Stars

Watchers

Forks