Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(helm): support store pgpassword in secret and escape password flag (#9767)

h3n4l4f9b4709537b
diff --git a/docs/bytebase-1.1.0.tgz b/docs/bytebase-1.1.0.tgz
new file mode 100644
index 0000000000..50309f4eb2
Binary files /dev/null and b/docs/bytebase-1.1.0.tgz differ
diff --git a/docs/index.yaml b/docs/index.yaml
index 24f236911b..1b89d62521 100644
--- a/docs/index.yaml
+++ b/docs/index.yaml
@@ -2,7 +2,23 @@ apiVersion: v1
entries:
bytebase:
- apiVersion: v2
- created: "2023-08-11T13:37:25.24486+08:00"
+ created: "2023-12-10T22:43:04.748372+08:00"
+ description: Safe database schema change and version control for DevOps teams.
+ digest: 26b961bf0fede860616180c6403483b64eba2f1d04ca67c65d0f6a822e429fec
+ home: https://bytebase.com/
+ icon: https://raw.githubusercontent.com/bytebase/bytebase.com/main/public/images/logo-full.svg
+ maintainers:
+ name: Bytebase
+ name: bytebase
+ sources:
+ - https://github.com/bytebase/bytebase
+ type: application
+ urls:
+ - bytebase-1.1.0.tgz
+ version: 1.1.0
+ - apiVersion: v2
+ created: "2023-12-10T22:43:04.748098+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: 5357bc5883d9ca673cc1c03ec821bb7d26f33dc2e5be2ac502f36c05c1b46e31
home: https://bytebase.com/
@@ -18,7 +34,7 @@ entries:
- bytebase-1.0.6.tgz
version: 1.0.6
- apiVersion: v2
- created: "2023-08-11T13:37:25.24364+08:00"
+ created: "2023-12-10T22:43:04.74754+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: c5680404fee75dcbb4ee8cfea428caca76143c83236d5e0fff31ac8658e2e747
home: https://bytebase.com/
@@ -34,7 +50,7 @@ entries:
- bytebase-1.0.5.tgz
version: 1.0.5
- apiVersion: v2
- created: "2023-08-11T13:37:25.242442+08:00"
+ created: "2023-12-10T22:43:04.747169+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: ca7092842f14dff04a7aec43b92c59538a4fff685434d4dbfd0738cda35e8350
home: https://bytebase.com/
@@ -50,7 +66,7 @@ entries:
- bytebase-1.0.4.tgz
version: 1.0.4
- apiVersion: v2
- created: "2023-08-11T13:37:25.241805+08:00"
+ created: "2023-12-10T22:43:04.746646+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: 55551c2b2a090980b5f06feb67bbe59f2f9546ff0c4811507032b3e94cb36846
home: https://bytebase.com/
@@ -66,7 +82,7 @@ entries:
- bytebase-1.0.3.tgz
version: 1.0.3
- apiVersion: v2
- created: "2023-08-11T13:37:25.240154+08:00"
+ created: "2023-12-10T22:43:04.745103+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: 0de78149cf15773271210aeb60325f473f7835ef2d004bce5c8ce28454e53ab1
home: https://bytebase.com/
@@ -82,7 +98,7 @@ entries:
- bytebase-1.0.2.tgz
version: 1.0.2
- apiVersion: v2
- created: "2023-08-11T13:37:25.239843+08:00"
+ created: "2023-12-10T22:43:04.744554+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: 95711d0adec416207c21bf2bb707c9c3179509ac4acb6151803d8ec10f4bc465
home: https://bytebase.com/
@@ -98,7 +114,7 @@ entries:
- bytebase-1.0.1.tgz
version: 1.0.1
- apiVersion: v2
- created: "2023-08-11T13:37:25.239535+08:00"
+ created: "2023-12-10T22:43:04.744223+08:00"
description: Safe database schema change and version control for DevOps teams.
digest: c273189105a7b2ef1d7f9833b76c9008341d9689ff22622aba9809c5ac59adc2
home: https://bytebase.com/
@@ -113,4 +129,4 @@ entries:
urls:
- bytebase-1.0.0.tgz
version: 1.0.0
-generated: "2023-08-11T13:37:25.238619+08:00"
+generated: "2023-12-10T22:43:04.743247+08:00"
diff --git a/helm-charts/bytebase/Chart.yaml b/helm-charts/bytebase/Chart.yaml
index 04026acb59..13004c177a 100644
--- a/helm-charts/bytebase/Chart.yaml
+++ b/helm-charts/bytebase/Chart.yaml
@@ -1,6 +1,6 @@
apiVersion: v2
name: bytebase
-version: 1.0.6
+version: 1.1.0
description: Safe database schema change and version control for DevOps teams.
type: application
home: https://bytebase.com/
diff --git a/helm-charts/bytebase/README.md b/helm-charts/bytebase/README.md
index 07c93bc8b3..65a160d00a 100644
--- a/helm-charts/bytebase/README.md
+++ b/helm-charts/bytebase/README.md
@@ -9,7 +9,7 @@ $ helm repo add bytebase-repo https://bytebase.github.io/bytebase
$ helm repo update
$ helm -n <YOUR_NAMESPACE> \
--set "bytebase.option.port"={PORT} \
---set "bytebase.option.pg"={PGDSN} \
+--set "bytebase.option.externalPg.url"={PGDSN} \
--set "bytebase.version"={VERSION} \
install <RELEASE_NAME> bytebase-repo/bytebase
```
@@ -24,7 +24,7 @@ install <RELEASE_NAME> bytebase-repo/bytebase
```bash
$ helm -n <YOUR_NAMESPACE> \
--set "bytebase.option.port"={PORT} \
---set "bytebase.option.pg"={PGDSN} \
+--set "bytebase.option.externalPg.url"={PGDSN} \
--set "bytebase.version"={VERSION} \
--set "bytebase.option.external-url"={EXTERNAL_URL} \
--set "bytebase.persistence.enabled"={TRUE/FALSE} \
@@ -38,9 +38,9 @@ For example:
```bash
$ helm -n bytebase \
--set "bytebase.option.port"=443 \
---set "bytebase.option.pg"="postgresql://bytebase:[email protected]/bytebase" \
+--set "bytebase.option.externalPg.url"="postgresql://bytebase:[email protected]/bytebase" \
--set "bytebase.option.external-url"="https://bytebase.ngrok-free.app" \
---set "bytebase.version"=2.5.0 \
+--set "bytebase.version"=2.11.1 \
--set "bytebase.persistence.enabled"="true" \
--set "bytebase.persistence.storage"="10Gi" \
--set "bytebase.persistence.storageClass"="csi-disk" \
@@ -60,7 +60,7 @@ Use `helm upgrade` command to upgrade the bytebase version or configuration.
```bash
helm -n <YOUR_NAMESPACE> \
--set "bytebase.option.port"={NEW_PORT} \
---set "bytebase.option.pg"={NEW_PGDSN} \
+--set "bytebase.option.externalPg.url"={NEW_PGDSN} \
--set "bytebase.version"={NEW_VERSION} \
--set "bytebase.option.external-url"={EXTERNAL_URL} \
--set "bytebase.persistence.enabled"={TRUE/FALSE} \
@@ -71,20 +71,31 @@ upgrade bytebase-release bytebase-repo/bytebase
## Parameters
-| Parameter | Description | Default Value |
-| :------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------: |
-| bytebase.option.port | Port where Bytebase server runs. | 8080 |
-| bytebase.option.pg | External PostgreSQL instance connection url(must provide dbname).It will be ignored if you specify `bytebase.option.existingPgURLSecret`. | "postgresql://bytebase:<[email protected]>/bytebase" |
-| bytebase.option.external-url | The address for users to visit Bytebase, visit [our docs](https://www.bytebase.com/docs/get-started/install/external-url/) to get more details | "<https://www.bytebase.com/docs/get-started/install/external-url>" |
-| bytebase.option.existingPgURLSecret | Existing secret with external PostgreSQL connection string. | "" |
-| bytebase.option.existingPgURLSecretKey | Existing secret key with external PostgreSQL connection(must specfied if you specify `bytebase.option.existingPgURLSecret`) string. | "" |
-| bytebase.version | The Bytebase version. | "2.5.0" |
-| bytebase.persistence.enabled | Persist bytebase data switch. | false |
-| bytebase.persistence.storageClass | The storage class used by Bytebase PVC. | "" |
-| bytebase.persistence.storage | The storage size of Bytebase PVC used. | "2Gi" |
-| bytebase.persistence.existingClaim | The existing PVC that bytebase need to use. | "" |
-| bytebase.registryMirrorHost | "" | The host of the registry mirror used by downloading bytebase container images. |
-| bytebase.option.disable-sample | Disable the sample instance. | false |
+| Parameter | Description | Default Value |
+| :------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------: |
+| `bytebase.version` | The version of Bytebase to be installed. | "2.11.1" |
+| `bytebase.registryMirrorHost` | The host for the Docker registry mirror. Leave empty for default registry usage. | "" |
+| `bytebase.option.port` | Port where Bytebase server runs. | 8080 |
+| `bytebase.option.data` | Data directory of Bytebase data stored. | /var/opt/bytebase |
+| `bytebase.option.external-url` | The address for users to visit Bytebase, visit [our docs](https://www.bytebase.com/docs/get-started/install/external-url/) to get more details. | "<https://www.bytebase.com/docs/get-started/install/external-url>" |
+| `bytebase.option.disable-sample` | Disable the sample instance. | false |
+| `bytebase.option.externalPg.url` | The PostgreSQL url(DSN) for Bytebase to store the metadata. | "" |
+| `bytebase.option.externalPg.existingPgURLSecret` | The name of Secret stores the PostgreSQL url(DSN) for Bytebase to store the metadata. | "" |
+| `bytebase.option.externalPg.existingPgURLSecretKey` | The key of Secret stores the PostgreSQL url(DSN) for Bytebase to store the metadata. Should be used with `bytebase.option.externalPg.existingPgURLSecret` together. | "" |
+| `bytebase.option.externalPg.pgHost` | The PostgreSQL host for Bytebase metadata storage. | "host" |
+| `bytebase.option.externalPg.pgPort` | The PostgreSQL port for Bytebase metadata storage. | "port" |
+| `bytebase.option.externalPg.pgUsername` | The PostgreSQL username for Bytebase metadata storage. | "username" |
+| `bytebase.option.externalPg.pgPassword` | The PostgreSQL password for Bytebase metadata storage. | "password" |
+| `bytebase.option.externalPg.pgDatabase` | The name of the PostgreSQL database for Bytebase. | "database" |
+| `bytebase.option.externalPg.existingPgPasswordSecret` | The name of Secret that stores the existing PostgreSQL password for Bytebase metadata storage. | "" |
+| `bytebase.option.externalPg.existingPgPasswordSecretKey` | The key of Secret storing the existing PostgreSQL password. Should be used with `bytebase.option.externalPg.existingPgPasswordSecret`. | "" |
+| `bytebase.option.externalPg.escapePassword` | Controls whether to escape the password in the connection string. `bytebase.option.externalPg.existingPgPasswordSecret` or `bytebase.option.externalPg.pgPassword` should be specified with this value together. **Experimental feature.** | false |
+| `bytebase.persistence.enabled` | Enable/disable persistence for Bytebase. | false |
+| `bytebase.persistence.existingClaim` | Name of the existing PersistentVolumeClaim for Bytebase persistence. | "" |
+| `bytebase.persistence.storage` | Size of the persistent volume for Bytebase data. | "2Gi" |
+| `bytebase.persistence.storageClass` | Storage class for the persistent volume used by Bytebase. | "" |
+| `bytebase.extraSecretMounts` | Additional Bytebase secret mounts. Defined as an array of volumeMount objects. | [] |
+| `bytebase.extraVolumes` | Additional Bytebase volumes. Defined as an array of volume objects. | [] |
**If you enable bytebase persistence, you should provide storageClass and storage to bytebase to request a PVC, or provide the already existed PVC by existingClaim.**
diff --git a/helm-charts/bytebase/templates/secretproviderclass.yaml b/helm-charts/bytebase/templates/secretproviderclass.yaml
new file mode 100644
index 0000000000..83dbeba6c5
--- /dev/null
+++ b/helm-charts/bytebase/templates/secretproviderclass.yaml
@@ -0,0 +1,37 @@
+{{- if false -}}
+---
+# For customizing the secret provider, please refer to the provider documentation,
+# such as Azure Key Vault, Hashicorp Vault.
+apiVersion: secrets-store.csi.x-k8s.io/v1
+kind: SecretProviderClass
+metadata:
+ name: akv-bytebase-spc
+ namespace: {{ template "bytebase.namespace" . }}
+ labels:
+ {{- include "bytebase.labels" . | nindent 4}}
+spec:
+ # Currently, we only support azure as secret provider.
+ provider: azure
+ secretObjects:
+ - data:
+ # data field to populate
+ - key: pgurl
+ # name of the mounted content to sync. this could be the object name or the object alias
+ objectName: "ObjectName"
+ secretName: "bytebase-secret"
+ type: Opaque
+ # Provider-specific parameters.
+ # https://azure.github.io/secrets-store-csi-driver-provider-azure/docs/getting-started/usage/.
+ parameters:
+ usePodIdentity: "false"
+ useVMManagedIdentity: "false"
+ userAssignedIdentityID: ""
+ keyvaultName: "KeyVaultName"
+ objects: |
+ array:
+ - |
+ objectName: "ObjectName"
+ objectType: secret
+ objectVersion: ""
+ tenantID: "xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb"
+{{- end -}}
diff --git a/helm-charts/bytebase/templates/statefulset.yaml b/helm-charts/bytebase/templates/statefulset.yaml
index 5b351fc52a..f829e4aa79 100644
--- a/helm-charts/bytebase/templates/statefulset.yaml
+++ b/helm-charts/bytebase/templates/statefulset.yaml
@@ -1,12 +1,31 @@
-{{- $external_url := index .Values.bytebase.option "external-url" -}}
-{{- $existingPgURLSecret := .Values.bytebase.option.existingPgURLSecret -}}
-{{- $existingPgURLSecretKey := .Values.bytebase.option.existingPgURLSecretKey -}}
-{{- $port := .Values.bytebase.option.port -}}
-{{- $pg := .Values.bytebase.option.pg -}}
-{{- $data := .Values.bytebase.option.data -}}
+# bytebase
{{- $version := .Values.bytebase.version -}}
{{- $registryMirrorHost := .Values.bytebase.registryMirrorHost -}}
-{{- $disable_sample := index .Values.bytebase.option "disable-sample" -}}
+{{- $extraSecretMounts := .Values.bytebase.extraSecretMounts -}}
+{{- $extraVolumes := .Values.bytebase.extraVolumes }}
+# bytebase.option
+{{- $port := .Values.bytebase.option.port -}}
+{{- $data := .Values.bytebase.option.data -}}
+{{- $external_url := index .Values.bytebase.option "external-url" -}}
+{{- $disable_sample := index .Values.bytebase.option "disable-sample" }}
+# bytebase.option.externalPg
+{{- $externalPgURL := .Values.bytebase.option.externalPg.url -}}
+{{- $externalPgExistingPgURLSecret := .Values.bytebase.option.externalPg.existingPgURLSecret -}}
+{{- $externalPgExistingPgURLSecretKey := .Values.bytebase.option.externalPg.existingPgURLSecretKey -}}
+{{- $externalPgHost := .Values.bytebase.option.externalPg.pgHost | default "host" -}}
+{{- $externalPgPort := .Values.bytebase.option.externalPg.pgPort | default "port" -}}
+{{- $externalPgUsername := .Values.bytebase.option.externalPg.pgUsername | default "username" -}}
+{{- $externalPgPassword := .Values.bytebase.option.externalPg.pgPassword | default "password" -}}
+{{- $externalPgDatabase := .Values.bytebase.option.externalPg.pgDatabase | default "database" -}}
+{{- $externalPgExistingPgPasswordSecret := .Values.bytebase.option.externalPg.existingPgPasswordSecret -}}
+{{- $externalPgExistingPgPasswordSecretKey := .Values.bytebase.option.externalPg.existingPgPasswordSecretKey -}}
+{{- $externalPgEscapePgPassword := .Values.bytebase.option.externalPg.escapePassword }}
+# bytbease.persistence
+{{- $persistenceEnable := .Values.bytebase.persistence.enabled -}}
+{{- $persistenceExistingClaim := .Values.bytebase.persistence.existingClaim -}}
+{{- $persistenceStorage := .Values.bytebase.persistence.storage -}}
+{{- $persistenceStorageClass := .Values.bytebase.persistence.storageClass }}
+---
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -25,39 +44,126 @@ spec:
labels:
app: bytebase
spec:
+ {{- if $externalPgEscapePgPassword }}
+ # If user specify the externalPgEscapePgPassword, we should escape the password in the PG_URL in the shell,
+ # because the password may comes from a secret, which is invisible in helm.
+ # Hence, we do the escaping in the initialization container, and write the escaped password to the shared volume.
+ initContainers:
+ - name: init-container
+ {{- if $registryMirrorHost }}
+ image: {{ trimSuffix "/" $registryMirrorHost }}/busybox
+ {{- else }}
+ image: busybox
+ {{- end }}
+ imagePullPolicy: IfNotPresent
+ env:
+ - name: PG_PASSWORD
+ {{- if $externalPgExistingPgPasswordSecret }}
+ # If user specifies an existing secret, we should read the external pg password in that secret.
+ valueFrom:
+ secretKeyRef:
+ name: {{ $externalPgExistingPgPasswordSecret }}
+ key: {{ $externalPgExistingPgPasswordSecretKey }}
+ {{- else }}
+ value: {{ $externalPgPassword }}
+ {{- end }}
+ command:
+ - /bin/sh
+ - -c
+ - |
+ echo $(echo $PG_PASSWORD \
+ | sed \
+ -e 's/%/%25/g' \
+ -e 's/ /%20/g' \
+ -e 's/!/%21/g' \
+ -e 's/"/%22/g' \
+ -e "s/'/%27/g" \
+ -e 's/#/%23/g' \
+ -e 's/(/%28/g' \
+ -e 's/)/%29/g' \
+ -e 's/+/%2b/g' \
+ -e 's/,/%2c/g' \
+ -e 's/-/%2d/g' \
+ -e 's/:/%3a/g' \
+ -e 's/;/%3b/g' \
+ -e 's/?/%3f/g' \
+ -e 's/@/%40/g' \
+ -e 's/\$/%24/g' \
+ -e 's/\&/%26/g' \
+ -e 's/\*/%2a/g' \
+ -e 's/\./%2e/g' \
+ -e 's/\//%2f/g' \
+ -e 's/\[/%5b/g' \
+ -e 's/\\/%5c/g' \
+ -e 's/\]/%5d/g' \
+ -e 's/\^/%5e/g' \
+ -e 's/_/%5f/g' \
+ -e 's/`/%60/g' \
+ -e 's/{/%7b/g' \
+ -e 's/|/%7c/g' \
+ -e 's/}/%7d/g' \
+ -e 's/~/%7e/g' \
+ ) > /mnt/bytebase-shared-volume/pg_escaped_password
+ volumeMounts:
+ - mountPath: /mnt/bytebase-shared-volume
+ name: bytebase-shared-volume
+ {{- end }}
containers:
- name: bytebase
- {{ if $registryMirrorHost }}
+ {{- if $registryMirrorHost }}
# If user specifies a registry mirror host, we should use that instead of the default.
image: {{ trimSuffix "/" $registryMirrorHost }}/bytebase/bytebase:{{ $version }}
- {{ else }}
+ {{- else }}
image: bytebase/bytebase:{{ $version }}
- {{ end }}
+ {{- end }}
imagePullPolicy: Always
env:
+ {{- if $externalPgExistingPgURLSecret }}
+ # If user specifies an existing secret, we should read the external pg connection string in that secret.
+ - name: PG_URL
+ valueFrom:
+ secretKeyRef:
+ name: {{ $externalPgExistingPgURLSecret }}
+ key: {{ $externalPgExistingPgURLSecretKey }}
+ {{- else if $externalPgURL }}
+ # If user specifies the external pg connection string directly, we should use that.
- name: PG_URL
- {{ if $existingPgURLSecret }}
- # If user specifies an existing secret, we should read the external pg connection string in that secret.
+ value: {{ $externalPgURL }}
+ {{- else }}
+ # Otherwise, we should construct the external pg connection string from the specified parameters.
+ {{- if and $externalPgExistingPgPasswordSecret (not $externalPgEscapePgPassword) }}
+ # If user specifies an existing secret, we should read the external pg password in that secret.
+ - name: PG_PASSWORD
valueFrom:
secretKeyRef:
- name: {{ $existingPgURLSecret }}
- key: {{ $existingPgURLSecretKey }}
- {{ else }}
- value: {{ $pg }}
- {{ end }}
+ name: {{ $externalPgExistingPgPasswordSecret }}
+ key: {{ $externalPgExistingPgPasswordSecretKey }}
+ - name: PG_URL
+ value: postgres://{{ $externalPgUsername }}:$(PG_PASSWORD)@{{ $externalPgHost }}:{{ $externalPgPort }}/{{ $externalPgDatabase }}
+ {{- else }}
+ - name: PG_URL
+ value: postgres://{{ $externalPgUsername }}:{{ $externalPgPassword }}@{{ $externalPgHost }}:{{ $externalPgPort }}/{{ $externalPgDatabase }}
+ {{- end }}
+ {{- end }}
+ command:
+ - /bin/sh
+ - -c
args:
- [
- "--data",
- {{ $data | quote }},
- "--port",
- {{ $port | quote }},
- "--external-url",
- # helm parser cannot handle the dash in the value, so we need to quote it, so we use $external_url instead of $external-url.
- {{ $external_url | quote }},
- {{ if $disable_sample }}
- "--disable-sample",
- {{ end }}
- ]
+ - |
+ {{- if $externalPgEscapePgPassword }}
+ # If user escape the password, we should read the escaped password from the shared volume, and construct the PG_PASSWORD.
+ export PG_URL=postgres://{{ $externalPgUsername }}:$(cat /mnt/bytebase-shared-volume/pg_escaped_password)@{{ $externalPgHost }}:{{ $externalPgPort }}/{{ $externalPgDatabase }}
+ {{- end }}
+ exec bytebase \
+ --data \
+ {{ $data | quote }} \
+ --port \
+ {{ $port | quote }} \
+ --external-url \
+ {{ $external_url | quote }} \
+ {{- if $disable_sample }}
+ --disable-sample
+ {{- end }}
ports:
- containerPort: {{ $port }}
name: web
@@ -70,36 +176,44 @@ spec:
timeoutSeconds: 60
volumeMounts:
- mountPath: {{ $data }}
- {{ if .Values.bytebase.persistence.existingClaim }}
+ {{- if $persistenceExistingClaim }}
# If user specifies an existing PVC, use that instead of "bytebase-volume".
- name: {{ .Values.bytebase.persistence.existingClaim | quote }}
- {{ else }}
+ name: {{ $persistenceExistingClaim | quote }}
+ {{- else }}
# Either user disable persistence or enable persistence but not specify an existing PVC, use "bytebase-volume" as the volume name. It means
# that we will request to create a PVC with the specified storage class with name "bytebase-volume".
name: bytebase-volume
- {{ end }}
+ {{- end }}
+ - mountPath: /mnt/bytebase-shared-volume
+ name: bytebase-shared-volume
+ {{- if gt (len $extraSecretMounts) 0 }}
+ {{- toYaml $extraSecretMounts | nindent 12 }}
+ {{- end }}
volumes:
- {{ if .Values.bytebase.persistence.enabled }}
- {{ if .Values.bytebase.persistence.existingClaim }}
+ {{- if $persistenceEnable }}
+ {{- if $persistenceExistingClaim }}
# If user specifies an existing PVC, use that instead of "bytebase-volume".
- - name: {{ .Values.bytebase.persistence.existingClaim | quote }}
+ - name: {{ $persistenceExistingClaim | quote }}
persistentVolumeClaim:
- claimName: {{ .Values.bytebase.persistence.existingClaim | quote }}
- {{ else }}
+ claimName: {{ $persistenceExistingClaim | quote }}
+ {{- else }}
# If user enable persistence, but not specify an existing PVC, create a PVC with the specified storage class with name "bytebase-volume".
- name: bytebase-volume
persistentVolumeClaim:
claimName: bytebase-volume
- {{ end }}
- {{ else }}
- # If user disable persistence, use an emptyDir volume.
+ {{- end }}
+ {{- else }}
+ # Mount the shared volume.
- name: bytebase-volume
emptyDir: {}
- {{ end }}
-
+ {{- end }}
+ - name: bytebase-shared-volume
+ emptyDir: {}
+ {{- if gt (len $extraVolumes) 0 }}
+ {{- toYaml $extraVolumes | nindent 8 }}
+ {{- end }}
---
-{{ if .Values.bytebase.persistence.enabled }}
-{{ if not .Values.bytebase.persistence.existingClaim }}
+{{- if and $persistenceEnable (not $persistenceExistingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
@@ -108,12 +222,10 @@ metadata:
labels:
{{- include "bytebase.labels" . | nindent 4}}
spec:
- storageClassName: {{ .Values.bytebase.persistence.storageClass | quote }}
+ storageClassName: {{ $persistenceStorageClass | quote }}
accessModes:
- ReadWriteOnce
resources:
requests:
- storage: {{ .Values.bytebase.persistence.storage }}
-{{ end }}
-{{ end }}
-
+ storage: {{ $persistenceStorage }}
+{{- end }}
\ No newline at end of file
diff --git a/helm-charts/bytebase/values.yaml b/helm-charts/bytebase/values.yaml
index 04b59d0fbf..63af7e3ae5 100644
--- a/helm-charts/bytebase/values.yaml
+++ b/helm-charts/bytebase/values.yaml
@@ -3,18 +3,54 @@
# Declare variables to be passed into your templates.
bytebase:
+ version: 2.11.1
+ registryMirrorHost: ""
option:
port: 8080
- existingPgURLSecret: ""
- existingPgURLSecretKey: ""
- pg: postgresql://user:secret@host:port/dbname
- data: /var/opt/bytebase
+ data: "/var/opt/bytebase"
external-url: "https://www.bytebase.com/docs/get-started/install/external-url"
disable-sample: false
- version: 2.5.0
- registryMirrorHost: ""
+ externalPg:
+ url: ""
+ # If users need to read the pgURL from a secret, they can specify the secret name and key here.
+ # Bytebase will ignore the bytebase.option.externalPg.url if this is specified.
+ existingPgURLSecret: ""
+ existingPgURLSecretKey: ""
+ pgHost: "host"
+ pgPort: "port"
+ pgUsername: "username"
+ pgPassword: "password"
+ pgDatabase: "database"
+ existingPgPasswordSecret: ""
+ existingPgPasswordSecretKey: ""
+ # escapePassword controls whether to escape the password in the connection string,
+ # this is useful when the password contains special characters and it is read from a secret.
+ # It's only be applied in pgPassword or existingPgPasswordSecret.
+ # NOTE: This is an experimental feature and it may be removed in the future without any notice!!!
+ escapePassword: false
persistence:
- storage: 2Gi
enabled: false
- storageClass: ""
existingClaim: ""
+ storage: 2Gi
+ storageClass: ""
+
+ # Additional Bytebase secret mounts
+ # Defines additional mounts with secret. Secret must be manually created in the namespace.
+ extraSecretMounts:
+ []
+ # - name: secrets-store-inline
+ # mountPath: "/mnt/secrets-store"
+ # readOnly: true # Only required when using service principal mode
+ # Additional Bytebase Volume, name prefix with "bytebase-" should be avoided.
+ extraVolumes:
+ []
+ # - name: secrets-store-inline
+ # csi:
+ # driver: secrets-store.csi.k8s.io
+ # readOnly: true
+ # volumeAttributes:
+ # secretProviderClass: akv-bytebase-spc
+ # # Only required when using service principal mode
+ # nodePublishSecretRef:
+ # # Only required when using service principal mode, usually is the secret store the service principal's credentials
+ # name: secrets-store-creds