Repository navigation
feat(customer-identity): run the portal's customer Dex and give the portal its database #6341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eeb0ab8
feat(customer-identity): run the portal's customer Dex in front of ZI…
devantler f2c3d7b
feat(business-site): give the portal its own database and runtime inputs
devantler b69b41b
refactor(business-site): put each portal database resource in its own…
devantler aa33080
fix(business-site): give Coroot its own policy to the portal database
devantler 08ec648
fix(business-site): give the portal database its own client CA and re…
devantler 9fe9cc6
fix(business-site): reload the portal database when its backup key ro…
devantler 781a477
docs(tenants): note the External Secrets controller carve-out
devantler b99982e
feat(customer-identity): serve the portal's sign-in at the root of it…
devantler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...infrastructure/vault-seed/external-secret-generated-business-site-portal-db-migrator.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
17 changes: 17 additions & 0 deletions
17
...ases/infrastructure/vault-seed/external-secret-generated-business-site-portal-db-web.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
17 changes: 17 additions & 0 deletions
17
.../infrastructure/vault-seed/external-secret-generated-customer-identity-portal-client.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
k8s/bases/infrastructure/vault-seed/password-business-site-portal-db-migrator.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
12 changes: 12 additions & 0 deletions
12
k8s/bases/infrastructure/vault-seed/password-business-site-portal-db-web.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
12 changes: 12 additions & 0 deletions
12
k8s/bases/infrastructure/vault-seed/password-customer-identity-portal-client.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
25 changes: 25 additions & 0 deletions
25
k8s/bases/infrastructure/vault-seed/push-secret-push-business-site-portal-db-migrator.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| property: migrator-password | ||
21 changes: 21 additions & 0 deletions
21
k8s/bases/infrastructure/vault-seed/push-secret-push-business-site-portal-db-web.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
25 changes: 25 additions & 0 deletions
25
k8s/bases/infrastructure/vault-seed/push-secret-push-customer-identity-portal-client.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
27 changes: 27 additions & 0 deletions
27
k8s/providers/hetzner/apps/business-site/certificate-portal-db-ca.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
30 changes: 30 additions & 0 deletions
30
k8s/providers/hetzner/apps/business-site/certificate-portal-db-replication.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
35 changes: 35 additions & 0 deletions
35
k8s/providers/hetzner/apps/business-site/certificate-portal-db-server.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
24 changes: 24 additions & 0 deletions
24
k8s/providers/hetzner/apps/business-site/cilium-network-policy-portal-db-coroot.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.