feat(artifactapi): mount terraform registry signing key #217
Reference in New Issue
Block a user
Delete Branch "benvin/artifactapi-tf-signing"
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
artifactapi #102 makes local terraform repos a real provider registry, which requires a GPG key to sign
SHA256SUMS. This mounts that key into the api deployment.Changes
artifactapi-tf-signingat/etc/artifactapi/tf-signing(optional: true).TF_SIGNING_KEY_PATH, andTF_SIGNING_KEY_PASSPHRASEfrom the secret's optionalpassphrasekey.The mount is optional, so the pod runs before the secret exists; artifactapi keeps the registry disabled until a readable key is present. Safe to merge ahead of the image bump — the current v3.7.3 image just ignores the new env/volume.
Operator step
Create the secret out of band (not committed — the pre-commit hook blocks plain secrets):
Once #102 is tagged/built and the image bumped,
/.well-known/terraform.jsonstarts serving andterraform initworks against the registry.Note
No HTTPRoute change:
/already routes/.well-knownand/terraformto the API service.Wires the GPG signing key the terraform provider registry needs into the api deployment. The secret is mounted optional so the pod runs before it exists; artifactapi leaves the registry disabled until a readable key is present. - mount secret artifactapi-tf-signing at /etc/artifactapi/tf-signing (optional) - set TF_SIGNING_KEY_PATH, and TF_SIGNING_KEY_PASSPHRASE from the secret's optional passphrase key Create the secret out of band with an armored private key: kubectl -n artifactapi create secret generic artifactapi-tf-signing \ --from-file=private-key.asc=./private-key.asc6302b84c76to9d4739505dSuperseded — no longer needed.
artifactapi now self-provisions the terraform registry signing key: on first start it generates a GPG keypair and stores it in the database (
signing_keystable), shared across replicas. No K8s secret to mount.TF_SIGNING_KEY_PATHremains as an optional bring-your-own override, so this wiring can be re-introduced later if desired. Closing.Pull request closed