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

feat(helm): configure MIW Helm chart to use pgadmin4 subchart #189

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/chart-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
with:
image: jnorwood/helm-docs:v1.11.3
options: -v ${{ github.workspace }}/charts:/helm-docs
run: helm-docs
run: helm-docs -i managed-identity-wallet/.helmdocsignore

- name: Verify that no changes are required
run: |
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:

- name: Install Helm unittest plugin
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git
helm plugin install https://github.com/helm-unittest/helm-unittest.git --version 0.3.5

- name: Run Helm unittests
run: task helm:unittest
Expand Down
1 change: 1 addition & 0 deletions charts/managed-identity-wallet/.helmdocsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/
2 changes: 1 addition & 1 deletion charts/managed-identity-wallet/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
tests/
values-*.yaml
README.md.gotmpl
.helmdocsignore
ci/
argocd/
9 changes: 6 additions & 3 deletions charts/managed-identity-wallet/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ dependencies:
version: 15.1.6
- name: common
repository: https://charts.bitnami.com/bitnami
version: 2.8.0
version: 2.13.3
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.9.13
digest: sha256:4ec5952d86e68eb97bc393404e52e5a7371eed72d769440d1fa549c8db8b4a3b
generated: "2023-08-21T23:08:36.120845+02:00"
- name: pgadmin4
repository: file://charts/pgadmin4
version: 1.19.0
digest: sha256:30c1e41f2c5f35829f68dd52ecc80005b4edf726d9e472801f6bfb834b8be512
generated: "2023-11-22T12:12:48.461495+01:00"
5 changes: 5 additions & 0 deletions charts/managed-identity-wallet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ dependencies:
version: 11.9.13
repository: https://charts.bitnami.com/bitnami
condition: postgresql.internal.enabled
- name: pgadmin4
repository: file://charts/pgadmin4 # https://helm.runix.net
# License: https://github.com/rowanruseler/helm-charts/blob/main/LICENSE
version: 1.19.0
condition: pgadmin4.enabled
6 changes: 6 additions & 0 deletions charts/managed-identity-wallet/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "managed-identity-wallet.pgadminServerDefinitions" -}}
{
"Servers": {{ .Values.pgadmin4.extraServerDefinitions.servers | toJson }}
}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# /********************************************************************************
# * Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License, Version 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0.
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# * License for the specific language governing permissions and limitations
# * under the License.
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

{{- if and .Values.pgadmin4.enabled .Values.pgadmin4.extraServerDefinitions.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-pgadmin4-server-definitions
labels:
{{- include "pgadmin.labels" . | nindent 4 }}
data:
servers.json: |-
{{- include "common.tplvalues.render" (dict "value" (include "managed-identity-wallet.pgadminServerDefinitions" .) "context" $) | nindent 4 }}
{{- end }}
45 changes: 44 additions & 1 deletion charts/managed-identity-wallet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ secrets: {}
envs: {}

serviceAccount:
# -- Enable creation of ServiceAccount
# -- Enable creation of ServiceAccount
create: true
# -- Annotations to add to the ServiceAccount
annotations: {}
Expand Down Expand Up @@ -259,3 +259,46 @@ postgresql:
resourcePolicy: "keep"
# -- PVC Storage Request for the backup data volume
size: "8Gi"

# For more information on how to configure the pgadmin chart see https://artifacthub.io/packages/helm/runix/pgadmin4.
pgadmin4:
# -- Enable to deploy pgAdmin
enabled: false
env:
# -- Preset the admin user email
email: [email protected]
# -- preset password (there is no auto-generated password)
password: very-secret-password
# @ignore
variables:
- name: PGADMIN_SERVER_JSON_FILE
value: /pgadmin4/servers.json
ingress:
# -- Enagle pgAdmin ingress
enabled: false
annotations: {}
# -- See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L104) how to configure the ingress host(s)
hosts: []
# -- See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L109) how to configure tls for the ingress host(s)
tls: []
extraServerDefinitions:
# -- enable the predefined server for pgadmin
enabled: true
# -- See [here](https://github.com/rowanruseler/helm-charts/blob/9b970b2e419c2300dfbb3f827a985157098a0287/charts/pgadmin4/values.yaml#L84) how to configure the predefined servers
servers:
# @ignore
miw-internal-postgresql:
Name: "MIW internal Postgresql DB"
Group: "Servers"
Port: 5432
Username: "miw"
Host: "{{ .Release.Name }}-postgresql"
SSLMode: "prefer"
MaintenanceDB: "postgres"
# @ignore
extraConfigmapMounts:
- name: server-definitions
configMap: "{{ .Release.Name }}-pgadmin4-server-definitions"
subPath: servers.json
mountPath: "/pgadmin4/servers.json"
readOnly: true
2 changes: 1 addition & 1 deletion dev-assets/tasks/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ tasks:
desc: Rebuilds the readme of the Helm chart
dir: charts/managed-identity-wallet
cmds:
- helm-docs .
- helm-docs -i charts/managed-identity-wallet/.helmdocsignore .
Loading