cluster-bootstrap Operations
tf/cluster-bootstrap is the Terraform module that installs the core cluster infrastructure
that ArgoCD depends on. This page states what it holds, how to apply it, and the rules for a
state migration.
What exists
Section titled “What exists”| Property | Value |
|---|---|
| Module | tf/cluster-bootstrap/ |
| HCP workspace | main-cluster-bootstrap, execution mode local, so a merge does not apply it |
| Kubernetes auth | ~/.kube/configs/fzymgc-house-admin.yml (terraform.tf) |
| Vault auth | the VAULT_TOKEN environment variable |
The module declares, in cert-manager.tf, external-secrets.tf, longhorn.tf and argocd.tf:
- cert-manager, the ICA1 signing key Secret and the
fzymgc-houseissuer, with the issuer read from Vault PKI inpki.tf. - The External Secrets Operator, the Vault CA chain Secret and the
vaultClusterSecretStore. - Longhorn, its crypto and backup credential Secrets, the
longhorn-encryptedandlonghorn-1replica-encryptedstorage classes, and four recurring jobs. - ArgoCD, its OIDC and repository Secrets, and the
cluster-appApplication that hands every other deployment to GitOps.
cd tf/cluster-bootstrapterraform init # add -upgrade after a provider bumpterraform plan -out=tfplanterraform apply tfplanIf the kubernetes provider returns Unauthorized, the admin client certificate has expired.
Fetch it again:
ansible-playbook ansible/k3s-playbook.yml --tags k3s-kubeconfigState migrations
Section titled “State migrations”A provider deprecation that renames a resource type, for example kubernetes_namespace to
kubernetes_namespace_v1, is migrated with declarative import and removed blocks, never with
terraform state commands:
- Rename the resources to the new type and update every reference.
- Add
importblocks that adopt the live objects into the new addresses. - Add
removed { ... lifecycle { destroy = false } }blocks that drop the old addresses from state without deleting the live objects.
The pre-apply plan must show 0 to destroy. A non-zero destroy count means that an address or an
import id is wrong. Stop and fix it. After the migration applies, the import and removed
blocks are no-ops. Delete them in a later change, after a plan without them shows 0 to destroy.
imports.tf and moved.tf hold the blocks that still exist.