Skip to content
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

versatile-data-kit: postgresql embedded #1273

Merged
merged 13 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down