Include readiness check into liveness probe

It appears that readiness probe may not pass
but liveness probe passes in some rare cases and
it would be nice to restart the pod if readiness
probe doesn't pass for a long time.

Change-Id: I12049e4e84e2bc7d5ad90334ecdf91e25c61e575
This commit is contained in:
Alexey Odinokov 2023-04-25 21:36:17 -05:00 committed by Alexey
parent 5d2d2baf0a
commit 4832872397
5 changed files with 42 additions and 13 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Neutron
name: neutron
version: 0.3.8
version: 0.3.9
home: https://docs.openstack.org/neutron/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png
sources:

View File

@ -0,0 +1,33 @@
#!/bin/bash
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -e
/tmp/neutron-openvswitch-agent-readiness.sh
python \
/tmp/health-probe.py \
--config-file \
/etc/neutron/neutron.conf \
--config-file \
/etc/neutron/plugins/ml2/openvswitch_agent.ini \
--agent-queue-name \
q-agent-notifier-tunnel-update \
--liveness-probe
{{- if .Values.pod.use_fqdn.neutron_agent }}
--use-fqdn \
{{- end }}
--liveness-probe

View File

@ -67,6 +67,8 @@ data:
{{ tuple "bin/_neutron-openvswitch-agent-init-modules.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
neutron-openvswitch-agent-readiness.sh: |
{{ tuple "bin/_neutron-openvswitch-agent-readiness.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
neutron-openvswitch-agent-liveness.sh: |
{{ tuple "bin/_neutron-openvswitch-agent-liveness.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
neutron-sriov-agent.sh: |
{{ tuple "bin/_neutron-sriov-agent.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
neutron-sriov-agent-init.sh: |

View File

@ -20,18 +20,7 @@ exec:
{{- define "ovsAgentLivenessProbeTemplate" }}
exec:
command:
- python
- /tmp/health-probe.py
- --config-file
- /etc/neutron/neutron.conf
- --config-file
- /etc/neutron/plugins/ml2/openvswitch_agent.ini
- --agent-queue-name
- q-agent-notifier-tunnel-update
- --liveness-probe
{{- if .Values.pod.use_fqdn.neutron_agent }}
- --use-fqdn
{{- end }}
- /tmp/neutron-openvswitch-agent-liveness.sh
{{- end }}
{{- define "neutron.ovs_agent.daemonset" }}
@ -212,6 +201,10 @@ spec:
mountPath: /tmp/neutron-openvswitch-agent-readiness.sh
subPath: neutron-openvswitch-agent-readiness.sh
readOnly: true
- name: neutron-bin
mountPath: /tmp/neutron-openvswitch-agent-liveness.sh
subPath: neutron-openvswitch-agent-liveness.sh
readOnly: true
- name: neutron-bin
mountPath: /tmp/health-probe.py
subPath: health-probe.py

View File

@ -50,4 +50,5 @@ neutron:
- 0.3.6 Fix the issue that ovn metadata not work in muti-node enviroment
- 0.3.7 Sync neutron db to ovn nb db when neutron-server start
- 0.3.8 Define service_type in keystone_authtoken to support application credentials with access rules
- 0.3.9 Extend neutron liveness probe with readiness probe
...