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

feat: startupProbe to avoid a long initial delay seconds for liveness probe #174

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/opencost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- kubecost
- opencost
- monitoring
version: 1.29.0
version: 1.29.1
maintainers:
- name: mattray
- name: toscott
Expand Down
9 changes: 9 additions & 0 deletions charts/opencost/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ spec:
- containerPort: {{ .Values.opencost.exporter.apiPort }}
name: http
resources: {{- toYaml .Values.opencost.exporter.resources | nindent 12 }}
{{- if .Values.opencost.exporter.startupProbe.enabled }}
startupProbe:
httpGet:
path: {{ .Values.opencost.exporter.startupProbe.path }}
port: {{ .Values.opencost.exporter.apiPort }}
initialDelaySeconds: {{ .Values.opencost.exporter.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.opencost.exporter.startupProbe.periodSeconds }}
failureThreshold: {{ .Values.opencost.exporter.startupProbe.failureThreshold }}
{{- end }}
{{- if .Values.opencost.exporter.livenessProbe.enabled }}
livenessProbe:
httpGet:
Expand Down
18 changes: 15 additions & 3 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,28 @@ opencost:
limits:
cpu: '999m'
memory: '1Gi'
# Startup probe configuration
startupProbe:
# -- Whether probe is enabled
enabled: true
# -- Probe path
path: /healthz
# -- Number of seconds before probe is initiated
initialDelaySeconds: 10
# -- Probe frequency in seconds
periodSeconds: 5
# -- Number of failures for probe to be considered failed
failureThreshold: 30
# Liveness probe configuration
livenessProbe:
# -- Whether probe is enabled
enabled: true
# -- Probe path
path: /healthz
# -- Number of seconds before probe is initiated
initialDelaySeconds: 120
initialDelaySeconds: 10
# -- Probe frequency in seconds
periodSeconds: 10
periodSeconds: 20
Copy link
Contributor Author

Choose a reason for hiding this comment

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

readiness probe must fail before liveness probe. otherwise container stops receiving traffic and restarts at the same time.

# -- Number of failures for probe to be considered failed
failureThreshold: 3
# Readiness probe configuration
Expand All @@ -133,7 +145,7 @@ opencost:
# -- Probe path
path: /healthz
# -- Number of seconds before probe is initiated
initialDelaySeconds: 120
initialDelaySeconds: 10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ideally you should run readiness as soon as the container comes up

# -- Probe frequency in seconds
periodSeconds: 10
# -- Number of failures for probe to be considered failed
Expand Down
Loading