From 62910f7a26ae45776e952cd3b0a638445299d22f Mon Sep 17 00:00:00 2001 From: oscaarjs Date: Thu, 1 Aug 2024 23:41:30 +0200 Subject: [PATCH] docs wip --- examples/8-postgres-gcp-managed/README.md | 36 +++++++++++++++++++ .../zitadel-values.yaml | 35 ++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 examples/8-postgres-gcp-managed/README.md create mode 100644 examples/8-postgres-gcp-managed/zitadel-values.yaml diff --git a/examples/8-postgres-gcp-managed/README.md b/examples/8-postgres-gcp-managed/README.md new file mode 100644 index 00000000..adf6894d --- /dev/null +++ b/examples/8-postgres-gcp-managed/README.md @@ -0,0 +1,36 @@ +# GCP Managed Postgres Example + +By running the commands below, you deploy a ZITADEL instance configured to use a Google Cloud SQL managed Postgres database. The connection to the database is handled securely using the Cloud SQL Proxy. + +> This example uses the Cloud SQL Proxy as a sidecar container to connect to the managed Postgres instance. + +## Prerequisites + +- A Google Cloud project with a Cloud SQL Postgres instance. +- A Kubernetes service account with the `Cloud SQL Client` role [Cloud SQL Client Role](https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine#workload-identity) + +## Configuration + +Update the `values.yaml` file with your Cloud SQL instance connection details e.g.: + +```yaml +cloudSqlProxy: + enabled: true + imageTag: 2.12 + instanceConnectionName: :: + args: ["--port=5432", "--structured-logs"] + resources: + requests: + memory: "100Mi" + cpu: "100m" + ephemeral-storage: "612Mi" +``` + +Make sure that the key `serviceAccount` `name` is set to the service account with the `Cloud SQL Client` role. E.g. + +```yaml +serviceAccount: + create: false + name: +``` + diff --git a/examples/8-postgres-gcp-managed/zitadel-values.yaml b/examples/8-postgres-gcp-managed/zitadel-values.yaml new file mode 100644 index 00000000..4d79b22e --- /dev/null +++ b/examples/8-postgres-gcp-managed/zitadel-values.yaml @@ -0,0 +1,35 @@ +zitadel: + masterkey: x123456789012345678901234567891y + configmapConfig: + ExternalSecure: false + ExternalDomain: 127.0.0.1.sslip.io + TLS: + Enabled: false + Database: + Postgres: + Host: localhost # since we use cloud sql proxy + Port: 5432 + Database: zitadel + MaxOpenConns: 20 + MaxIdleConns: 10 + MaxConnLifetime: 30m + MaxConnIdleTime: 5m + User: + Username: postgres + SSL: + Mode: disable + Admin: + Username: postgres + SSL: + Mode: disable + +cloudSqlProxy: + enabled: true + imageTag: 2.12 + instanceConnectionName: :: + args: ["--port=5432", "--structured-logs"] + resources: + requests: + memory: "100Mi" + cpu: "100m" + ephemeral-storage: "612Mi" \ No newline at end of file