From 0747f0de50530705252f7de38086a7eace7461ba Mon Sep 17 00:00:00 2001 From: Mateus Nascimento Date: Mon, 24 Mar 2025 16:23:12 -0300 Subject: [PATCH] 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 --- ...dd-custom-pod-annotations-to-libvirt.patch | 28 +++++++++++++++++++ .../debian/deb_folder/patches/series | 1 + .../libvirt/libvirt-static-overrides.yaml | 4 +++ 3 files changed, 33 insertions(+) create mode 100644 openstack-helm-infra/debian/deb_folder/patches/0022-Add-custom-pod-annotations-to-libvirt.patch diff --git a/openstack-helm-infra/debian/deb_folder/patches/0022-Add-custom-pod-annotations-to-libvirt.patch b/openstack-helm-infra/debian/deb_folder/patches/0022-Add-custom-pod-annotations-to-libvirt.patch new file mode 100644 index 000000000..2005e8824 --- /dev/null +++ b/openstack-helm-infra/debian/deb_folder/patches/0022-Add-custom-pod-annotations-to-libvirt.patch @@ -0,0 +1,28 @@ +From 1dae7d6e8978c1d22a9846730dc5b966aef7a17a Mon Sep 17 00:00:00 2001 +From: Mateus Nascimento +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 + diff --git a/openstack-helm-infra/debian/deb_folder/patches/series b/openstack-helm-infra/debian/deb_folder/patches/series index 0ea86acf6..5aaa49751 100644 --- a/openstack-helm-infra/debian/deb_folder/patches/series +++ b/openstack-helm-infra/debian/deb_folder/patches/series @@ -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 diff --git a/stx-openstack-helm-fluxcd/stx-openstack-helm-fluxcd/manifests/libvirt/libvirt-static-overrides.yaml b/stx-openstack-helm-fluxcd/stx-openstack-helm-fluxcd/manifests/libvirt/libvirt-static-overrides.yaml index f737af1d5..66d3fc6fd 100644 --- a/stx-openstack-helm-fluxcd/stx-openstack-helm-fluxcd/manifests/libvirt/libvirt-static-overrides.yaml +++ b/stx-openstack-helm-fluxcd/stx-openstack-helm-fluxcd/manifests/libvirt/libvirt-static-overrides.yaml @@ -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