-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
232 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 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,15 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: zitadel | ||
spec: | ||
secretName: zitadel-certificate | ||
duration: 2160h # 90d | ||
renewBefore: 360h # 15d | ||
commonName: zitadel.priv.${domain_name} | ||
dnsNames: | ||
- zitadel.priv.${domain_name} | ||
issuerRef: | ||
name: vault | ||
kind: ClusterIssuer | ||
group: cert-manager.io |
20 changes: 20 additions & 0 deletions
20
security/base/zitadel/externalsecret-sqlinstance-masterpassword.yaml
This file contains 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,20 @@ | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: zitadel-sqlinstance-masterpassword | ||
spec: | ||
data: | ||
- secretKey: ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD | ||
remoteRef: | ||
key: zitadel/envvars | ||
refreshInterval: 20m | ||
secretStoreRef: | ||
kind: ClusterSecretStore | ||
name: clustersecretstore | ||
target: | ||
template: | ||
data: | ||
password: "{{ .ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD }}" | ||
creationPolicy: Owner | ||
deletionPolicy: Retain | ||
name: zitadel-pg-masterpassword |
This file contains 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,18 @@ | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: zitadel-envvars | ||
namespace: tooling | ||
spec: | ||
dataFrom: | ||
- extract: | ||
conversionStrategy: Default | ||
key: zitadel/envvars | ||
refreshInterval: 20m | ||
secretStoreRef: | ||
kind: ClusterSecretStore | ||
name: clustersecretstore | ||
target: | ||
creationPolicy: Owner | ||
deletionPolicy: Retain | ||
name: zitadel-envvars |
This file contains 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,23 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: zitadel | ||
spec: | ||
gatewayClassName: cilium | ||
infrastructure: | ||
annotations: | ||
service.beta.kubernetes.io/aws-load-balancer-name: "ogenki-zitadel-gateway" | ||
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: instance | ||
service.beta.kubernetes.io/aws-load-balancer-scheme: "internal" | ||
service.beta.kubernetes.io/aws-load-balancer-type: "external" | ||
external-dns.alpha.kubernetes.io/hostname: "zitadel.priv.${domain_name}" | ||
listeners: | ||
- name: http | ||
hostname: "*.priv.${domain_name}" | ||
port: 443 | ||
protocol: TLS | ||
allowedRoutes: | ||
namespaces: | ||
from: Same | ||
tls: | ||
mode: Passthrough |
This file contains 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,53 @@ | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: zitadel | ||
spec: | ||
interval: 30m | ||
driftDetection: | ||
mode: enabled | ||
chart: | ||
spec: | ||
chart: zitadel | ||
version: "8.5.0" # Not available yet | ||
sourceRef: | ||
kind: HelmRepository | ||
name: zitadel | ||
interval: 12h | ||
values: | ||
zitadel: | ||
# reference: https://zitadel.com/docs/self-hosting/manage/configure | ||
masterkey: ApnB2MUlRa63KRIE0iT1WlM4ZNZOvZF6 | ||
configmapConfig: | ||
Log: | ||
Formatter: | ||
Format: json | ||
ExternalPort: 443 | ||
ExternalSecure: true | ||
ExternalDomain: "zitadel.priv.${domain_name}" | ||
TLS: | ||
Enabled: true | ||
KeyPath: /tls/tls.key | ||
CertPath: /tls/tls.crt | ||
Database: | ||
Postgres: | ||
Host: sqlinstance-xplane-zitadel | ||
Port: 5432 | ||
Database: zitadel | ||
MaxOpenConns: 20 | ||
MaxIdleConns: 10 | ||
MaxConnLifetime: 30m | ||
MaxConnIdleTime: 5m | ||
|
||
envVarsSecret: zitadel-envvars | ||
|
||
# Mount certificate generated by cert-manager | ||
extraVolumes: | ||
- name: zitadel-certificate | ||
secret: | ||
defaultMode: 420 | ||
secretName: zitadel-certificate | ||
extraVolumeMounts: | ||
- name: zitadel-certificate | ||
mountPath: /tls | ||
readOnly: true |
This file contains 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,13 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: security | ||
resources: | ||
- externalsecret-sqlinstance-masterpassword.yaml | ||
- externalsecret-zitadel-envvars.yaml | ||
- certificate.yaml | ||
- gateway.yaml | ||
- helmrelease.yaml | ||
- network-policy.yaml | ||
- source.yaml | ||
- sqlinstance.yaml | ||
- tlsroute.yaml |
This file contains 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,37 @@ | ||
apiVersion: cilium.io/v2 | ||
kind: CiliumNetworkPolicy | ||
metadata: | ||
name: zitadel | ||
spec: | ||
description: "Allow internal traffic to the Zitadel service." | ||
endpointSelector: | ||
matchLabels: | ||
k8s:app.kubernetes.io/name: zitadel | ||
egress: | ||
- toEndpoints: | ||
- matchLabels: | ||
k8s:io.kubernetes.pod.namespace: kube-system | ||
k8s:k8s-app: kube-dns | ||
toPorts: | ||
- ports: | ||
- port: "53" | ||
protocol: UDP | ||
- port: "53" | ||
protocol: TCP | ||
- toEntities: | ||
- world | ||
toPorts: | ||
- ports: | ||
- port: "80" | ||
protocol: TCP | ||
- port: "443" | ||
protocol: TCP | ||
- port: "5432" | ||
protocol: TCP | ||
ingress: | ||
- fromCIDR: | ||
- "${vpc_cidr_block}" | ||
toPorts: | ||
- ports: | ||
- port: "8080" | ||
protocol: TCP |
This file contains 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,7 @@ | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: zitadel | ||
spec: | ||
interval: 24h | ||
url: https://charts.zitadel.com |
This file contains 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: cloud.ogenki.io/v1alpha1 | ||
kind: SQLInstance | ||
metadata: | ||
name: xplane-zitadel | ||
spec: | ||
parameters: | ||
engine: postgres | ||
engineVersion: "16" | ||
size: small | ||
storageGB: 20 | ||
databases: | ||
- owner: zitadel | ||
name: zitadel | ||
passwordSecretRef: | ||
namespace: security | ||
name: zitadel-pg-masterpassword | ||
key: password | ||
compositionRef: | ||
name: xsqlinstances.cloud.ogenki.io | ||
writeConnectionSecretToRef: | ||
name: xplane-zitadel-rds |
This file contains 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,13 @@ | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: TLSRoute | ||
metadata: | ||
name: zitadel | ||
spec: | ||
parentRefs: | ||
- name: zitadel | ||
hostnames: | ||
- "zitadel.priv.${domain_name}" | ||
rules: | ||
- backendRefs: | ||
- name: zitadel | ||
port: 8080 |
This file contains 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 |
---|---|---|
|
@@ -5,4 +5,5 @@ resources: | |
- ../base/kyverno | ||
- ../base/cert-manager | ||
- ../base/vault-snapshot | ||
- ../base/zitadel | ||
- external-secrets |
This file contains 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