Обсуждение: Error in passing the password in servers.json file while deploying pgadmin4 in kubernetes cluster

Поиск
Список
Период
Сортировка

Error in passing the password in servers.json file while deploying pgadmin4 in kubernetes cluster

От
Samrat Gurung
Дата:

deployment.yaml file

containers:
- image: postgres:8.4
env:
- name: PFADMIN_SERVER_JSON_FILE
value: /pgadmin4/servers.json
volumeMounts:
- name: server-config
mountPath: /pgadmin4/servers.json
subPath: servers.json
- name: password-config
mountPath: /var/lib/storage/pgpass
subPath: pgpass
volumes:
- name: password-config
configMap:
name: pgad-password-config
- name: pgad-server-config
configMap:
name: server-config

configmap for servers.json
kind: ConfigMap
apiVersion: v1
metadata:
name: pgad-server-config
data:
servers.json: |
{
"Servers": {
"1": {
"Name": "My Postgres Server",
"Group": "Servers",
"Host": "host.docker.internal",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"PassFile": "/var/lib/storage/pgpass",
"SSLMode": "prefer",
"ConnectionTimeout":10,
"SavePassword": true,
}
}
}

configmap for pgpass
kind: ConfigMap
apiVersion: v1
metadata:
name: password-config
data:
pgpass: |
hostname:port:database:username:password

The issue is when i log in to the postgres, i can see the server but it is prompting me to enter the password so it is not able to read the one i supplied.

i get this error in the UI: connection failed: fe_sendauth: no password supplied


Re: Error in passing the password in servers.json file while deploying pgadmin4 in kubernetes cluster

От
Aditya Toshniwal
Дата:
Hi Samrat,

I found this on searching on internet - https://stackoverflow.com/a/69475874

On Fri, Mar 15, 2024 at 11:01 PM Samrat Gurung <grgsamrat785@gmail.com> wrote:

deployment.yaml file

containers:
- image: postgres:8.4
env:
- name: PFADMIN_SERVER_JSON_FILE
value: /pgadmin4/servers.json
volumeMounts:
- name: server-config
mountPath: /pgadmin4/servers.json
subPath: servers.json
- name: password-config
mountPath: /var/lib/storage/pgpass
subPath: pgpass
volumes:
- name: password-config
configMap:
name: pgad-password-config
- name: pgad-server-config
configMap:
name: server-config

configmap for servers.json
kind: ConfigMap
apiVersion: v1
metadata:
name: pgad-server-config
data:
servers.json: |
{
"Servers": {
"1": {
"Name": "My Postgres Server",
"Group": "Servers",
"Host": "host.docker.internal",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"PassFile": "/var/lib/storage/pgpass",
"SSLMode": "prefer",
"ConnectionTimeout":10,
"SavePassword": true,
}
}
}

configmap for pgpass
kind: ConfigMap
apiVersion: v1
metadata:
name: password-config
data:
pgpass: |
hostname:port:database:username:password

The issue is when i log in to the postgres, i can see the server but it is prompting me to enter the password so it is not able to read the one i supplied.

i get this error in the UI: connection failed: fe_sendauth: no password supplied




--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Architect | enterprisedb.com
"Don't Complain about Heat, Plant a TREE"