octavia: unhardcode readiness and add liveness to api

This patch adds ability to set readiness and liveness probes parameters
of octavia-api via chart values instead of having them hardcoded in the
deployment manifest. Also healthcheck of octavia is enabled.

Change-Id: If4e7d66744d3fb3f78ada6b97681e3f12a426fe3
This commit is contained in:
Amir Aslan Aslan
2025-05-31 21:24:18 +03:30
parent 3c7964f1c5
commit da2543ff8d
3 changed files with 34 additions and 5 deletions

View File

@ -14,6 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "octaviaApiLivenessProbeTemplate" }}
httpGet:
scheme: {{ tuple "load_balancer" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: {{ tuple "load_balancer" "healthcheck" "internal" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
port: {{ tuple "load_balancer" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- define "octaviaApiReadinessProbeTemplate" }}
httpGet:
scheme: {{ tuple "load_balancer" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: {{ tuple "load_balancer" "healthcheck" "internal" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
port: {{ tuple "load_balancer" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- if .Values.manifests.deployment_api }}
{{- $envAll := . }}
@ -74,11 +89,8 @@ spec:
ports:
- name: o-api
containerPort: {{ tuple "load_balancer" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
httpGet:
scheme: {{ tuple "load_balancer" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: /
port: {{ tuple "load_balancer" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ dict "envAll" $envAll "component" "api" "container" "octavia-api" "type" "readiness" "probeTemplate" (include "octaviaApiReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
{{ dict "envAll" $envAll "component" "api" "container" "octavia-api" "type" "liveness" "probeTemplate" (include "octaviaApiLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
volumeMounts:
- name: run-openvswitch
mountPath: /var/run/ovn

View File

@ -227,6 +227,7 @@ conf:
api_settings:
api_handler: queue_producer
bind_host: 0.0.0.0
healthcheck_enabled: true
database:
max_retries: -1
health_manager:
@ -463,6 +464,7 @@ endpoints:
public: octavia
host_fqdn_override:
default: null
healthcheck: /healthcheck
path:
default: null
scheme:
@ -571,6 +573,15 @@ endpoints:
sentinel: 26379
pod:
probes:
api:
octavia-api:
liveness:
enabled: True
params: {}
readiness:
enabled: True
params: {}
security_context:
octavia_api:
container:

View File

@ -0,0 +1,6 @@
---
octavia:
- |
Unhardcode readiness of octavia-api and add liveness probe. Also healthcheck of
octavia is enabled.
...