From 22b8dec7257fed6323c36eefb2d1191db6163408 Mon Sep 17 00:00:00 2001 From: Alexandre Nuttinck Date: Fri, 30 Aug 2019 10:46:39 +0200 Subject: [PATCH] Squashed commit of the following: commit 0ad857662c1282290366ec4e1741575fb9b722bf Author: Alexandre Nuttinck Date: Fri Aug 30 10:45:49 2019 +0200 feature mount servers.json #4 --- Chart.yaml | 4 ++-- README.md | 7 +++++-- templates/configmap.yaml | 15 +++++++++++++++ templates/deployment.yaml | 16 +++++++++++++++- values.yaml | 17 ++++++++++++++++- 5 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 templates/configmap.yaml diff --git a/Chart.yaml b/Chart.yaml index ba3d0fa..d38417c 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,6 +1,6 @@ name: pgadmin -version: 0.1.8 -appVersion: 4.11.0 +version: 0.1.9 +appVersion: 4.12.0 description: pgAdmin is a web based administration tool for the PostgreSQL database. keywords: - pgadmin diff --git a/README.md b/README.md index a4f2b53..8662e58 100644 --- a/README.md +++ b/README.md @@ -87,10 +87,13 @@ The following table lists the configurable parameters of the pgAdmin chart and t | `ingress.path` | Path to access frontend | `/` | | `ingress.hosts` | Ingress hosts | `[]` | | `ingress.tls` | Ingress TLS configuration | `[]` | +| **Servers** | +| `servers.enabled` | Enable the servers configuration. If enabled, server definitions found in `servers.config` will be loaded at launch time.| `true` | +| `servers.config` | Server definitions | `See the values.yaml` | | **ReadinessProbe** | -| `readinessProbe` | Rediness Probe settings | `nil` | +| `readinessProbe` | Rediness Probe settings | `nil` | | **LivenessProbe** | -| `livenessProbe` | Liveness Probe settings | `nil`| +| `livenessProbe` | Liveness Probe settings | `nil` | | **Resources** | | `resources` | CPU/Memory resource requests/limits | `{}` | diff --git a/templates/configmap.yaml b/templates/configmap.yaml new file mode 100644 index 0000000..4a93b7d --- /dev/null +++ b/templates/configmap.yaml @@ -0,0 +1,15 @@ +--- +{{- if .Values.servers.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "pgadmin.fullname" . }} + labels: + app: {{ template "pgadmin.name" . }} + chart: {{ template "pgadmin.chart" . }} + release: {{ .Release.Name | quote }} + heritage: {{ .Release.Service | quote }} +data: + servers.json: |- +{{ toJson .Values.servers.config | indent 4 }} +{{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index a5b85cd..f4eba64 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -1,3 +1,4 @@ +--- apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -48,13 +49,18 @@ spec: - name: pgadmin-data mountPath: /var/lib/pgadmin {{- if .Values.pgadmin.tls }} - - namegedit : tls-cert + - name: tls-cert mountPath: /certs/server.cert subPath: server.cert - name: tls-private-key mountPath: /certs/server.key subPath: server.key {{- end }} + {{- if .Values.servers.enabled }} + - name: servers-config + mountPath: /pgadmin4/servers.json + subPath: servers.json + {{- end}} resources: {{ toYaml .Values.resources | indent 12 }} livenessProbe: @@ -83,6 +89,14 @@ spec: - key: server.cert path: server.cert {{- end }} + {{- if .Values.servers.enabled }} + - name: servers-config + configMap: + name: {{ template "pgadmin.fullname" . }} + items: + - key: servers.json + path: servers.json + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/values.yaml b/values.yaml index 3ab2ec1..022c56a 100644 --- a/values.yaml +++ b/values.yaml @@ -3,7 +3,7 @@ ## image: repository: dpage/pgadmin4 - tag: 4.11 + tag: 4.12 pullPolicy: IfNotPresent pgadmin: @@ -71,6 +71,21 @@ ingress: hosts: [] tls: [] +## Configure servers.json: https://www.pgadmin.org/docs/pgadmin4/latest/import_export_servers.html +## +servers: + enabled: false + config: + Servers: + 1: + Name: "Test" + Group: "Server Group 1" + Port: 5432 + Username: "postgres" + Host: "postgres" + SSLMode: "prefer" + MaintenanceDB: "postgres" + ## Configure liveness and readiness probes ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ ##