a Flux + Terraform infrastructure repo
- [x] add Flux for cluster repo
- [x] get talosconfig
- [ ] access Kubernetes APIServer
- [ ] verify Ceph disk allocation
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"
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
force a reconciliation
flux --kubeconfig ./kubeconfig reconcile source git flux-system
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)"