diff --git a/apps/base/cephrgw-system/kustomization.yaml b/apps/base/cephrgw-system/kustomization.yaml index c3558d4..8087c3e 100644 --- a/apps/base/cephrgw-system/kustomization.yaml +++ b/apps/base/cephrgw-system/kustomization.yaml @@ -9,3 +9,5 @@ resources: - https://git.unkin.net/unkin/cephrgw-operator/raw/tag/v0.1.0/config/crd/install.yaml - rbac.yaml - deployment.yaml + - vaultauth.yaml + - vaultstaticsecret.yaml diff --git a/apps/base/cephrgw-system/vaultauth.yaml b/apps/base/cephrgw-system/vaultauth.yaml new file mode 100644 index 0000000..fe747e6 --- /dev/null +++ b/apps/base/cephrgw-system/vaultauth.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultAuth +metadata: + name: default + namespace: cephrgw-system +spec: + method: kubernetes + mount: k8s/au/syd1 + vaultConnectionRef: vso-system/default + allowedNamespaces: + - cephrgw-system + kubernetes: + role: cephrgw-operator + serviceAccount: cephrgw-operator + audiences: + - vault + tokenExpirationSeconds: 600 diff --git a/apps/base/cephrgw-system/vaultstaticsecret.yaml b/apps/base/cephrgw-system/vaultstaticsecret.yaml new file mode 100644 index 0000000..6de026a --- /dev/null +++ b/apps/base/cephrgw-system/vaultstaticsecret.yaml @@ -0,0 +1,21 @@ +--- +# Renders the Ceph dashboard credentials from Vault into the cephrgw-credentials +# Secret the operator Deployment consumes via envFrom. The KV secret's keys +# (CEPH_DASHBOARD_URL/USERNAME/PASSWORD, optional CEPH_RGW_ENDPOINT/CA) are +# copied verbatim, so they land as the matching env vars. +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: cephrgw-credentials + namespace: cephrgw-system +spec: + vaultAuthRef: default + mount: kv + type: kv-v2 + path: service/cephrgw/dashboard-credentials + refreshAfter: 5m + hmacSecretData: true + destination: + name: cephrgw-credentials + create: true + overwrite: true