cinder: unhardcode readiness/liveness probe params

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

Change-Id: I7b9abda6424096484fe23f7240c3777b5e82d86a
This commit is contained in:
Amir Aslan Aslan
2025-05-25 15:13:08 +03:30
parent 880fc74bcb
commit 3ce8595587
3 changed files with 44 additions and 16 deletions

View File

@@ -12,6 +12,20 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "cinderApiLivenessProbeTemplate" }}
httpGet:
scheme: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: {{ tuple "volume" "healthcheck" "internal" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
port: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- define "cinderApiReadinessProbeTemplate" }}
httpGet:
scheme: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: {{ tuple "volume" "healthcheck" "internal" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }}
port: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- if .Values.manifests.deployment_api }} {{- if .Values.manifests.deployment_api }}
{{- $envAll := . }} {{- $envAll := . }}
@@ -97,22 +111,8 @@ spec:
ports: ports:
- name: c-api - name: c-api
containerPort: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} containerPort: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe: {{ dict "envAll" $envAll "component" "api" "container" "cinder-api" "type" "readiness" "probeTemplate" (include "cinderApiReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
httpGet: {{ dict "envAll" $envAll "component" "api" "container" "cinder-api" "type" "liveness" "probeTemplate" (include "cinderApiLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
scheme: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: /
port: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 30
livenessProbe:
httpGet:
scheme: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: /
port: {{ tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 5
failureThreshold: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp

View File

@@ -76,6 +76,21 @@ jobs:
failed: 1 failed: 1
pod: pod:
probes:
api:
cinder-api:
liveness:
enabled: True
params:
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
successThreshold: 1
readiness:
enabled: True
params:
initialDelaySeconds: 30
security_context: security_context:
volume_usage_audit: volume_usage_audit:
pod: pod:
@@ -437,6 +452,7 @@ conf:
composite:osapi_volume: composite:osapi_volume:
use: call:cinder.api:root_app_factory use: call:cinder.api:root_app_factory
/: apiversions /: apiversions
/healthcheck: healthcheck
/v1: openstack_volume_api_v1 /v1: openstack_volume_api_v1
/v2: openstack_volume_api_v2 /v2: openstack_volume_api_v2
/v3: openstack_volume_api_v3 /v3: openstack_volume_api_v3
@@ -476,6 +492,10 @@ conf:
paste.app_factory: cinder.api.v2.router:APIRouter.factory paste.app_factory: cinder.api.v2.router:APIRouter.factory
app:apiv3: app:apiv3:
paste.app_factory: cinder.api.v3.router:APIRouter.factory paste.app_factory: cinder.api.v3.router:APIRouter.factory
app:healthcheck:
paste.app_factory: oslo_middleware:Healthcheck.app_factory
backends: disable_by_file
disable_by_file_path: /etc/cinder/healthcheck_disable
pipeline:apiversions: pipeline:apiversions:
pipeline: cors http_proxy_to_wsgi faultwrap osvolumeversionapp pipeline: cors http_proxy_to_wsgi faultwrap osvolumeversionapp
app:osvolumeversionapp: app:osvolumeversionapp:
@@ -1304,6 +1324,7 @@ endpoints:
# key: null # key: null
path: path:
default: '/v1/%(tenant_id)s' default: '/v1/%(tenant_id)s'
healthcheck: /healthcheck
scheme: scheme:
default: 'http' default: 'http'
port: port:
@@ -1326,6 +1347,7 @@ endpoints:
# key: null # key: null
path: path:
default: '/v2/%(tenant_id)s' default: '/v2/%(tenant_id)s'
healthcheck: /healthcheck
scheme: scheme:
default: 'http' default: 'http'
port: port:
@@ -1348,6 +1370,7 @@ endpoints:
# key: null # key: null
path: path:
default: '/v3/%(tenant_id)s' default: '/v3/%(tenant_id)s'
healthcheck: /healthcheck
scheme: scheme:
default: 'http' default: 'http'
port: port:

View File

@@ -0,0 +1,5 @@
---
cinder:
- |
Unhardcode readiness/liveness probe parameters for cinder-api
...