Summary
KubernetesAuthEngineConfig can currently set token_reviewer_jwt only via
tokenReviewerServiceAccount, which mints a JWT for a ServiceAccount in the operator's own
cluster (TokenRequest API). But spec.kubernetesHost accepts any URL — when the TokenReview
endpoint is not the local API server, a locally-minted SA JWT is not a valid credential, and the
CRD cannot configure the backend correctly.
Proposal: add tokenReviewerJWTSecret (a SecretKeySelector) to source the reviewer credential
from a Secret.
Use cases
- Remote cluster: the operator manages an auth backend whose
kubernetesHost points at a
different cluster; local SA JWTs are meaningless there.
- Authenticating proxy / API gateway in front of the API server (Rancher, Teleport, managed
frontends): these accept their own bearer credentials, not SA JWTs.
- Externally-managed reviewer credential: rotation owned by another system that maintains a
Secret (e.g. via external-secrets).
Note Vault itself treats token_reviewer_jwt as an opaque bearer string — the CRD is currently
more restrictive than the API it manages.
Current behavior that blocks workarounds
toMap() always includes token_reviewer_jwt in the payload (empty string when no SA is set),
and Vault clears the stored value on an explicit "". So a reviewer written out-of-band (CLI,
Terraform) is wiped on the operator's next write — the config object can't be co-owned.
Proposed API
spec:
path: mycluster
kubernetesHost: https://gateway.example.com/cluster-a
kubernetesCACert: |
...
tokenReviewerJWTSecret: # NEW — takes precedence over tokenReviewerServiceAccount
name: reviewer-credential
key: token # optional, defaults to "token"
- Secret is read from the CR's namespace during
PrepareInternalValues, populating the same
internal value the SA path uses today.
- Mirrors the existing secret-sourcing pattern in
DatabaseSecretEngineConfig.rootCredentials
(a vaultSecret variant could follow the same shape later).
- Possible follow-up: watch referenced Secrets to re-reconcile on rotation, as
GitHubSecretEngineConfig does for its SSH-key Secret.
Summary
KubernetesAuthEngineConfigcan currently settoken_reviewer_jwtonly viatokenReviewerServiceAccount, which mints a JWT for a ServiceAccount in the operator's owncluster (TokenRequest API). But
spec.kubernetesHostaccepts any URL — when the TokenReviewendpoint is not the local API server, a locally-minted SA JWT is not a valid credential, and the
CRD cannot configure the backend correctly.
Proposal: add
tokenReviewerJWTSecret(aSecretKeySelector) to source the reviewer credentialfrom a Secret.
Use cases
kubernetesHostpoints at adifferent cluster; local SA JWTs are meaningless there.
frontends): these accept their own bearer credentials, not SA JWTs.
Secret (e.g. via external-secrets).
Note Vault itself treats
token_reviewer_jwtas an opaque bearer string — the CRD is currentlymore restrictive than the API it manages.
Current behavior that blocks workarounds
toMap()always includestoken_reviewer_jwtin the payload (empty string when no SA is set),and Vault clears the stored value on an explicit
"". So a reviewer written out-of-band (CLI,Terraform) is wiped on the operator's next write — the config object can't be co-owned.
Proposed API
PrepareInternalValues, populating the sameinternal value the SA path uses today.
DatabaseSecretEngineConfig.rootCredentials(a
vaultSecretvariant could follow the same shape later).GitHubSecretEngineConfigdoes for its SSH-key Secret.