Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 1.89 KB

README.org

File metadata and controls

81 lines (56 loc) · 1.89 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

Create a .tfvars file

tenancy_ocid     = "TENANCY OCID                         : https://cloud.oracle.com/tenancy"
user_ocid        = "YOUR USER OCID                       : https://cloud.oracle.com/identity/domains/my-profile"
private_key_path = "YOUR PRIVATE KEY PATH                : https://cloud.oracle.com/identity/domains/my-profile/api-keys"
fingerprint      = "THE FINGERPRINT FOR YOUR PRIVATE KEY : ^^"
region           = "us-phoenix-1"
compartment_ocid = "YOUR COMPARTMENT OCID                : https://cloud.oracle.com/identity/compartments # cloudnativecoop"

Usage

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

cd ~/infra
tofu init -var-file=./.tfvars -var github_token="$(gh auth token)" --upgrade

plan

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

apply

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

get talosconfig

tofu output -raw talosconfig > ./talosconfig

get kubeconfig

tofu output -raw kubeconfig > ./kubeconfig

Flux usage

force a reconciliation

flux --kubeconfig ./kubeconfig 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=./.tfvars -var github_token="$(gh auth token)"