diff --git a/projects/control-service/projects/helm_charts/pipelines-control-service/Chart.yaml b/projects/control-service/projects/helm_charts/pipelines-control-service/Chart.yaml index 14f874bdbf..b30845d52e 100644 --- a/projects/control-service/projects/helm_charts/pipelines-control-service/Chart.yaml +++ b/projects/control-service/projects/helm_charts/pipelines-control-service/Chart.yaml @@ -19,6 +19,10 @@ dependencies: tags: - bitnami-common version: 1.x.x +- name: postgresql + version: "12.0.0" + repository: https://charts.bitnami.com/bitnami + condition: postgresql.enabled - name: cockroachdb version: "3.0.7" repository: "https://charts.helm.sh/stable" diff --git a/projects/control-service/projects/helm_charts/pipelines-control-service/README.md b/projects/control-service/projects/helm_charts/pipelines-control-service/README.md index fbbe44645a..b9a120db55 100644 --- a/projects/control-service/projects/helm_charts/pipelines-control-service/README.md +++ b/projects/control-service/projects/helm_charts/pipelines-control-service/README.md @@ -23,7 +23,9 @@ Note: integration with bitnami is being planned which will replace above repo. ## Introduction This chart bootstraps a Versatile Data Kit deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. -It also packages the [Cockroach chart](https://github.com/helm/charts/tree/master/stable/cockroachdb) which is required for bootstrapping a Cockroach deployment for the database requirements of the Versatile Data Kit +It also packages a requirement for bootstrapping a database deployment for Versatile Data Kit's metadata: +- [Bitnami PostgreSQL chart](https://github.com/bitnami/charts/tree/main/bitnami/postgresql) +- [Cockroach chart](https://github.com/helm/charts/tree/master/stable/cockroachdb) ## Installing the Chart To install the chart with the release name `my-release`: @@ -51,6 +53,7 @@ The command removes all the Kubernetes components associated with the chart and For a full list of configuration parameters of the Versatile Data Kit chart, and their documentation see [values.yaml](values.yaml) file. Look through it and make sure to have set all [Required] Parameters as per instruction in the property doc. +For PostgreSQL database parameters see https://github.com/bitnami/charts/tree/main/bitnami/postgresql For Cockroach database parameters see https://github.com/helm/charts/tree/master/stable/cockroachdb Specify each parameter using the `--set key=value` or `--set-file key=filePath` argument to `helm install`. For example, diff --git a/projects/control-service/projects/helm_charts/pipelines-control-service/templates/_helpers.tpl b/projects/control-service/projects/helm_charts/pipelines-control-service/templates/_helpers.tpl index 1fd9c3069c..e123b79070 100644 --- a/projects/control-service/projects/helm_charts/pipelines-control-service/templates/_helpers.tpl +++ b/projects/control-service/projects/helm_charts/pipelines-control-service/templates/_helpers.tpl @@ -182,13 +182,19 @@ Create the name of the deployment Kubernetes namespace used by System and builde {{- end -}} {{/* -Generate default JDBC credentials for local CockroachDB instance. +Generate default JDBC credentials for local embedded database instance (CockroachDB or PostgreSQL). */}} {{- define "pipelines-control-service.jdbcSecret" -}} +{{- if and (not .Values.cockroachdb.enabled) .Values.postgresql.enabled -}} +USERNAME: {{ default "postgres" .Values.database.username | b64enc | quote }} +PASSWORD: {{ default "" .Values.database.password | b64enc | quote }} +JDBC: {{ default (printf "jdbc:postgresql://%s-postgresql-public:5432/postgres?sslmode=disable" .Release.Name) .Values.database.jdbcUrl | b64enc |quote }} +{{- else -}} USERNAME: {{ default "root" .Values.database.username | b64enc | quote }} PASSWORD: {{ default "" .Values.database.password | b64enc | quote }} JDBC: {{ default (printf "jdbc:postgresql://%s-cockroachdb-public:26257/defaultdb?sslmode=disable" .Release.Name) .Values.database.jdbcUrl | b64enc |quote }} {{- end -}} +{{- end -}} {{/* JDBC secret name diff --git a/projects/control-service/projects/helm_charts/pipelines-control-service/templates/secret_jdbc.yaml b/projects/control-service/projects/helm_charts/pipelines-control-service/templates/secret_jdbc.yaml index 3854d3e7f1..b12c65ece3 100644 --- a/projects/control-service/projects/helm_charts/pipelines-control-service/templates/secret_jdbc.yaml +++ b/projects/control-service/projects/helm_charts/pipelines-control-service/templates/secret_jdbc.yaml @@ -1,4 +1,4 @@ -## Create a secret with JDBC credentials for CockroachDB only if externalSecretName is not supplied. +## Create a secret with JDBC credentials for embedded database (PostgreSQL or CockroachDB) only if externalSecretName is not supplied. ## If any of the fields are empty, we fall-back to defaults (f.e. local dev environment) {{- if not .Values.database.externalSecretName }} apiVersion: v1 diff --git a/projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml b/projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml index 3d3b03c074..4e8da43016 100644 --- a/projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml +++ b/projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml @@ -436,7 +436,34 @@ resources: ## and some deploy specific configuration like execution schedule ## Database schema is internal implementation detail and should not be queried directly. -## Configuration for the embedded database, set cockroachdb.enabled to false if you want to use external database +## Configuration for a PostgreSQL embedded database, set postgresql.enabled to false if you want to use external database +## See https://github.com/bitnami/charts/tree/main/bitnami/postgresql +postgresql: + enabled: false + architecture: standalone # replication +# readReplicas: +# replicaCount: 2 +# resources: +# limits: +# cpu: 500m +# memory: 500Mi +# requests: +# cpu: 500m +# memory: 500Mi + primary: + persistence: + size: 1Gi + resources: + limits: + cpu: 500m + memory: 500Mi + requests: + cpu: 500m + memory: 500Mi + service: + type: ClusterIP + +## Configuration for a CockroachDB embedded database, set cockroachdb.enabled to false if you want to use external database ## See https://github.com/cockroachdb/helm-charts/tree/master/cockroachdb cockroachdb: enabled: true