Closed kleberbaum closed 3 months ago
In your values.yaml for the chart:
serverDefinitions:
## If true, server definitions will be created
##
enabled: true
## The resource type to use for deploying server definitions.
## Can either be ConfigMap or Secret
resourceType: ConfigMap
servers:
server1:
Name: "Your Server Name"
Group: "Your Server Group"
Host: "postgresql"
Port: 5432
Username: "postgres"
MaintenanceDB: "postgres"
Shared: true
ConnectionParameters:
passfile: "../../file.pgpass"
extraSecretMounts:
- name: pgpassfile
secret: pgadmin-pgpassfile-secret
mountPath: "/tmp/file.pgpass"
subPath: pgpassfile
## Additional InitContainers to initialize the pod
##
extraInitContainers: |
- name: prepare-pgpass
image: busybox:latest
imagePullPolicy: Always
command:
- /bin/sh
- -c
- |
cp /tmp/file.pgpass /var/lib/pgadmin/file.pgpass
chown 5050:5050 /var/lib/pgadmin/file.pgpass
chmod 600 /var/lib/pgadmin/file.pgpass
volumeMounts:
- name: pgadmin-data
mountPath: /var/lib/pgadmin
- name: pgpassfile
mountPath: /tmp/file.pgpass
subPath: pgpassfile
securityContext:
runAsUser: 0
In Kubernetes secret YAML:
apiVersion: v1
kind: Secret
metadata:
name: pgadmin-pgpassfile-secret
type: Opaque
stringData:
pgpassfile: |
postgresql:5432:*:postgres:postgres
You can add more servers to the list, plus more hostnames to pgpassfile (one hostname per line) if needed.
Thank you very much @ViliusS. What chart and pgAdmin version are you using?
I'm using 1.18.x something, but this should work with latest version too.
Is your feature request related to a problem? Please describe. As a new user of this Helm chart, deploying a working configuration has been challenging. I would greatly appreciate a working
pgpass
example includingserverDefinitions
even if it's considered hackish.It would be helpful to mention the chart and pgAdmin version as well, given the related Issue #193.
Describe the solution you'd like P. S. pgpass solution in examples folder doesn't work by the way. I have a working copy inspired by https://github.com/rowanruseler/helm-charts/issues/72#issuecomment-1002300143 If you think hackish example is useful, I can provide it in a separate PR too.
Originally posted by @ViliusS in https://github.com/rowanruseler/helm-charts/issues/202#issuecomment-1531427929
Additional context My goal is to deploy pgAdmin with pre-configured databases (json) available to all users like #115. I'm open to using older versions of pgAdmin or the chart if needed.