Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 1.65 KB

README.org

File metadata and controls

79 lines (54 loc) · 1.65 KB

infra

a Flux + Terraform infrastructure repo

Todo

  • [x] add Flux for cluster repo
  • [x] get talosconfig
  • [ ] access Kubernetes APIServer
  • [ ] verify Ceph disk allocation

Prerequisites

Install OpenTofu

brew install opentofu

Usage

You’ll need .tfvar files, currently we create those via org files.

cd ~/infra
mkdir -p ./tmp/
touch ./tmp/cluster-kubeconfig
tofu init -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)" --upgrade

plan

tofu plan -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)"

apply

tofu apply -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)"

get talosconfig

mkdir -p ~/.talos
tofu output -raw talosconfig > ~/.talos/config

get kubeconfig

mkdir -p ~/.kube
tofu output -raw kubeconfig > ~/.kube/config

Flux usage

force a reconciliation

CLUSTER_NAME=cloudnative-coop
flux --kubeconfig ~/.kube/config-"$CLUSTER_NAME" reconcile source git flux-system

Force tear down

tofu state list | grep -E 'talos|flux|manifests|kubernetes_manifest' | xargs -I{} tofu state rm {}
tofu destroy -var-file=./config.tfvars -var-file=./secrets.tfvars -var github_token="$(gh auth token)"

Notes

  • Equinix Metal Cloud Provider 401 error regarding IP allocation and assigning