sorintlab / stolon

PostgreSQL cloud native High Availability and more.
https://talk.stolon.io
Apache License 2.0
4.66k stars 447 forks source link

stolon not working when istio sidecar injected #779

Closed elkh510 closed 4 years ago

elkh510 commented 4 years ago

What happened: if istio sidecar injection enabled, unable to connect to stolon:

psql --host stolon-proxy -U stolon -d postgres -p 5432
psql: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

What you expected to happen: normal connecting to stolon How to reproduce it (as minimally and precisely as possible): 1) deploy istio 1.5.1 2) create namespace (exemple - stolon) 3) enable istio-injection (kubectl label namespace stolon istio-injection=enabled) 4) deploy stolon by helm chart 5) deploy pod with stolon client and try to connect to stolon server

Anything else we need to know?: tryed same configuration with postgres helm chart (without stolon) all work as expected

Environment:

sgotti commented 4 years ago

duplicate of #769

elkh510 commented 3 years ago

problem resolves by adding this parameter --pg-advertise-port string postgresql instance port from outside. Use it to expose port different than local port with a PAT networking config https://github.com/sorintlab/stolon/blob/master/doc/commands/stolon-keeper.md