Skip to content

Commit 2df2176

Browse files
voorconzettiFrancisco de Paz Galán
authored
[bitnami/harbor] Feature/external db url secret (#4736)
* [bitnami/harbor] Define external psql endpoint via secret, set sslmode TL;DR ===== - Allow Postgres endpoints to be defined via environment secretKeyRef - Disable SSL by default (no longer `nil`) for external database connections Detail ====== This change allows you to define the Postgres endpoint as a secret value, rather than providing passwords in raw values files. A new secret template is created for notary to introduce relevant environment variables for the notary service. Additionally, the default configuration for `externalDatabase.sslmode` was configured as `nil`. This change explicitly sets `disable` for both `values.yaml` and `values-production.yaml`. Chart version received a patch version bump. This _could_ potentially be seen as a minor version bump, depending on your interpretation of semantic versioning. Co-authored-by: Robert Van Voorhees <rvanvoorhees@vmware.com> * Bump chart version. * Update bitnami/harbor/Chart.yaml Co-authored-by: Francisco de Paz Galán <fdepaz@vmware.com> * Update bitnami/harbor/templates/notary/notary-secret-envvars.yaml Co-authored-by: Francisco de Paz Galán <fdepaz@vmware.com> * Need this for all values since it's referencing the data file not stringdata now. Co-authored-by: conzetti <conzetti@gmail.com> Co-authored-by: Francisco de Paz Galán <fdepaz@vmware.com>
1 parent 2cd3ec6 commit 2df2176

File tree

8 files changed

+34
-7
lines changed

8 files changed

+34
-7
lines changed

bitnami/harbor/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ sources:
3434
- https://github.com/bitnami/bitnami-docker-harbor-registry
3535
- https://github.com/bitnami/bitnami-docker-harbor-registryctl
3636
- https://goharbor.io/
37-
version: 9.1.2
37+
version: 9.2.0

bitnami/harbor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ The following tables list the configurable parameters of the Harbor chart and th
712712
| `externalDatabase.notarySignerDatabase` | External database name for notary signer | `nil` |
713713
| `externalDatabase.notarySignerUsername` | External database username for notary signer | `nil` |
714714
| `externalDatabase.notarySignerPassword` | External database password for notary signer | `nil` |
715-
| `externalDatabase.sslmode` | External database ssl mode | `nil` |
715+
| `externalDatabase.sslmode` | External database ssl mode | `disable` |
716716

717717
### Redis Parameters
718718

bitnami/harbor/templates/clair/clair-dpl.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ spec:
202202
- name: SCANNER_STORE_REDIS_URL
203203
value: {{ include "harbor.redisForClairAdapter" . }}
204204
- name: SCANNER_CLAIR_DATABASE_URL
205-
value: {{ include "harbor.database.clair" . }}
205+
valueFrom:
206+
secretKeyRef:
207+
name: {{ template "harbor.clair" . }}
208+
key: database
206209
{{- if .Values.internalTLS.enabled }}
207210
- name: INTERNAL_TLS_ENABLED
208211
value: "true"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- if .Values.notary.enabled }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "harbor.notary-server" . }}-envvars
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
9+
{{- end }}
10+
app.kubernetes.io/component: notary
11+
{{- if .Values.commonAnnotations }}
12+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
13+
{{- end }}
14+
type: Opaque
15+
data:
16+
server_db_url: {{ include "harbor.database.notaryServer" . | b64enc | quote }}
17+
signer_db_url: {{ include "harbor.database.notarySigner" . | b64enc | quote }}
18+
{{- end }}

bitnami/harbor/templates/notary/notary-server.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ spec:
8585
- name: MIGRATIONS_PATH
8686
value: migrations/server/postgresql
8787
- name: DB_URL
88-
value: {{ include "harbor.database.notaryServer" . }}
88+
valueFrom:
89+
secretKeyRef:
90+
name: {{ include "harbor.notary-server" . }}-envvars
91+
key: server_db_url
8992
{{- if .Values.notary.server.extraEnvVars }}
9093
{{- include "common.tplvalues.render" (dict "value" .Values.notary.server.extraEnvVars "context" $) | nindent 12 }}
9194
{{- end }}

bitnami/harbor/templates/notary/notary-signer.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ spec:
8484
- name: MIGRATIONS_PATH
8585
value: migrations/signer/postgresql
8686
- name: DB_URL
87-
value: {{ include "harbor.database.notarySigner" . | quote }}
87+
valueFrom:
88+
secretKeyRef:
89+
name: {{ include "harbor.notary-server" . }}-envvars
90+
key: signer_db_url
8891
- name: NOTARY_SIGNER_DEFAULTALIAS
8992
value: defaultalias
9093
{{- if .Values.notary.signer.extraEnvVars }}

bitnami/harbor/values-production.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@ externalDatabase:
27032703
port: 5432
27042704
## External database ssl mode
27052705
##
2706-
sslmode:
2706+
sslmode: disable
27072707
## External database name for core
27082708
##
27092709
coreDatabase:

bitnami/harbor/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ externalDatabase:
27022702
port: 5432
27032703
## External database ssl mode
27042704
##
2705-
sslmode:
2705+
sslmode: disable
27062706
## External database name for core
27072707
##
27082708
coreDatabase:

0 commit comments

Comments
 (0)