Skip to content
Merged
7 changes: 4 additions & 3 deletions docs/TENANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ node-level signature reads first; do not add a shared pull credential.
Platform-authored resources in a registration dir are reconciled by flux-system
(not your tenant SA), which is why they may use the ClusterSecretStore where
your own resources may not (the Kyverno policy carves out flux-system-applied
resources). KRO-rendered Tenant children get no such exception. KRO's bind
permission names the constructor's four exact roles, including `tenant-edit`,
rather than the unrelated built-in `edit` role.
resources, and the External Secrets controller's own spec-preserving updates of
them, such as adding its cleanup finalizer). KRO-rendered Tenant children get no
such exception. KRO's bind permission names the constructor's four exact roles,
including `tenant-edit`, rather than the unrelated built-in `edit` role.

- The release and template-sync workflows mint a **GitHub App token** from the
org-level `APP_CLIENT_ID` variable and `APP_PRIVATE_KEY` secret — already available to
Expand Down
30 changes: 26 additions & 4 deletions k8s/bases/infrastructure/vault-config/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,16 +1094,29 @@ spec:
path "secret/data/apps/umami/*" {
capabilities = ["create", "update", "read"]
}
# ZITADEL's master key, generated once by its create-only
# PushSecret (vault-seed), and the customer Dex's ZITADEL
# client, which the customer-identity setup CronJob issues and
# a PushSecret copies here. Exact keys only.
# ZITADEL's master key and the portal's Dex client secret, each
# seeded by a create-only PushSecret (vault-seed), and the
# customer Dex's ZITADEL client, which the customer-identity
# setup CronJob issues and a PushSecret copies here. Exact keys
# only.
path "secret/data/apps/customer-identity/zitadel" {
capabilities = ["create", "update", "read"]
}
path "secret/data/apps/customer-identity/dex-zitadel-client" {
capabilities = ["create", "update", "read"]
}
path "secret/data/apps/customer-identity/portal-client" {
capabilities = ["create", "update", "read"]
}
# The portal database's two login passwords (create-only seed)
# and its CA certificate, pushed from the business-site
# namespace for the portal's projected Secret. Exact keys only.
path "secret/data/apps/business-site/portal-db" {
capabilities = ["create", "update", "read"]
}
path "secret/data/apps/business-site/portal-db-ca" {
capabilities = ["create", "update", "read"]
}
path "secret/data/apps/actual-budget/*" {
capabilities = ["create", "update", "read"]
}
Expand Down Expand Up @@ -1173,6 +1186,15 @@ spec:
path "secret/metadata/apps/customer-identity/dex-zitadel-client" {
capabilities = ["create", "update", "read"]
}
path "secret/metadata/apps/customer-identity/portal-client" {
capabilities = ["create", "update", "read"]
}
path "secret/metadata/apps/business-site/portal-db" {
capabilities = ["create", "update", "read"]
}
path "secret/metadata/apps/business-site/portal-db-ca" {
capabilities = ["create", "update", "read"]
}
path "secret/metadata/apps/actual-budget/*" {
capabilities = ["create", "update", "read"]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: generated-business-site-portal-db-migrator
namespace: openbao
spec:
refreshInterval: "0"
target:
name: generated-business-site-portal-db-migrator
creationPolicy: Owner
dataFrom:
- sourceRef:
generatorRef:
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
name: business-site-portal-db-migrator
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: generated-business-site-portal-db-web
namespace: openbao
spec:
refreshInterval: "0"
target:
name: generated-business-site-portal-db-web
creationPolicy: Owner
dataFrom:
- sourceRef:
generatorRef:
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
name: business-site-portal-db-web
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: generated-customer-identity-portal-client
namespace: openbao
spec:
refreshInterval: "0"
target:
name: generated-customer-identity-portal-client
creationPolicy: Owner
dataFrom:
- sourceRef:
generatorRef:
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
name: customer-identity-portal-client
9 changes: 9 additions & 0 deletions k8s/bases/infrastructure/vault-seed/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ resources:
- password-customer-identity-zitadel-masterkey.yaml
- external-secret-generated-customer-identity-zitadel-masterkey.yaml
- push-secret-push-customer-identity-zitadel-masterkey.yaml
- password-customer-identity-portal-client.yaml
- external-secret-generated-customer-identity-portal-client.yaml
- push-secret-push-customer-identity-portal-client.yaml
- password-business-site-portal-db-migrator.yaml
- password-business-site-portal-db-web.yaml
- external-secret-generated-business-site-portal-db-migrator.yaml
- external-secret-generated-business-site-portal-db-web.yaml
- push-secret-push-business-site-portal-db-migrator.yaml
- push-secret-push-business-site-portal-db-web.yaml
- push-secret-seed-r2-credentials.yaml
- push-secret-seed-wedding-db-backup-r2.yaml
- push-secret-seed-github-app.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
metadata:
name: business-site-portal-db-migrator
namespace: openbao
spec:
length: 32
digits: 8
symbols: 0
noUpper: false
allowRepeat: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
metadata:
name: business-site-portal-db-web
namespace: openbao
spec:
length: 32
digits: 8
symbols: 0
noUpper: false
allowRepeat: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
metadata:
name: customer-identity-portal-client
namespace: openbao
spec:
length: 48
digits: 12
symbols: 0
noUpper: false
allowRepeat: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# The portal database's migration and web passwords
# (apps/business-site/external-secret-portal-db-logins.yaml, and the web one
# also in the portal's settings). Create-only, so a rebuilt cluster that
# restores OpenBao keeps the passwords its restored database uses.
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
name: push-business-site-portal-db-migrator
namespace: openbao
spec:
refreshInterval: 1h
updatePolicy: IfNotExists
secretStoreRefs:
- name: openbao
kind: ClusterSecretStore
selector:
secret:
name: generated-business-site-portal-db-migrator
data:
- match:
secretKey: password
remoteRef:
remoteKey: apps/business-site/portal-db
Comment thread
devantler marked this conversation as resolved.
Resolved
property: migrator-password
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
name: push-business-site-portal-db-web
namespace: openbao
spec:
refreshInterval: 1h
updatePolicy: IfNotExists
secretStoreRefs:
- name: openbao
kind: ClusterSecretStore
selector:
secret:
name: generated-business-site-portal-db-web
data:
- match:
secretKey: password
remoteRef:
remoteKey: apps/business-site/portal-db
property: web-password
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# The portal's client secret at the customer Dex: read by Dex
# (apps/customer-identity/external-secret-dex-portal-client.yaml) and by the
# business-site portal. Create-only, so both keep the same value across a
# rebuilt cluster that restores OpenBao.
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
name: push-customer-identity-portal-client
namespace: openbao
spec:
refreshInterval: 1h
updatePolicy: IfNotExists
secretStoreRefs:
- name: openbao
kind: ClusterSecretStore
selector:
secret:
name: generated-customer-identity-portal-client
data:
- match:
secretKey: password
remoteRef:
remoteKey: apps/customer-identity/portal-client
property: client-secret
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# The ten-year CA for business-site-portal-db (cluster-portal-db.yaml); its
# server certificate is certificate-portal-db-server.yaml. The server Secret also
# carries the CA's ca.crt,
# which is what clients trust: the portal (through OpenBao, see
# push-secret-portal-db-ca.yaml) and the migration job.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: business-site-portal-db-ca
namespace: business-site
spec:
isCA: true
commonName: business-site-portal-db-ca
secretName: business-site-portal-db-ca
duration: 87600h
renewBefore: 8760h
privateKey:
algorithm: ECDSA
size: 256
rotationPolicy: Never
usages:
- cert sign
- crl sign
issuerRef:
name: business-site-portal-db-selfsigned
kind: Issuer
group: cert-manager.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# The streaming_replica client certificate for business-site-portal-db, issued
# under the ten-year CA (certificate-portal-db-ca.yaml). The Cluster uses this
# Secret both as its replication certificate and, through its ca.crt, as its
# client CA (cluster-portal-db.yaml). Without it CNPG generates its own client
# CA in a Secret named business-site-portal-db-ca, which is the ten-year CA's
# own Secret, and refuses to start.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: business-site-portal-db-replication
namespace: business-site
spec:
secretName: business-site-portal-db-replication
# Instances reload the certificate when cert-manager renews it.
secretTemplate:
labels:
cnpg.io/reload: ""
commonName: streaming_replica
duration: 2160h
renewBefore: 720h
privateKey:
algorithm: ECDSA
size: 256
rotationPolicy: Always
usages:
- client auth
issuerRef:
name: business-site-portal-db-ca
kind: Issuer
group: cert-manager.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# The database's server certificate, issued under the ten-year CA
# (certificate-portal-db-ca.yaml). It renews; the CA does not.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: business-site-portal-db-server
namespace: business-site
spec:
secretName: business-site-portal-db-server
# Instances reload the certificate when cert-manager renews it.
secretTemplate:
labels:
cnpg.io/reload: ""
duration: 2160h
renewBefore: 720h
privateKey:
algorithm: ECDSA
size: 256
rotationPolicy: Always
usages:
- server auth
dnsNames:
- business-site-portal-db-rw
- business-site-portal-db-rw.business-site
- business-site-portal-db-rw.business-site.svc
- business-site-portal-db-r
- business-site-portal-db-r.business-site
- business-site-portal-db-r.business-site.svc
- business-site-portal-db-ro
- business-site-portal-db-ro.business-site
- business-site-portal-db-ro.business-site.svc
issuerRef:
name: business-site-portal-db-ca
kind: Issuer
group: cert-manager.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Let Coroot's cluster-agent (observability namespace) reach the
# business-site-portal-db instances on 5432 for its Postgres integration
# (cluster-portal-db.yaml). Additive: it admits only the cluster-agent, and only
# to the database pods.
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: business-site-portal-db-coroot
namespace: business-site
spec:
endpointSelector:
matchLabels:
cnpg.io/cluster: business-site-portal-db
ingress:
- fromEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: observability
app.kubernetes.io/managed-by: coroot-operator
app.kubernetes.io/part-of: coroot
app.kubernetes.io/component: coroot-cluster-agent
toPorts:
- ports:
- port: "5432"
protocol: TCP
Loading
Loading