Some checks failed
ci/woodpecker/push/default Pipeline failed
The API rewrite half of the ESO 0.12->2.6 migration (last k8s-1.35 compat-gate blocker). Done on chart 0.16.2, which serves BOTH external-secrets.io/v1beta1 and v1, so this is the safe window — MUST land before 0.17 removes v1beta1 (there is no conversion webhook). Pure apiVersion bump, schema is byte-identical: 106 occurrences (104 ExternalSecrets + 2 ClusterSecretStores vault-kv/vault-database) across 73 .tf files, v1beta1 -> v1, no other field changes. Validated live first on tandoor (single, non-coupled, synced ES): the kubernetes_manifest apiVersion bump forces a REPLACE; the target Secret is cascade-GC'd for ONE ~0.3s poll then ESO recreates it (identical value re-synced from Vault, new UID) and the ES returns SecretSynced=True on v1. Running pods keep their mounted copy through the sub-second blip. All 110 target Secrets were snapshotted to /tmp first as a backstop. CI applies the changed stacks serially (staged rollout); watching aggregate ES sync back to 108 synced (2 pre-existing dead: instagram-poster, payslip-ingest). Next: Phase 3 climb 0.16.2 -> 2.6.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
142 lines
4.7 KiB
HCL
142 lines
4.7 KiB
HCL
variable "tls_secret_name" {
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
variable "nfs_server" { type = string }
|
|
|
|
resource "kubernetes_manifest" "external_secret" {
|
|
manifest = {
|
|
apiVersion = "external-secrets.io/v1"
|
|
kind = "ExternalSecret"
|
|
metadata = {
|
|
name = "actualbudget-secrets"
|
|
namespace = "actualbudget"
|
|
}
|
|
spec = {
|
|
refreshInterval = "15m"
|
|
secretStoreRef = {
|
|
name = "vault-kv"
|
|
kind = "ClusterSecretStore"
|
|
}
|
|
target = {
|
|
name = "actualbudget-secrets"
|
|
}
|
|
dataFrom = [{
|
|
extract = {
|
|
key = "actualbudget"
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
depends_on = [kubernetes_namespace.actualbudget]
|
|
}
|
|
|
|
data "kubernetes_secret" "eso_secrets" {
|
|
metadata {
|
|
name = "actualbudget-secrets"
|
|
namespace = kubernetes_namespace.actualbudget.metadata[0].name
|
|
}
|
|
depends_on = [kubernetes_manifest.external_secret]
|
|
}
|
|
|
|
locals {
|
|
credentials = jsondecode(data.kubernetes_secret.eso_secrets.data["credentials"])
|
|
}
|
|
|
|
|
|
# To create a new deployment:
|
|
/**
|
|
1. Create a subdirectory for {name} under /srv/nfs on the Proxmox host (192.168.1.127)
|
|
2. Add {name} as proxied cloudflare route (tfvars)
|
|
3. Add module here
|
|
*/
|
|
|
|
resource "kubernetes_namespace" "actualbudget" {
|
|
metadata {
|
|
name = "actualbudget"
|
|
labels = {
|
|
"istio-injection" : "disabled"
|
|
tier = local.tiers.edge
|
|
"keel.sh/enrolled" = "true"
|
|
}
|
|
}
|
|
lifecycle {
|
|
# KYVERNO_LIFECYCLE_V1: goldilocks-vpa-auto-mode ClusterPolicy stamps this label on every namespace
|
|
ignore_changes = [metadata[0].labels["goldilocks.fairwinds.com/vpa-update-mode"]]
|
|
}
|
|
}
|
|
|
|
module "tls_secret" {
|
|
source = "../../modules/kubernetes/setup_tls_secret"
|
|
namespace = kubernetes_namespace.actualbudget.metadata[0].name
|
|
tls_secret_name = var.tls_secret_name
|
|
}
|
|
|
|
|
|
# https://budget-viktor.viktorbarzin.me/
|
|
module "viktor" {
|
|
source = "./factory"
|
|
name = "viktor"
|
|
tag = "26.4.0"
|
|
tls_secret_name = var.tls_secret_name
|
|
nfs_server = var.nfs_server
|
|
depends_on = [kubernetes_namespace.actualbudget]
|
|
tier = local.tiers.edge
|
|
enable_http_api = true
|
|
enable_bank_sync = true
|
|
storage_size = "4Gi"
|
|
budget_encryption_password = lookup(local.credentials["viktor"], "password", null)
|
|
sync_id = lookup(local.credentials["viktor"], "sync_id", null)
|
|
homepage_annotations = {
|
|
"gethomepage.dev/enabled" = "true"
|
|
"gethomepage.dev/name" = "Budget Viktor"
|
|
"gethomepage.dev/description" = "Personal budget"
|
|
"gethomepage.dev/icon" = "actual-budget.png"
|
|
"gethomepage.dev/group" = "Finance & Personal"
|
|
"gethomepage.dev/pod-selector" = ""
|
|
}
|
|
}
|
|
|
|
# https://budget-anca.viktorbarzin.me/
|
|
module "anca" {
|
|
source = "./factory"
|
|
name = "anca"
|
|
tag = "26.4.0"
|
|
tls_secret_name = var.tls_secret_name
|
|
nfs_server = var.nfs_server
|
|
depends_on = [kubernetes_namespace.actualbudget]
|
|
tier = local.tiers.edge
|
|
enable_http_api = true
|
|
enable_bank_sync = true
|
|
budget_encryption_password = lookup(local.credentials["anca"], "password", null)
|
|
sync_id = lookup(local.credentials["anca"], "sync_id", null)
|
|
homepage_annotations = {
|
|
"gethomepage.dev/enabled" = "true"
|
|
"gethomepage.dev/name" = "Budget Anca"
|
|
"gethomepage.dev/description" = "Personal budget"
|
|
"gethomepage.dev/icon" = "actual-budget.png"
|
|
"gethomepage.dev/group" = "Finance & Personal"
|
|
"gethomepage.dev/pod-selector" = ""
|
|
}
|
|
}
|
|
|
|
# https://budget-emo.viktorbarzin.me/
|
|
# Disabled 2026-05-13: Emo isn't using this instance. PVC is preserved so
|
|
# we can flip enabled back to true to bring the instance back as-was.
|
|
# The empty accounts list (vs. anca/viktor) was causing the daily bank-sync
|
|
# CronJob to fail and trigger BankSyncStale.
|
|
module "emo" {
|
|
source = "./factory"
|
|
name = "emo"
|
|
tag = "26.4.0"
|
|
tls_secret_name = var.tls_secret_name
|
|
nfs_server = var.nfs_server
|
|
depends_on = [kubernetes_namespace.actualbudget]
|
|
tier = local.tiers.edge
|
|
enabled = false
|
|
enable_http_api = false
|
|
enable_bank_sync = false
|
|
budget_encryption_password = lookup(local.credentials["emo"], "password", null)
|
|
sync_id = lookup(local.credentials["emo"], "sync_id", null)
|
|
homepage_annotations = {}
|
|
}
|