Add CronJob that unseals OpenBao automatically after restarts

OpenBao comes back sealed whenever its pod restarts (containerd/MicroK8s restarts
took every pod down 6-11 times in three days), and while sealed External Secrets
cannot refresh any secret.

The job checks every minute and, if sealed, applies the keys from the existing
openbao-unseal-keys Secret with the same steps as scripts/unseal.sh. It talks to
the pod's headless-service address and verifies the cert-manager CA. Disable with
autoUnseal.enabled=false.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-09-21 18:54:33 +02:00
co-authored by Claude Sonnet 5
parent e27524177c
commit 00a037c291
2 changed files with 134 additions and 0 deletions
+14
View File
@@ -102,6 +102,20 @@ eso:
# KV v2 mount path that ClusterSecretStore(s) will read from.
kvMountPath: secret
# Automatic unseal after (re)starts. OpenBao comes back SEALED whenever its pod restarts
# (which happens whenever containerd/MicroK8s restarts), and while it is sealed External
# Secrets cannot refresh any secret. This CronJob checks every minute and, if sealed, applies
# the keys from the Secret below - the same procedure as scripts/unseal.sh.
# Trade-off: the keys stay in the cluster (as they do for the manual procedure). To go back
# to unsealing by hand set `enabled: false`.
autoUnseal:
enabled: true
schedule: "* * * * *"
image: openbao/openbao:2.6.2
# Secret holding the unseal keys, one per line.
keysSecretName: openbao-unseal-keys
keysSecretKey: keys
# One-time bootstrap Job that enables the Kubernetes auth method, creates the
# "eso-read" policy and the "eso-role" role bound to the ESO ServiceAccount.
#