Skip to content

ii/infra

Repository files navigation

infra

a Flux + Terraform infrastructure repo

Todo

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

Prerequisites

Install OpenTofu

brew install opentofu

Usage

vars:

  • rfc2136_server
  • rfc2136_tsig_keyname
  • rfc2136_tsig_key
  • equinix_metal_project_id
  • equinix_metal_auth_token (DO NOT WRITE THIS DISK)

keep in values.tfvars (as HCL); example:

rfc2136_server       = "123.253.176.253"
rfc2136_tsig_keyname = "sharing.io."
rfc2136_tsig_key     = "[VALUE HERE]"
equinix_metal_project_id = "82b5c425-8dd4-429e-ae0d-d32f265c63e4"

init

tofu init -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)" --upgrade

plan

tofu plan -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)"

apply

tofu apply -var-file=./values.tfvars -var equinix_metal_auth_token=$METAL_AUTH_TOKEN -var github_token="$(gh auth token)"

get talosconfig

CLUSTER_NAME=sharing-io
tofu output -raw "$CLUSTER_NAME"-talosconfig > ~/.talos/config-"$CLUSTER_NAME"

get kubeconfig

CLUSTER_NAME=sharing-io
tofu output -raw "$CLUSTER_NAME"-kubeconfig > ~/.kube/config-"$CLUSTER_NAME"

Flux usage

force a reconciliation

flux --kubeconfig ~/.kube/config-sharing-io reconcile source git flux-system

Force tear down

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

Notes

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages