Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit fc2f211

Browse files
committed
feat(helm): configure MIW Helm chart to use pgadmin4 subchart
1 parent d6e2472 commit fc2f211

File tree

8 files changed

+102
-5
lines changed

8 files changed

+102
-5
lines changed

charts/managed-identity-wallet/.helmignore

-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ values-*.yaml
2626
README.md.gotmpl
2727
.helmdocsignore
2828
ci/
29-
charts/pgadmin4

charts/managed-identity-wallet/Chart.lock

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@ dependencies:
88
- name: postgresql
99
repository: https://charts.bitnami.com/bitnami
1010
version: 11.9.13
11-
digest: sha256:d26187a3896751774a3c7646c6a12186aae20fbde5a705ca458c1aeac9bf361c
12-
generated: "2023-12-11T11:38:02.235024+01:00"
11+
- name: pgadmin4
12+
repository: file://charts/pgadmin4
13+
version: 1.19.0
14+
digest: sha256:30c1e41f2c5f35829f68dd52ecc80005b4edf726d9e472801f6bfb834b8be512
15+
generated: "2023-11-22T12:12:48.461495+01:00"

charts/managed-identity-wallet/Chart.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ dependencies:
5858
version: 11.9.13
5959
repository: https://charts.bitnami.com/bitnami
6060
condition: postgresql.internal.enabled
61+
- name: pgadmin4
62+
repository: file://charts/pgadmin4 # https://helm.runix.net
63+
# License: https://github.com/rowanruseler/helm-charts/blob/main/LICENSE
64+
version: 1.19.0
65+
condition: pgadmin4.enabled

charts/managed-identity-wallet/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command document
7777

7878
| Repository | Name | Version |
7979
|------------|------|---------|
80+
| file://charts/pgadmin4 | pgadmin4 | 1.19.0 |
8081
| https://charts.bitnami.com/bitnami | common | 2.x.x |
8182
| https://charts.bitnami.com/bitnami | keycloak | 15.1.6 |
8283
| https://charts.bitnami.com/bitnami | postgresql | 11.9.13 |
@@ -142,6 +143,15 @@ See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command document
142143
| miw.ssi.vcExpiryDate | string | `""` | Verifiable Credential expiry date. Format 'dd-MM-yyyy'. If empty it is set to 31-12-<current year> |
143144
| nameOverride | string | `""` | String to partially override common.names.fullname template (will maintain the release name) |
144145
| nodeSelector | object | `{"kubernetes.io/os":"linux"}` | NodeSelector configuration |
146+
| pgadmin4.enabled | bool | `true` | Enable to deploy pgAdmin |
147+
| pgadmin4.env.email | string | `"[email protected]"` | Preset the admin user email |
148+
| pgadmin4.env.password | string | `"very-secret-password"` | preset password (there is no auto-generated password) |
149+
| pgadmin4.extraServerDefinitions.enabled | bool | `true` | enable the predefined server for pgadmin |
150+
| pgadmin4.extraServerDefinitions.servers | object | `{}` | See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L84) how to configure the predefined servers |
151+
| pgadmin4.ingress.annotations | object | `{}` | |
152+
| pgadmin4.ingress.enabled | bool | `false` | Enagle pgAdmin ingress |
153+
| pgadmin4.ingress.hosts | list | `[]` | See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L104) how to configure the ingress host(s) |
154+
| pgadmin4.ingress.tls | list | `[]` | See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L109) how to configure tls for the ingress host(s) |
145155
| podAnnotations | object | `{}` | PodAnnotation configuration |
146156
| podSecurityContext | object | `{}` | PodSecurityContext |
147157
| postgresql.auth.database | string | `"miw_app"` | Postgresql database to create |

charts/managed-identity-wallet/templates/_helpers.tpl

+6
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ Create the name of the service account to use
7979
{{- default "default" .Values.serviceAccount.name }}
8080
{{- end }}
8181
{{- end }}
82+
83+
{{- define "managed-identity-wallet.pgadminServerDefinitions" -}}
84+
{
85+
"Servers": {{ .Values.pgadmin4.extraServerDefinitions.servers | toJson }}
86+
}
87+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# /********************************************************************************
2+
# * Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
3+
# *
4+
# * See the NOTICE file(s) distributed with this work for additional
5+
# * information regarding copyright ownership.
6+
# *
7+
# * This program and the accompanying materials are made available under the
8+
# * terms of the Apache License, Version 2.0 which is available at
9+
# * https://www.apache.org/licenses/LICENSE-2.0.
10+
# *
11+
# * Unless required by applicable law or agreed to in writing, software
12+
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# * License for the specific language governing permissions and limitations
15+
# * under the License.
16+
# *
17+
# * SPDX-License-Identifier: Apache-2.0
18+
# ********************************************************************************/
19+
20+
{{- if and .Values.pgadmin4.enabled .Values.pgadmin4.extraServerDefinitions.enabled }}
21+
apiVersion: v1
22+
kind: ConfigMap
23+
metadata:
24+
name: {{ .Release.Name }}-pgadmin4-server-definitions
25+
labels:
26+
{{- include "pgadmin.labels" . | nindent 4 }}
27+
data:
28+
servers.json: |-
29+
{{- include "common.tplvalues.render" (dict "value" (include "managed-identity-wallet.pgadminServerDefinitions" .) "context" $) | nindent 4 }}
30+
{{- end }}

charts/managed-identity-wallet/values.yaml

+45-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ secrets: {}
4141
envs: {}
4242

4343
serviceAccount:
44-
# -- Enable creation of ServiceAccount
44+
# -- Enable creation of ServiceAccount
4545
create: true
4646
# -- Annotations to add to the ServiceAccount
4747
annotations: {}
@@ -259,3 +259,47 @@ postgresql:
259259
resourcePolicy: "keep"
260260
# -- PVC Storage Request for the backup data volume
261261
size: "8Gi"
262+
263+
# For more information on how to configure the pgadmin chart see https://artifacthub.io/packages/helm/runix/pgadmin4.
264+
# (Here we're using a stripped-down version of the pgadmin chart, to just )
265+
pgadmin4:
266+
# -- Enable to deploy pgAdmin
267+
enabled: true
268+
env:
269+
# -- Preset the admin user email
270+
271+
# -- preset password (there is no auto-generated password)
272+
password: very-secret-password
273+
# @ignore
274+
variables:
275+
- name: PGADMIN_SERVER_JSON_FILE
276+
value: /pgadmin4/servers.json
277+
ingress:
278+
# -- Enagle pgAdmin ingress
279+
enabled: false
280+
annotations: {}
281+
# -- See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L104) how to configure the ingress host(s)
282+
hosts: []
283+
# -- See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L109) how to configure tls for the ingress host(s)
284+
tls: []
285+
extraServerDefinitions:
286+
# -- enable the predefined server for pgadmin
287+
enabled: true
288+
# -- See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L84) how to configure the predefined servers
289+
servers:
290+
# @ignore
291+
miw-internal-postgresql:
292+
Name: "MIW internal Postgresql DB"
293+
Group: "Servers"
294+
Port: 5432
295+
Username: "miw"
296+
Host: "{{ .Release.Name }}-postgresql"
297+
SSLMode: "prefer"
298+
MaintenanceDB: "postgres"
299+
# @ignore
300+
extraConfigmapMounts:
301+
- name: server-definitions
302+
configMap: "{{ .Release.Name }}-pgadmin4-server-definitions"
303+
subPath: servers.json
304+
mountPath: "/pgadmin4/servers.json"
305+
readOnly: true

dev-assets/tasks/helm.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ tasks:
3030
desc: Rebuilds the readme of the Helm chart
3131
dir: charts/managed-identity-wallet
3232
cmds:
33-
- helm-docs .
33+
- helm-docs -i charts/managed-identity-wallet/.helmdocsignore .

0 commit comments

Comments
 (0)