sorintlab / stolon

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

cannot set STKEEPER_PG_LISTEN_ADDRESS to * #802

Closed samene closed 4 years ago

samene commented 4 years ago

What happened: I am deploying the stolon helm chart with istio proxy sidecar injection enabled. As per istio documentation here we need to set the listen address to so that clients can connect to the database. To do that I set the environment variable ```STKEEPER_PG_LISTEN_ADDRESS ``` The keeper however still continues to listen to the $POD_IP.

    Ports:         8080/TCP, 5432/TCP
    Host Ports:    0/TCP, 0/TCP
    Command:
      /bin/bash
      -ec
      # Generate our keeper uid using the pod index
      IFS='-' read -ra ADDR <<< "$(hostname)"
      export STKEEPER_UID="keeper${ADDR[-1]}"
      export POD_IP=$(hostname -i)
      export STKEEPER_PG_LISTEN_ADDRESS=$POD_IP
      export STOLON_DATA=/stolon-data
      chown stolon:stolon $STOLON_DATA
      exec gosu stolon stolon-keeper --data-dir $STOLON_DATA

    State:          Running
      Started:      Wed, 14 Oct 2020 16:26:12 +0530
    Ready:          True
    Restart Count:  0
    Environment:
      POD_NAME:                         empirix-stolon-keeper-0 (v1:metadata.name)
      STKEEPER_CLUSTER_NAME:            empirix-stolon
      STKEEPER_STORE_BACKEND:           kubernetes
      STKEEPER_KUBE_RESOURCE_KIND:      configmap
      STKEEPER_PG_REPL_USERNAME:        <set to the key 'pg_repl_username' in secret 'db-replica'>  Optional: false
      STKEEPER_PG_REPL_PASSWORDFILE:    /etc/secrets/stolon-db-replica/pg_repl_password
      STKEEPER_PG_SU_USERNAME:          <set to the key 'pg_su_username' in secret 'db-admin'>  Optional: false
      STKEEPER_PG_SU_PASSWORDFILE:      /etc/secrets/stolon-db-admin/pg_su_password
      STKEEPER_METRICS_LISTEN_ADDRESS:  0.0.0.0:8080
      STKEEPER_DEBUG:                   false
      STKEEPER_PG_LISTEN_ADDRESS:       *
    Mounts:
      /etc/secrets/stolon-db-admin from stolon-secret-db-admin (rw)
      /etc/secrets/stolon-db-replica from stolon-secret-db-replica (rw)
      /stolon-data from data (rw)

What you expected to happen: Setting the STKEEPER_PG_LISTEN_ADDRESS to * should be honoured and not be overwritten by the command

Without this working the database cannot work with istio sidecar injection enabled.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

samene commented 4 years ago

sorry wrong place to open defect. will open with the helm chart project.