-
Notifications
You must be signed in to change notification settings - Fork 162
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
959aa1b
to
c468b6f
Compare
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]>
c468b6f
to
01408d7
Compare
I'm supportive of this change, but there are a few issues that need to be resolved:
|
{{- with .Values.api.probes.livenessProbe }} | ||
livenessProbe: {{- toYaml . | nindent 12 }} | ||
{{- end }} |
There was a problem hiding this comment.
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.
{{- with .Values.api.probes.readinessProbe }} | ||
readinessProbe: {{- toYaml . | nindent 12 }} | ||
{{- end }} |
There was a problem hiding this comment.
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.
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 }} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll just remove the tls-variable for the probe then
In tilt the probes are already disabled, so we shouldn't need to override the exec there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to mention it here: I'd personally leave the tls variable in the template. Removing it adds manual toil to deployments (like ours) because you'll be confused why the probe is failing when TLS is disabled.
in our case, we don't use TLS here because our ingress is already doing TLS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tilt the probes are already disabled, so we shouldn't need to override the exec there
This suggests some misunderstanding.
I think with the probes fully configurable, this option becomes redundant and should be removed from the template and the values.yaml file.
"This option," here referred to api.probes.enabled
. There is no sense in having an enabled
boolean when having or not having a liveness probe can simply depend on whether api.probes.livenessProbe
is defined or not. Same can be said for the readiness probes.
Having said that, the following may change my line of thought...
Just to mention it here: I'd personally leave the tls variable in the template. Removing it adds manual toil to deployments (like ours) because you'll be confused why the probe is failing when TLS is disabled.
That wasn't even on my radar when I initially reviewed, but you're right. I believe this exposes the fact that it's probably not so ideal to put the definitions of the probes fully within the control of the user. It's not just about TLS. It altogether eliminates any (current or future) possibility of probes being configured conditionally based on based on other settings throughout the chart. TLS being enabled or not is just one such example.
This drives me toward thinking that we ought not let users define livenessProbe
and readinessProbe
in their entirety, but should, instead, surface individual options for things like initialDelaySeconds
, periodSeconds
, timeoutSeconds
, etc., etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This drives me toward thinking that we ought not let users define livenessProbe and readinessProbe in their entirety, but should, instead, surface individual options for things like initialDelaySeconds, periodSeconds, timeoutSeconds, etc., etc.
I'd argue to go with my first implementation. With this, all options except the exec.command variables would be setable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This option," here referred to api.probes.enabled. There is no sense in having an enabled boolean when having or not having a liveness probe can simply depend on whether api.probes.livenessProbe is defined or not. Same can be said for the readiness probes.
Yep, that makes sense. But I'd leave that if we keep part of the configuration as helm templates (as suggested in my comment above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue to go with my first implementation. With this, all options except the exec.command variables would be setable.
Have a look at something like #3041 where we're looking to change how one of the probes is implemented.
Changes such as this would become much more difficult if we leave things too configurable.
@@ -74,25 +74,13 @@ spec: | |||
resources: | |||
{{- toYaml .Values.api.oidc.dex.resources | nindent 10 }} | |||
{{- if .Values.api.oidc.dex.probes.enabled }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as this comment.
charts/kargo/values.yaml
Outdated
@@ -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 | |||
|
There was a problem hiding this comment.
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.
Running |
This fails for me, how do I fix that?
Edit: ah, that probably means if wants to have a description for every defined variable. |
Signed-off-by: Stefan Andres <[email protected]>
Signed-off-by: Stefan Andres <[email protected]>
63890e6
to
641be50
Compare
It's sometimes needed to configure certain timeouts. This PR makes all the settings available as helm variables.