helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[ISSUE] Database On Alternate Port Does Not Work

Open mikeln opened this issue 3 years ago • 2 comments

Have a look at Troubleshooting or some Common Issues

Describe the bug Running the database on a port different than the default postgres port will not start.

To Reproduce test 1:

  1. change port in values from 5432 to 5434. load balancer: false

test 2:

  1. Update instances of 5432 to 5434 (and optionally 6432 to 6434) in the values.yaml
  2. Update values.schema.yaml and all yaml with the same values in templates/ directory.

Deploy the chart.

Pod fails to start due to pg_isready checking the wrong port for readiness

Expected behavior Database starts up and is accessible on the alternate port (5434).

Additional context

The fix: add - --port=<port number>to pg_isready args in templates/statefulset-timescaledb.yaml

This whole setup should be easier to change the port value in values.yaml and have it propagate to all configuration items that are relevant.

Currently more than just the values.yaml has to be edited, which then requires creating a local version of the chart, which then opens up a maintenance error potential of version skew with the original chart.

mikeln avatar Apr 08 '21 21:04 mikeln

Could you provide some more information, including the full values.yaml?

This is because port can be specified at different levels. This Chart does not support changing the Port of the PostgreSQL instance, however it does support changing the Port of the service.

feikesteenbergen avatar Apr 12 '21 12:04 feikesteenbergen

I probably should have opened an issue and a feature request.

The issue:

  1. original values.yaml with the following changes:
  • loadBalancer.enabled: false
  • loadBalancer.port: 5434
  • replicaLoadBalancer.enabled: false
  • replicaLoadBalancer.port: 5434
  1. install chart
  2. headless service is present on 5434, postgres server on 5432
  3. postgres pod fails to get to Ready. Error is readiness probe could not find postgres. Appeared that the pg_isready() looks at the kubernetes service address/port vs the pod's port. Adding '--port=5434' to pg_isready() fixed the error.

mikeln avatar Apr 12 '21 16:04 mikeln