feat(libvirt-exporter): add readiness and liveness probes to sidecar container

Change-Id: I346e16406b27addb715c18e710e9ee721c056010
Signed-off-by: Saeed Padari <sam137115@gmail.com>
This commit is contained in:
Saeed Padari
2025-09-13 00:27:17 +03:30
parent a4df9c709e
commit 97bb401c0a
3 changed files with 27 additions and 10 deletions

View File

@@ -20,6 +20,13 @@ exec:
- /usr/bin/virsh connect
{{- end }}
{{- define "libvirtExporterProbeTemplate" }}
httpGet:
path: /
port: metrics
scheme: HTTP
{{- end }}
{{- define "libvirt.daemonset" }}
{{- $daemonset := index . 0 }}
{{- $configMapName := index . 1 }}
@@ -312,16 +319,8 @@ spec:
- name: metrics
protocol: TCP
containerPort: {{ tuple "libvirt_exporter" "direct" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe:
httpGet:
path: /
port: metrics
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: metrics
timeoutSeconds: 5
{{ dict "envAll" . "component" "libvirt" "container" "libvirt_exporter" "type" "readiness" "probeTemplate" (include "libvirtExporterProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
{{ dict "envAll" . "component" "libvirt" "container" "libvirt_exporter" "type" "liveness" "probeTemplate" (include "libvirtExporterProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
volumeMounts:
- name: run
mountPath: /run

View File

@@ -262,6 +262,19 @@ pod:
initialDelaySeconds: 15
periodSeconds: 60
timeoutSeconds: 5
libvirt_exporter:
liveness:
enabled: true
params:
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 5
readiness:
enabled: true
params:
initialDelaySeconds: 15
periodSeconds: 60
timeoutSeconds: 5
security_context:
libvirt:
pod:

View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Added readiness and liveness probes for the libvirt-exporter sidecar container.
...