Disable coredumps for libvirt pods

The libvirt daemonset running in compute nodes occasionally generates
coredumps during pod termination. This occurs due to a runtime error
raised during the libvirt pod shutdown, causing unnecessary coredumps.

This change explicitly disables coredump generation for libvirt pods
by setting the starlingx.io/core_pattern pod annotation to /dev/null.
This approach prevents unwanted coredump files, reducing resource usage
and log noise.

To re-enable coredump generation for debugging, the annotation can be
overridden by explicitly setting it to null, reverting to the default
coredump handler.

References:
[1] https://docs.starlingx.io/system_configuration/kubernetes/kubernetes-pod-coredump-handler-54d27a0fd2ec.html
[2] https://opendev.org/starlingx/utilities/src/branch/master/utilities/k8s-coredump/k8s-coredump/k8s_coredump

Test Plan:
[PASS] Deploy libvirt helm-chart with modified annotation
[PASS] Verify no coredumps are generated upon pod termination
[PASS] Revert annotation to starlingx.io/core_pattern: null
[PASS] Confirm coredumps generate again as expected

Change-Id: I4584fce97d7c9c45f41534eb1c931fde4fd53497
Signed-off-by: Mateus Nascimento <mateus.soaresdonascimento@windriver.com>
This commit is contained in:
Mateus Nascimento
2025-03-24 16:23:12 -03:00
parent 2f7492a0b1
commit 0747f0de50
3 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
From 1dae7d6e8978c1d22a9846730dc5b966aef7a17a Mon Sep 17 00:00:00 2001
From: Mateus Nascimento <mateus.soaresdonascimento@windriver.com>
Date: Mon, 24 Mar 2025 14:21:33 -0300
Subject: [PATCH] Add custom pod annotations to libvirt
This change allows custom annotations to be added to the libvirt pods
using the static overrides configurations. It follows the recently made
commits of other OpenStack Helm pods.
---
libvirt/templates/daemonset-libvirt.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/libvirt/templates/daemonset-libvirt.yaml b/libvirt/templates/daemonset-libvirt.yaml
index 050aefc0..94d2ff05 100644
--- a/libvirt/templates/daemonset-libvirt.yaml
+++ b/libvirt/templates/daemonset-libvirt.yaml
@@ -65,6 +65,7 @@ spec:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "libvirt" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
configchecksum: {{ toYaml .Values.labels.isApplication | sha256sum | trunc 63 }}
spec:
{{ dict "envAll" $envAll "application" "libvirt" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
--
2.34.1

View File

@@ -19,3 +19,4 @@
0019-Fix-upversion-breaking-changes.patch
0020-removed-section-to-add-default-daemonset-to-global-l.patch
0021-Bring-necessary-upstream-commits.patch
0022-Add-custom-pod-annotations-to-libvirt.patch

View File

@@ -35,6 +35,10 @@ pod:
- key: openstack-compute-node
operator: Exists
effect: NoSchedule
annotations:
pod:
libvirt:
starlingx.io/core_pattern: "/dev/null"
images:
tags:
ceph_config_helper: docker.io/openstackhelm/ceph-config-helper:ubuntu_bionic-20201223