From b11b4ae6c3fc24919e049ad4f58e8261b4db8c63 Mon Sep 17 00:00:00 2001 From: Anjeev Kumar Date: Thu, 8 Jul 2021 14:14:27 +0530 Subject: [PATCH] Enable probes override from values.yaml for libvirt This PS enables overriding liveness/readiness probes configurations for libvirt pods via values.yaml. In addition, updating the values for some of the fields of the probes as the default values seem to be too aggresive. Change-Id: I64033a1d67461851d8f2d86905ef7068c2ec43b6 Co-authored-by: Huy Tran Change-Id: Ib10379829e2989d3de385ad6d1944565b2f9953f --- libvirt/Chart.yaml | 2 +- libvirt/templates/daemonset-libvirt.yaml | 29 ++++++++++++++---------- libvirt/values.yaml | 15 ++++++++++++ releasenotes/notes/libvirt.yaml | 1 + 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/libvirt/Chart.yaml b/libvirt/Chart.yaml index 8e3eb6219..950099649 100644 --- a/libvirt/Chart.yaml +++ b/libvirt/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm libvirt name: libvirt -version: 0.1.5 +version: 0.1.6 home: https://libvirt.org sources: - https://libvirt.org/git/?p=libvirt.git;a=summary diff --git a/libvirt/templates/daemonset-libvirt.yaml b/libvirt/templates/daemonset-libvirt.yaml index ca9f633c4..2c0ccda84 100644 --- a/libvirt/templates/daemonset-libvirt.yaml +++ b/libvirt/templates/daemonset-libvirt.yaml @@ -12,6 +12,21 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "libvirtReadinessProbeTemplate" }} +exec: + command: + - bash + - -c + - /usr/bin/virsh list +{{- end }} +{{- define "libvirtLivenessProbeTemplate" }} +exec: + command: + - bash + - -c + - /usr/bin/virsh list +{{- end }} + {{- define "libvirt.daemonset" }} {{- $daemonset := index . 0 }} {{- $configMapName := index . 1 }} @@ -134,18 +149,8 @@ spec: value: "{{ .Values.conf.ceph.cinder.external_ceph.secret_uuid }}" {{ end }} {{ end }} - readinessProbe: - exec: - command: - - bash - - -c - - /usr/bin/virsh list - livenessProbe: - exec: - command: - - bash - - -c - - /usr/bin/virsh list +{{ dict "envAll" . "component" "libvirt" "container" "libvirt" "type" "readiness" "probeTemplate" (include "libvirtReadinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} +{{ dict "envAll" . "component" "libvirt" "container" "libvirt" "type" "liveness" "probeTemplate" (include "libvirtLivenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} command: - /tmp/libvirt.sh lifecycle: diff --git a/libvirt/values.yaml b/libvirt/values.yaml index 0c03f51e8..b6cab8dbe 100644 --- a/libvirt/values.yaml +++ b/libvirt/values.yaml @@ -102,6 +102,21 @@ conf: cgroup: "kubepods" pod: + probes: + libvirt: + libvirt: + liveness: + enabled: true + params: + initialDelaySeconds: 30 + periodSeconds: 60 + timeoutSeconds: 5 + readiness: + enabled: true + params: + initialDelaySeconds: 15 + periodSeconds: 60 + timeoutSeconds: 5 security_context: libvirt: pod: diff --git a/releasenotes/notes/libvirt.yaml b/releasenotes/notes/libvirt.yaml index 65f958507..a46d6a7c8 100644 --- a/releasenotes/notes/libvirt.yaml +++ b/releasenotes/notes/libvirt.yaml @@ -6,4 +6,5 @@ libvirt: - 0.1.3 Create override for external ceph cinder backend - 0.1.4 Set unix socket auth method as none - 0.1.5 Use full image ref for docker official images + - 0.1.6 Enhancement to enable probes override from values.yaml ...