Closed christopheblin closed 3 years ago
If that can help the diagnostic : when I look at the file pool_passwd, it contains the user
% kubectl exec -it pgproxy -- /bin/bash
bash-5.0$ cat /opt/pgpool-II/etc/pool_passwd
user@host:md5xxxx
note : I removed the real values
I had a lok to pgpool source code, the error seems to be that the user in this file is not "matched" from the frontend (but I am 100% sure to use the same username)
I finally used haproxy
apiVersion: v1
kind: ConfigMap
metadata:
name: pgproxy-config
data:
haproxy.cfg: |
global
daemon
maxconn 1
defaults
mode tcp
frontend tcp-in
bind *:5432
default_backend servers
backend servers
server server1 xxx.privatelink.postgres.database.azure.com:5432 maxconn 1
---
apiVersion: v1
kind: Pod
metadata:
name: pgproxy
spec:
containers:
- name: pgpool
image: haproxytech/haproxy-alpine
volumeMounts:
- name: config-volume
mountPath: /usr/local/etc/haproxy/
volumes:
- name: config-volume
configMap:
name: pgproxy-config
---
I try to create a pod in k8s to be able to port-forward it to my machine (in order to reach the db which is NOT opened on the internet but only reachable through k8s)
The pod is starting correctly and the port-forward 9999 is also working correctly
However, when I try to use localhost:9999 with the same username and password, the pgpool logs indicate
I double-checked the username and password are correct by connecting to the pod through another docker:
I also checked that the psql command works from the pgproxy pod itself
So basically, I think there is a problem with my env vars to provide the password to pgpool, but I do not understand what I should do ...