influxdata / influxdata/helm-charts

Liveness and Readiness Probes Fail When Changing Port Name

Open
#696 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Mustache
Stars
257
Forks
347
Avg merge
4d 20h
Merged PRs (30d)
9

Description

## 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:

```yaml
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:
```yaml
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:
```text
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:
```yaml
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 ...
```

Contributor guide

Open the contributing guide

Research direction

Locate the InfluxDB chart's StatefulSet template and values.yaml service configuration, then inspect how the liveness and readiness probe ports are rendered. Render the chart with a changed service.portName and confirm both probes use that configured name instead of the hardcoded value.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.