timescale / helm-charts

Configuration and Documentation to run TimescaleDB in your Kubernetes cluster
Apache License 2.0
261 stars 223 forks source link

Custom `readinessProbe` not possible through helm chart values #602

Open v-miguel opened 1 year ago

v-miguel commented 1 year ago

What happened?

I'm trying to deploy promscale on kubernetes with basic auth, using the official helm chart. To do so, I'm defining the following env vars: PROMSCALE_WEB_AUTH_USERNAME and PROMSCALE_WEB_AUTH_PASSWORD.

According with the documentation we need to set a custom readinessProbe. Otherwise, using the default one we will get a 401 error and due to the readiness probe failure, the promscale service will be not accessible.

By applying the suggested custom readinessProbe, by setting httpGet: null an error arises:

Error: values don't meet the specifications of the schema(s) in the following chart(s):
promscale:
- readinessProbe: httpGet is required

This way, is not possible to define a custom readinessProbe through helm chart values.

Did you expect to see something different?

It would be expected that by defining the readinessProbe as the documentation suggests, everything works fine.

readinessProbe:
  httpGet: null
  exec:
    command:
    - sh
    - -c
    - |-
      status_code=$(wget --server-response "http://${PROMSCALE_WEB_AUTH_USERNAME}:${PROMSCALE_WEB_AUTH_PASSWORD}@localhost:9201/healthz" 2>&1 | awk '/^  HTTP/{print $2}');
      if [[ "${status_code}" == "200" ]]; then exit 0; else exit 1; fi

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

By applying helm chart for promscale with the following values file:

extraEnv:
  - name: PROMSCALE_WEB_AUTH_USERNAME
    value: 'user'
  - name: PROMSCALE_WEB_AUTH_PASSWORD
    value: 'password'

readinessProbe:
  httpGet: null
  exec:
    command:
    - sh
    - -c
    - |-
      status_code=$(wget --server-response "http://${PROMSCALE_WEB_AUTH_USERNAME}:${PROMSCALE_WEB_AUTH_PASSWORD}@localhost:9201/healthz" 2>&1 | awk '/^  HTTP/{print $2}');
      if [[ "${status_code}" == "200" ]]; then exit 0; else exit 1; fi

Environment

Helm chart: timescale/promscale from https://charts.timescale.com/

extraEnv:
  - name: PROMSCALE_WEB_AUTH_USERNAME
    value: 'user'
  - name: PROMSCALE_WEB_AUTH_PASSWORD
    value: 'password'

readinessProbe:
  httpGet: null
  exec:
    command:
    - sh
    - -c
    - |-
      status_code=$(wget --server-response "http://${PROMSCALE_WEB_AUTH_USERNAME}:${PROMSCALE_WEB_AUTH_PASSWORD}@localhost:9201/healthz" 2>&1 | awk '/^  HTTP/{print $2}');
      if [[ "${status_code}" == "200" ]]; then exit 0; else exit 1; fi

Anything else we need to know?: