arrstack: manage sonarr/radarr/prowlarr API keys via Vault #369
Reference in New Issue
Block a user
Delete Branch "benvin/arrstack-vault-apikeys"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The sonarr/radarr/prowlarr images self-generate an API key into
/config/config.xml on first boot, so the key is unmanaged and differs per
volume reset. This makes Vault the source of truth for those keys (override
bootstrap, chosen by Ben): the key is minted in Vault and enforced into
config.xml before each app starts.
Changes
VaultAuthdefaultin thearrstacknamespace (kubernetes auth,mount
k8s/au/syd1, roledefault, SAdefault), mirroring jellyfin.VaultStaticSecretthat syncskv/kubernetes/namespace/arrstack/default/<app>(keyapitoken) into the<app>-apikeySecret. Thedefaultk8s role's templated policy alreadygrants read on that path for the
arrstack/defaultSA, so noterraform-vault change is needed.
apikey-initinitContainer to each of the three deployments thatreads
API_KEYfrom the VSO-created Secret, fails closed on a missing ornon-hex value, and writes/updates only the
<ApiKey>element in/config/config.xml(then fixes ownership 1000:1000, mode 600). Image is apinned busybox via artifactapi to keep this PR atomic (no new image
dependency).
Notes
kv/kubernetes/namespace/arrstack/default/<app>.<ApiKey>(uses ControlPassword),a separate follow-up.
kv/service/media-apps/<app>; the authoritative key now lives at the pathabove. Reconciliation is deferred.