Kong / charts

Helm chart for Kong
Apache License 2.0
237 stars 473 forks source link

fix(probes) allows overriding the default liveness/readiness probe with custom commands #1070

Open Manan-Kothari opened 1 month ago

Manan-Kothari commented 1 month ago

What this PR does / why we need it:

This allows folks to override the liveness/readiness probe with a custom exec/command instead of defaulting to the httpGet. Keeps the existing behavior as default so no breaking changes.

Which issue this PR fixes

Special notes for your reviewer:

example values with execGet

helm template . --values values.yaml

values.yaml

# readinessProbe for Kong pods
# replace httpGet with exec if you want to use a custom command
readinessProbe:
  exec:
    command:
      - python3.10
      - /home/kong/scripts/readiness_probe.py
  initialDelaySeconds: 5
  timeoutSeconds: 5
  periodSeconds: 10
  successThreshold: 1
  failureThreshold: 3

# livenessProbe for Kong pods
# replace httpGet with exec if you want to use a custom command
livenessProbe:
  exec:
    command:
      - python3.10
      - /home/kong/scripts/readiness_probe.py
  initialDelaySeconds: 5
  timeoutSeconds: 5
  periodSeconds: 10
  successThreshold: 1
  failureThreshold: 3

rendered out manifest

        readinessProbe:
          exec:
          command:
          - python3.10
          - /home/kong/scripts/readiness_probe.py
          initialDelaySeconds: 5
          timeoutSeconds: 5
          periodSeconds: 10
          successThreshold: 1
          failureThreshold: 3
        livenessProbe:
          exec:
          command:
          - python3.10
          - /home/kong/scripts/readiness_probe.py
          initialDelaySeconds: 5
          timeoutSeconds: 5
          periodSeconds: 10
          successThreshold: 1
          failureThreshold: 3

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

Manan-Kothari commented 1 month ago

Thanks for the PR. Do you mind adding a CI values.yaml that could test this? You can add this in here: https://github.com/Kong/charts/tree/main/charts/kong/ci

Updated tests, and also updated PR description with the example rendered manifest.