infra/stacks/forgejo/email-secret.tf
Viktor Barzin ebc8b6588f
Some checks failed
ci/woodpecker/push/default Pipeline failed
ESO: add force_conflicts to all ExternalSecret manifests (fleet sweep)
The 2026-06-22 external-secrets v1 migration made the ESO controller the
server-side-apply owner of .spec.refreshInterval on every ExternalSecret, so any
stack defining one via kubernetes_manifest fails `terraform apply` with a
field-manager conflict the next time it's applied (instagram-poster + grafana hit
this on 2026-06-24; it was latent across the whole fleet). Add
field_manager { force_conflicts = true } to all 101 remaining ExternalSecret
manifests across 70 stacks, matching the fix already on grafana / woodpecker /
traefik / k8s-version-upgrade / instagram-poster. TF and ESO set the same value,
so it's stable (no perpetual drift). Defuses the landmine before each stack's
next apply trips it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 21:28:11 +00:00

43 lines
1.3 KiB
HCL

# SMTP password for Forgejo's open-signup email-confirmation + notification
# mail (main.tf: FORGEJO__service__REGISTER_EMAIL_CONFIRM + [mailer]). Synced
# from Vault secret/authentik -> smtp_password into the forgejo namespace as the
# `forgejo-email` Secret (key PASSWD), referenced by FORGEJO__mailer__PASSWD.
# Reuses the same noreply@viktorbarzin.me mailserver SASL account Authentik uses
# (stacks/authentik/email-secret.tf) — one credential, one rotation point. The
# reloader annotation rolls the Forgejo pod if the password is ever rotated.
resource "kubernetes_manifest" "forgejo_email_secret" {
field_manager {
force_conflicts = true
}
manifest = {
apiVersion = "external-secrets.io/v1"
kind = "ExternalSecret"
metadata = {
name = "forgejo-email"
namespace = "forgejo"
}
spec = {
refreshInterval = "1h"
secretStoreRef = {
name = "vault-kv"
kind = "ClusterSecretStore"
}
target = {
name = "forgejo-email"
template = {
metadata = {
annotations = {
"reloader.stakater.com/match" = "true"
}
}
}
}
data = [
{
secretKey = "PASSWD"
remoteRef = { key = "authentik", property = "smtp_password" }
},
]
}
}
}