vault (Add): cert-manager role on kubernetes-c1 for the internal-app CA #170

Merged
ginjiruu merged 1 commit from c1-cert-manager-apps into master 2026-11-20 17:21:18 +00:00
Owner

Pairs with lab/clusters PR c1-internal-gateway (merge this one first). Adds the login for c1's openbao-apps ClusterIssuer:

  • vault_kubernetes_auth_backend_role cert-manager on auth/kubernetes-c1, bound to system:serviceaccount:cert-manager:openbao-apps-issuer, policy pki-apps-caosh-cert-manager (sign/cert-manager only — CA, role and policy all shipped in iac#167, mini's issuer already shares them).

Why it differs from cert-manager-mini.tf: mini verifies ServiceAccount JWTs offline (ADR-0010 JWT mount, bound_audiences required). kubernetes-c1 is a kubernetes mount that reviews with the caller's own JWT — so no audiences here, and the SA received TokenReview rights in flux-clusters (clusters/c1/openbao/release/rbac.yaml, same file that already admits ESO/rook/snapshot).

No router changes: the c1 internal Gateway has no fixed address, nothing in internal_gateways to add. vault/sim is a separate root and is untouched by this file.

Verified: tofu fmt -check, tofu init -backend=false, tofu validate — all pass. Apply happens on the runner as usual (the vault-config Terraform object on mini).

Pairs with lab/clusters PR `c1-internal-gateway` (merge this one first). Adds the login for c1's `openbao-apps` ClusterIssuer: - `vault_kubernetes_auth_backend_role` `cert-manager` on `auth/kubernetes-c1`, bound to `system:serviceaccount:cert-manager:openbao-apps-issuer`, policy `pki-apps-caosh-cert-manager` (sign/cert-manager only — CA, role and policy all shipped in iac#167, mini's issuer already shares them). Why it differs from `cert-manager-mini.tf`: mini verifies ServiceAccount JWTs offline (ADR-0010 JWT mount, `bound_audiences` required). `kubernetes-c1` is a `kubernetes` mount that reviews with the caller's own JWT — so no audiences here, and the SA received TokenReview rights in flux-clusters (`clusters/c1/openbao/release/rbac.yaml`, same file that already admits ESO/rook/snapshot). No router changes: the c1 internal Gateway has no fixed address, nothing in `internal_gateways` to add. `vault/sim` is a separate root and is untouched by this file. Verified: `tofu fmt -check`, `tofu init -backend=false`, `tofu validate` — all pass. Apply happens on the runner as usual (the `vault-config` Terraform object on mini).
Sign-only login for the openbao-apps ClusterIssuer that flux-clusters
adds on c1: bound to system:serviceaccount:cert-manager:openbao-apps-issuer
on the kubernetes-c1 mount, policy pki-apps-caosh-cert-manager
(sign/cert-manager only, iac#167). Mini's equivalent (cert-manager-mini.tf)
is a JWT role because mini's mount verifies offline; c1's mount reviews
with the caller's JWT, so no bound_audiences and the SA got TokenReview
rights in flux-clusters. vault/sim is a separate root, unaffected.
tofu fmt + validate pass.
Collaborator

tf-controller plan output:


OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

OpenTofu will perform the following actions:

  # vault_kubernetes_auth_backend_role.c1_cert_manager will be created
  + resource "vault_kubernetes_auth_backend_role" "c1_cert_manager" {
      + alias_name_source                = (known after apply)
      + backend                          = "kubernetes-c1"
      + bound_service_account_names      = [
          + "openbao-apps-issuer",
        ]
      + bound_service_account_namespaces = [
          + "cert-manager",
        ]
      + id                               = (known after apply)
      + role_name                        = "cert-manager"
      + token_max_ttl                    = 3600
      + token_policies                   = [
          + "pki-apps-caosh-cert-manager",
        ]
      + token_ttl                        = 900
      + token_type                       = "default"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

To apply this plan, please merge this pull request.

tf-controller plan output: ```hcl OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create OpenTofu will perform the following actions: # vault_kubernetes_auth_backend_role.c1_cert_manager will be created + resource "vault_kubernetes_auth_backend_role" "c1_cert_manager" { + alias_name_source = (known after apply) + backend = "kubernetes-c1" + bound_service_account_names = [ + "openbao-apps-issuer", ] + bound_service_account_namespaces = [ + "cert-manager", ] + id = (known after apply) + role_name = "cert-manager" + token_max_ttl = 3600 + token_policies = [ + "pki-apps-caosh-cert-manager", ] + token_ttl = 900 + token_type = "default" } Plan: 1 to add, 0 to change, 0 to destroy. ``` To apply this plan, please **merge** this pull request.
ginjiruu merged commit b08868729f into master 2026-11-20 17:21:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac!170
No description provided.