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 custom readiness and liveness probes for vmselect and vminsert #757

Closed
wants to merge 1 commit into from

Conversation

jifwin
Copy link
Contributor

@jifwin jifwin commented Nov 15, 2023

No description provided.

@@ -110,20 +110,28 @@ spec:
containerPort: {{ include "split-host-port" .Values.vminsert.extraArgs.opentsdbListenAddr }}
{{- end }}
readinessProbe:
{{- if not .Values.vminsert.probe.readiness.extra }}
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. I think If those are extra readiness/liveness, they shouldn't override the default one;
  2. Also need to add corresponding values in https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-cluster/values.yaml#L72

@Haleygo
Copy link
Contributor

Haleygo commented Nov 17, 2023

I think we should modify the vminsert/vmselect probes like vmstorage does now, it will be more flexible to add extra probes or remove default one.

{{- with $.Values.vmstorage.probe.readiness }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}

And can you help updating the changelog with some description as well?

@jifwin
Copy link
Contributor Author

jifwin commented Nov 17, 2023

Good idea, but how to move this default probe logic to values.yml?

          readinessProbe:
            httpGet:
            {{- if index  .Values.vmselect.extraArgs "http.pathPrefix" }}
              path: {{ trimSuffix "/" (index .Values.vmselect.extraArgs "http.pathPrefix") }}/health
            {{- else }}
              path: /health
            {{- end }}

@Haleygo
Copy link
Contributor

Haleygo commented Nov 21, 2023

Good idea, but how to move this default probe logic to values.yml?

          readinessProbe:
            httpGet:
            {{- if index  .Values.vmselect.extraArgs "http.pathPrefix" }}
              path: {{ trimSuffix "/" (index .Values.vmselect.extraArgs "http.pathPrefix") }}/health
            {{- else }}
              path: /health
            {{- end }}

Yeah, thanks for pointing out. Seems like there is no easy way to unify vminsert&vmstorage's probes without possibility to break some users' installation now.
Ok, that's keep the way you proposed, please see reveiew comments here.

@jifwin
Copy link
Contributor Author

jifwin commented Nov 22, 2023

I renamed 'extra' to 'custom' to clarify that it overrides the default probe.
Regarding values.yaml, do you want me to add an example of a custom probe, e.g. like this?

  probe:
    readiness:
      initialDelaySeconds: 5
      periodSeconds: 15
      timeoutSeconds: 5
      failureThreshold: 3
      #custom: # -- override for the default probe
      #  tcpSocket:
      #    port: http

@Haleygo
Copy link
Contributor

Haleygo commented Nov 22, 2023

it overrides the default probe.

Is there any specific reason to override the default probe here? I thought you want to add an extra probe.

And those new fields need to be added to values file too.

@jifwin
Copy link
Contributor Author

jifwin commented Nov 22, 2023

I'm binding vmselect and vminsert to localhost for security reasons and using TLS sidecar to access these services on a diferent through a different port. Thus I need to change the definitions of probes to access that new port with HTTPS scheme. Also I want to replace tcpSocket probe with httpGet probe, since opening tcp to a sidecar proxy does not give much information, I need to actually call the service (vmselect/vminsert) behind the proxy.

@zekker6 zekker6 self-requested a review January 9, 2024 08:01
@Haleygo
Copy link
Contributor

Haleygo commented Jan 10, 2024

@jifwin
I think this is the way to add this new feature without breaking old installation. Could you please add new vminsert.probe.readiness.custom field to the values file with example?
And help updating the changelog with some description as well?

@AndrewChubatiuk
Copy link
Collaborator

closing in a favour of #1212

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.

4 participants