diff --git a/chart/templates/flower/flower-deployment.yaml b/chart/templates/flower/flower-deployment.yaml index 00f8f4a9afcb9..83737c6d0cdca 100644 --- a/chart/templates/flower/flower-deployment.yaml +++ b/chart/templates/flower/flower-deployment.yaml @@ -116,7 +116,7 @@ spec: - name: flower-ui containerPort: {{ .Values.ports.flowerUI }} livenessProbe: - failureThreshold: 10 + failureThreshold: {{ .Values.flower.livenessProbe.failureThreshold }} exec: command: - curl @@ -125,10 +125,11 @@ spec: - $AIRFLOW__CELERY__FLOWER_BASIC_AUTH {{- end }} - {{ printf "localhost:%s" (.Values.ports.flowerUI | toString) }} - initialDelaySeconds: 10 - periodSeconds: 5 + initialDelaySeconds: {{ .Values.flower.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.flower.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.flower.livenessProbe.timeoutSeconds }} readinessProbe: - failureThreshold: 10 + failureThreshold: {{ .Values.flower.readinessProbe.failureThreshold }} exec: command: - curl @@ -137,8 +138,9 @@ spec: - $AIRFLOW__CELERY__FLOWER_BASIC_AUTH {{- end }} - {{ printf "localhost:%s" (.Values.ports.flowerUI | toString) }} - initialDelaySeconds: 10 - periodSeconds: 5 + initialDelaySeconds: {{ .Values.flower.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.flower.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.flower.readinessProbe.timeoutSeconds }} envFrom: {{- include "custom_airflow_environment_from" . | default "\n []" | indent 10 }} env: diff --git a/chart/values.schema.json b/chart/values.schema.json index 7df2adf3fd1fc..fa7accbbf3d72 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -4955,6 +4955,60 @@ "type": "boolean", "default": false }, + "livenessProbe": { + "description": "Liveness probe configuration.", + "type": "object", + "additionalProperties": false, + "properties": { + "initialDelaySeconds": { + "description": "Flower Liveness probe initial delay.", + "type": "integer", + "default": 10 + }, + "timeoutSeconds": { + "description": "Flower Liveness probe timeout seconds.", + "type": "integer", + "default": 5 + }, + "failureThreshold": { + "description": "Flower Liveness probe failure threshold.", + "type": "integer", + "default": 10 + }, + "periodSeconds": { + "description": "Flower Liveness probe period seconds.", + "type": "integer", + "default": 5 + } + } + }, + "readinessProbe": { + "description": "Readiness probe configuration.", + "type": "object", + "additionalProperties": false, + "properties": { + "initialDelaySeconds": { + "description": "Flower Readiness probe initial delay.", + "type": "integer", + "default": 10 + }, + "timeoutSeconds": { + "description": "Flower Readiness probe timeout seconds.", + "type": "integer", + "default": 5 + }, + "failureThreshold": { + "description": "Flower Readiness probe failure threshold.", + "type": "integer", + "default": 10 + }, + "periodSeconds": { + "description": "Flower Readiness probe period seconds.", + "type": "integer", + "default": 5 + } + } + }, "revisionHistoryLimit": { "description": "Number of old replicasets to retain.", "type": [ diff --git a/chart/values.yaml b/chart/values.yaml index 9e8b333acb0cc..c16f5088ce679 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1708,6 +1708,19 @@ flower: # Enable flower. # If True, and using CeleryExecutor/CeleryKubernetesExecutor, will deploy flower app. enabled: false + + livenessProbe: + initialDelaySeconds: 10 + timeoutSeconds: 5 + failureThreshold: 10 + periodSeconds: 5 + + readinessProbe: + initialDelaySeconds: 10 + timeoutSeconds: 5 + failureThreshold: 10 + periodSeconds: 5 + # Max number of old replicasets to retain revisionHistoryLimit: ~ diff --git a/helm_tests/other/test_flower.py b/helm_tests/other/test_flower.py index 48512776a98e0..93a40ac38a518 100644 --- a/helm_tests/other/test_flower.py +++ b/helm_tests/other/test_flower.py @@ -363,6 +363,30 @@ def test_should_add_component_specific_annotations(self): assert "annotations" in jmespath.search("metadata", docs[0]) assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value" + @pytest.mark.parametrize("probe", ["livenessProbe", "readinessProbe"]) + def test_probe_values_are_configurable(self, probe): + docs = render_chart( + values={ + "flower": { + "enabled": True, + probe: { + "initialDelaySeconds": 111, + "timeoutSeconds": 222, + "failureThreshold": 333, + "periodSeconds": 444, + }, + }, + }, + show_only=["templates/flower/flower-deployment.yaml"], + ) + + assert 111 == jmespath.search( + f"spec.template.spec.containers[0].{probe}.initialDelaySeconds", docs[0] + ) + assert 222 == jmespath.search(f"spec.template.spec.containers[0].{probe}.timeoutSeconds", docs[0]) + assert 333 == jmespath.search(f"spec.template.spec.containers[0].{probe}.failureThreshold", docs[0]) + assert 444 == jmespath.search(f"spec.template.spec.containers[0].{probe}.periodSeconds", docs[0]) + class TestFlowerService: """Tests flower service."""