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

Allow customising liveness and readiness probes #44

Merged
merged 1 commit into from
May 17, 2022
Merged

Allow customising liveness and readiness probes #44

merged 1 commit into from
May 17, 2022

Conversation

Epicsteve2
Copy link
Contributor

Adds default livenessProbe and readinessProbes, along with customLivenessProbe and customReadinessProbe to the Trino chart for both the coordinator and workers.

@cla-bot cla-bot bot added the cla-signed label Apr 5, 2022
@nickelozz
Copy link

@hashhar would it be possible to get someone to review this PR?

@hashhar
Copy link
Member

hashhar commented May 12, 2022

I'll take a look this weekend. sorry about the delay.

Comment on lines 85 to 100
{{- if .Values.coordinator.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /v1/info
port: http
initialDelaySeconds: {{ .Values.coordinator.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.coordinator.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.coordinator.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.coordinator.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.coordinator.livenessProbe.failureThreshold }}
{{- else if .Values.coordinator.customLivenessProbe }}
{{- with .Values.coordinator.customLivenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe let's split this by moving the default definition into helpers.tpl and leaving values.yaml empty and have the deployment pick the default if values is empty.

that way it keeps the chart simple by providing good defaults and allows anyone who wants customisation to provide their own livenessProbe node.

Same for readinessProbe.

Copy link
Contributor Author

@Epicsteve2 Epicsteve2 May 15, 2022

Choose a reason for hiding this comment

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

I don't see the need for using _helpers.tpl. Instead, why not use the helm default function?
So it would look like:

initialDelaySeconds: {{ .Values.coordinator.readinessProbe.initialDelaySeconds | default 20 }}
periodSeconds: {{ .Values.coordinator.readinessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.coordinator.readinessProbe.timeoutSeconds | default 5 }}
successThreshold: {{ .Values.coordinator.readinessProbe.successThreshold | default 6 }}
failureThreshold: {{ .Values.coordinator.readinessProbe.failureThreshold | default 1 }}

If this is the case, do you also want values.yaml to look like this?

livenessProbe: {}
  # enabled: true
  # initialDelaySeconds: 20
  # periodSeconds: 10
  # timeoutSeconds: 5
  # failureThreshold: 6
  # successThreshold: 1
readinessProbe: {}
  # enabled: true
  # initialDelaySeconds: 20
  # periodSeconds: 10
  # timeoutSeconds: 5
  # failureThreshold: 6
  # successThreshold: 1
customLivenessProbe: {}
customReadinessProbe: {}

I feel like that would make customLivenessProbe and livenessProbe too similar. We could also only have customLivenessProbe and remove livenessProbe instead...

Copy link
Member

Choose a reason for hiding this comment

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

I'd say we can remove customLivenessProbe and just use one of them. Keeps things simpler (for consumers of the chart for sure, maybe not for authors which is fine).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I've removed customReadinessProbe, customLivenessProbe, readinessProbe.enabled, livenessProbe.enabled as well
All of the if statements are gone and it will use the defaults if the selected values don't exist.

charts/trino/values.yaml Outdated Show resolved Hide resolved
charts/trino/values.yaml Outdated Show resolved Hide resolved
@hashhar
Copy link
Member

hashhar commented May 17, 2022

LGTM and let's reword commit to Allow customising liveness and readiness probes since the probes already existed.

@hashhar hashhar changed the title Add livenessProbe and readinessProbe Allow customising liveness and readiness probes May 17, 2022
@hashhar hashhar merged commit 3821269 into trinodb:main May 17, 2022
@Epicsteve2 Epicsteve2 deleted the liveness-readiness branch May 17, 2022 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants