Merge "Enable probes override from values.yaml for ovs"

This commit is contained in:
Zuul 2019-08-21 12:08:55 +00:00 committed by Gerrit Code Review
commit 7c2c148fb0
3 changed files with 61 additions and 30 deletions

View File

@ -14,6 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "ovsdblivenessProbeTemplate" }}
exec:
command:
- /usr/bin/ovs-vsctl
- show
{{- end }}
{{- define "ovsdbreadinessProbeTemplate" }}
exec:
command:
- /usr/bin/ovs-vsctl
- list
- Open_Vswitch
{{- end }}
{{- if .Values.manifests.daemonset_ovs_db }}
{{- $envAll := . }}
@ -70,23 +84,8 @@ spec:
{{ tuple $envAll "openvswitch_db_server" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ dict "envAll" $envAll "application" "openvswitch_db_server" "container" "server" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.ovs.db | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
readinessProbe:
exec:
command:
- /usr/bin/ovs-vsctl
- list
- Open_Vswitch
initialDelaySeconds: 90
periodSeconds: 30
timeoutSeconds: 5
livenessProbe:
exec:
command:
- /usr/bin/ovs-vsctl
- show
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
{{ dict "envAll" $envAll "component" "ovs_db" "container" "ovs_db" "type" "liveness" "probeTemplate" (include "ovsdblivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
{{ dict "envAll" $envAll "component" "ovs_db" "container" "ovs_db" "type" "readiness" "probeTemplate" (include "ovsdbreadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
command:
- /tmp/openvswitch-db-server.sh
- start

View File

@ -14,6 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "ovsvswitchlivenessProbeTemplate" }}
exec:
command:
- /usr/bin/ovs-appctl
- bond/list
{{- end }}
{{- define "ovsvswitchreadinessProbeTemplate" }}
exec:
command:
- /bin/bash
- -c
- '! /usr/bin/ovs-vsctl show | grep -q error:'
{{- end }}
{{- if .Values.manifests.daemonset_ovs_vswitchd }}
{{- $envAll := . }}
@ -84,19 +98,8 @@ of hugepages must still be defined in the values.yaml.*/}}
{{ tuple $envAll $envAll.Values.pod.resources.ovs.vswitchd | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
# ensures this container can speak to the ovs database
# successfully before its marked as ready
readinessProbe:
exec:
command:
- /usr/bin/ovs-vsctl
- show
livenessProbe:
exec:
command:
- /usr/bin/ovs-appctl
- bond/list
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
{{ dict "envAll" $envAll "component" "ovs_vswitch" "container" "ovs_vswitch" "type" "liveness" "probeTemplate" (include "ovsvswitchlivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
{{ dict "envAll" $envAll "component" "ovs_vswitch" "container" "ovs_vswitch" "type" "readiness" "probeTemplate" (include "ovsvswitchreadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
command:
- /tmp/openvswitch-vswitchd.sh
- start

View File

@ -38,6 +38,35 @@ labels:
node_selector_value: enabled
pod:
probes:
ovs_db:
ovs_db:
liveness:
enabled: true
params:
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
readiness:
enabled: true
params:
initialDelaySeconds: 90
periodSeconds: 30
timeoutSeconds: 5
ovs_vswitch:
ovs_vswitch:
liveness:
enabled: true
params:
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
readiness:
enabled: true
params:
failureThreshold: 3
periodSeconds: 10
timeoutSeconds: 1
security_context:
openvswitch_db_server:
pod: