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

feat: Implement livenessProbe variables and readinessProbe variables in helm chart #2906

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stefanandres
Copy link

It's sometimes needed to configure certain timeouts. This PR makes all the settings available as helm variables.

Copy link

netlify bot commented Nov 7, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 01408d7
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/672c92e78e3f0f0008113a5f
😎 Deploy Preview https://deploy-preview-2906.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stefanandres stefanandres force-pushed the probe-variable branch 4 times, most recently from 959aa1b to c468b6f Compare November 7, 2024 09:51
@stefanandres stefanandres changed the title Implement livenessProbe variables and readinessProbe variables feat: Implement livenessProbe variables and readinessProbe variables Nov 7, 2024
@stefanandres stefanandres changed the title feat: Implement livenessProbe variables and readinessProbe variables feat: Implement livenessProbe variables and readinessProbe variables in helm chart Nov 7, 2024
@stefanandres stefanandres marked this pull request as ready for review November 7, 2024 09:58
@stefanandres stefanandres requested a review from a team as a code owner November 7, 2024 09:58
It's sometimes needed to configure certain timeouts. This PR makes all
the settings available as helm variables.

Signed-off-by: Stefan Andres <[email protected]>
@krancour
Copy link
Member

krancour commented Nov 7, 2024

I'm supportive of this change, but there are a few issues that need to be resolved:

  • This only adds the options to configure liveness and readiness probes to the API server and the Dex server. For consistency (and because it's useful), the same options should also be added to the controller, management controller, and webhook server.

  • Inline documentation/metadata is required for the new fields in values.yaml. This isn't because I assume users require much instruction on liveness or readiness probes; rather it is because we generate the chart's README.md from metadata in the values.yaml file. Without proper metadata having been applied to these new fields, even the existence of these options will not be surfaced in the README.md.

  • A few other issues, that I will call out inline in the diffs.

Comment on lines +90 to +92
{{- with .Values.api.probes.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

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

The following 8 lines are also part of the probe.

Comment on lines +101 to +103
{{- with .Values.api.probes.readinessProbe }}
readinessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

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

The following 8 lines are also part of the probe.

@stefanandres
Copy link
Author

Thanks for the review, I'll see that I do the changes.

I would have changed other deployments if they'd already used probes, but can add placeholder for them as well.

@@ -85,8 +85,11 @@ spec:
- name: h2c
containerPort: 8080
protocol: TCP

{{- if .Values.api.probes.enabled }}
Copy link
Member

Choose a reason for hiding this comment

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

I think with the probes fully configurable, this option becomes redundant and should be removed from the template and the values.yaml file.

It is a breaking change, but it's a low-impact breaking change:

  • Exists mainly to support local development.
  • Anyone who may have disabled the probes already (in non-local dev envs), if this breaking change were to catch them by surprise, they'd be gaining new probes rather than losing anything. Whatever disruption that might cause should be easily identified and corrected.

I will of course mention a change such as this prominently in the release notes.

Copy link
Member

Choose a reason for hiding this comment

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

It occurs to me that removing this option will require some slight modifications to hack/tilt/values.dev.yaml. You'll just have to nil out the probes for a couple of components.

@@ -74,25 +74,13 @@ spec:
resources:
{{- toYaml .Values.api.oidc.dex.resources | nindent 10 }}
{{- if .Values.api.oidc.dex.probes.enabled }}
Copy link
Member

Choose a reason for hiding this comment

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

Same as this comment.

@@ -144,6 +144,11 @@ api:
probes:
## @param api.probes.enabled Whether liveness and readiness probes should be included in the API server deployment. It is sometimes advantageous to disable these during local development.
enabled: true
livenessProbe:
initialDelaySeconds: 10

Copy link
Member

Choose a reason for hiding this comment

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

Nit: Killing this blank line would visually make it more obvious that readinessProbe below is a component of this block.

@krancour
Copy link
Member

krancour commented Nov 7, 2024

rather it is because we generate the chart's README.md from metadata in the values.yaml file

Running make codegen-docs will bring the chart's README.md up to date after any modifications to values.yaml.

@krancour krancour removed this from the v1.1.0 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants