Support override of ovs probes

Currently ovs liveness and readiness probes commands are statically
defined in the templates, this change allow them to be change
as needed.  This helps with debuging and making quick adjustment.

Change-Id: I75b4b5a335b75a52f4efbd4ba4ed007106aba4fa
This commit is contained in:
Roy Tang 2021-04-13 13:10:20 -04:00
parent 561f398ad7
commit a671d40a52
4 changed files with 21 additions and 4 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm OpenVSwitch
name: openvswitch
version: 0.1.3
version: 0.1.4
home: http://openvswitch.org
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png
sources:

View File

@ -15,19 +15,24 @@ limitations under the License.
{{- define "ovsvswitchlivenessProbeTemplate" }}
exec:
command:
{{- if .Values.pod.probes.ovs_vswitch.ovs_vswitch.liveness.exec }}
{{ .Values.pod.probes.ovs_vswitch.ovs_vswitch.liveness.exec | toYaml | indent 4 }}
{{- else }}
- /usr/bin/ovs-appctl
- bond/list
{{- end }}
{{- end }}
{{- define "ovsvswitchreadinessProbeTemplate" }}
{{- if not .Values.conf.ovs_dpdk.enabled }}
exec:
command:
{{- if .Values.pod.probes.ovs_vswitch.ovs_vswitch.readiness.exec }}
{{ .Values.pod.probes.ovs_vswitch.ovs_vswitch.readiness.exec | toYaml | indent 4 }}
{{- else if not .Values.conf.ovs_dpdk.enabled }}
- /bin/bash
- -c
- '/usr/bin/ovs-vsctl show'
{{- else }}
exec:
command:
- /bin/bash
- -c
- '/usr/bin/ovs-vsctl show && ! /usr/bin/ovs-vsctl list Open_vSwitch | grep -q dpdk_initialized.*false'

View File

@ -0,0 +1,11 @@
---
pod:
probes:
ovs_vswitch:
ovs_vswitch:
liveness:
exec:
- /bin/bash
- -c
- '/usr/bin/ovs-appctl bond/list; C1=$?; ovs-vsctl --column statistics list interface dpdk_b0s0 | grep -q -E "rx_|tx_"; C2=$?; ovs-vsctl --column statistics list interface dpdk_b0s1 | grep -q -E "rx_|tx_"; C3=$?; exit $(($C1+$C2+$C3))'
...

View File

@ -4,4 +4,5 @@ openvswitch:
- 0.1.1 Change helm-toolkit dependency version to ">= 0.1.0"
- 0.1.2 Unpin images built with osh-images
- 0.1.3 Use HostToContainer mountPropagation
- 0.1.4 Support override of vswitchd liveness and readiness probe
...