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

Liveness and Readiness Probes Fail When Changing Port Name #696

Open
rahul007-bit opened this issue Dec 30, 2024 · 0 comments
Open

Liveness and Readiness Probes Fail When Changing Port Name #696

rahul007-bit opened this issue Dec 30, 2024 · 0 comments

Comments

@rahul007-bit
Copy link

Description

When modifying the portName in the InfluxDB Helm chart, the liveness and readiness probes stop functioning correctly. This is because the probes are hardcoded to use the port name "http" in the StatefulSet template, causing errors when the port name is changed.

The current values.yaml configuration for the service is:

service:
  type: ClusterIP
  port: 8086
  targetPort: 8086
  annotations: {}
  labels: {}
  portName: https

Current Behavior

The liveness and readiness probes are defined as follows in the StatefulSet template:

livenessProbe:
  httpGet:
    path: {{ .Values.livenessProbe.path | default "/health" }}
    port: http
    scheme: {{ .Values.livenessProbe.scheme | default "HTTP" }}
  # ... other probe settings ...

readinessProbe:
  httpGet:
    path: {{ .Values.readinessProbe.path | default "/health" }}
    port: http
    scheme: {{ .Values.readinessProbe.scheme | default "HTTP" }}
  # ... other probe settings ...

The port: http line is hardcoded, which prevents users from customizing the port name.

When the port name is changed in the values.yaml file, the following errors occur:

Warning  Unhealthy  96s (x13 over 3m6s)  kubelet  Readiness probe errored: strconv.Atoi: parsing "http": invalid syntax
Warning  Unhealthy  96s (x9 over 2m56s)   kubelet  Liveness probe errored: strconv.Atoi: parsing "http": invalid syntax

Expected Behavior

The port name in the probes should be configurable, allowing users to change it without breaking the liveness and readiness checks.

Proposed Solution

Update the StatefulSet template to use a variable for the port name:

livenessProbe:
  httpGet:
    path: {{ .Values.livenessProbe.path | default "/health" }}
    port: {{ .Values.service.portName }}
    scheme: {{ .Values.livenessProbe.scheme | default "HTTP" }}
  # ... other probe settings ...

readinessProbe:
  httpGet:
    path: {{ .Values.readinessProbe.path | default "/health" }}
    port: {{ .Values.service.portName }}
    scheme: {{ .Values.readinessProbe.scheme | default "HTTP" }}
  # ... other probe settings ...
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

No branches or pull requests

1 participant