Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Manan-Kothari
Copy link

@Manan-Kothari Manan-Kothari commented May 22, 2024

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.]

  • PR is based off the current tip of the main branch.
  • Changes are documented under the "Unreleased" header in CHANGELOG.md
  • New or modified sections of values.yaml are documented in the README.md
  • Commits follow the Kong commit message guidelines

@Manan-Kothari Manan-Kothari requested a review from a team as a code owner May 22, 2024 18:12
@CLAassistant
Copy link

CLAassistant commented May 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Manan-Kothari
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate handler when overriding readiness/liveness probes
3 participants