diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index 0d6451917..41d677806 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -579,6 +579,86 @@ spec: image_pull_secret: # deprecated description: (Deprecated) Image pull secret for app and database containers type: string + web_liveness_initial_delay: + description: Number of seconds after the container has started before startup. + type: integer + default: 3 + web_liveness_period: + description: How often (in seconds) to perform the probe. + type: integer + default: 3 + web_liveness_failure_threshold: + description: Consecutive failure for the probe to be considered failed. + type: integer + default: 3 + web_liveness_success_threshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. + type: integer + default: 1 + web_liveness_timeout: + description: Number of seconds after which the probe times out. + type: integer + default: 10 + web_readiness_initial_delay: + description: Number of seconds after the container has started before startup + type: integer + default: 3 + web_readiness_period: + description: How often (in seconds) to perform the probe. + type: integer + default: 3 + web_readiness_failure_threshold: + description: Consecutive failure for the probe to be considered failed. + type: integer + default: 3 + web_readiness_success_threshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. + type: integer + default: 1 + web_readiness_timeout: + description: Number of seconds after which the probe times out. + type: integer + default: 5 + task_liveness_initial_delay: + description: Number of seconds after the container has started before startup. + type: integer + default: 3 + task_liveness_period: + description: How often (in seconds) to perform the probe. + type: integer + default: 3 + task_liveness_failure_threshold: + description: Consecutive failure for the probe to be considered failed. + type: integer + default: 3 + task_liveness_success_threshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. + type: integer + default: 1 + task_liveness_timeout: + description: Number of seconds after which the probe times out. + type: integer + default: 10 + task_readiness_initial_delay: + description: Number of seconds after the container has started before startup + type: integer + default: 3 + task_readiness_period: + description: How often (in seconds) to perform the probe. + type: integer + default: 3 + task_readiness_failure_threshold: + description: Consecutive failure for the probe to be considered failed. + type: integer + default: 3 + task_readiness_success_threshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. + type: integer + default: 1 + task_readiness_timeout: + description: Number of seconds after which the probe times out. + type: integer + default: 10 task_resource_requirements: description: Resource requirements for the task container properties: diff --git a/roles/installer/templates/deployments/deployment.yaml.j2 b/roles/installer/templates/deployments/deployment.yaml.j2 index 5135b7132..02242bb42 100644 --- a/roles/installer/templates/deployments/deployment.yaml.j2 +++ b/roles/installer/templates/deployments/deployment.yaml.j2 @@ -224,6 +224,38 @@ spec: {% if web_extra_env -%} {{ web_extra_env | indent(width=12, first=True) }} {% endif %} + livenessProbe: + exec: + command: + - /usr/bin/awx-manage + - check + initialDelaySeconds: {{ web_liveness_initial_delay }} + periodSeconds: {{ web_liveness_period }} + failureThreshold: {{ web_liveness_failure_threshold }} + successThreshold: {{ web_liveness_success_threshold }} + timeoutSeconds: {{ web_liveness_timeout }} + readinessProbe: + httpGet: + path: /api/v2/ping/ + port: 8052 + scheme: HTTP + initialDelaySeconds: {{ web_readiness_initial_delay }} + periodSeconds: {{ web_readiness_period }} + failureThreshold: {{ web_readiness_failure_threshold }} + successThreshold: {{ web_readiness_success_threshold }} + timeoutSeconds: {{ web_readiness_timeout }} + startupProbe: + exec: + command: + - /bin/bash + - -c + - | + ! awx-manage showmigrations | grep '\[ \]' + initialDelaySeconds: 5 + periodSeconds: 3 + failureThreshold: 900 + successThreshold: 1 + timeoutSeconds: 5 resources: {{ web_resource_requirements }} - image: '{{ _image }}' name: '{{ ansible_operator_meta.name }}-task' @@ -316,6 +348,40 @@ spec: {% if task_extra_env -%} {{ task_extra_env | indent(width=12, first=True) }} {% endif %} + livenessProbe: + exec: + command: + - /bin/bash + - -c + - | + awx-manage run_dispatcher --running | grep '\[\]' + initialDelaySeconds: {{ task_liveness_initial_delay }} + periodSeconds: {{ task_liveness_period }} + failureThreshold: {{ task_liveness_failure_threshold }} + successThreshold: {{ task_liveness_success_threshold }} + timeoutSeconds: {{ task_liveness_timeout }} + readinessProbe: + exec: + command: + - /usr/bin/awx-manage + - check + initialDelaySeconds: {{ task_readiness_initial_delay }} + periodSeconds: {{ task_readiness_period }} + failureThreshold: {{ task_readiness_failure_threshold }} + successThreshold: {{ task_readiness_success_threshold }} + timeoutSeconds: {{ task_readiness_timeout }} + startupProbe: + exec: + command: + - /bin/bash + - -c + - | + ! awx-manage showmigrations | grep '\[ \]' + initialDelaySeconds: 5 + periodSeconds: 3 + failureThreshold: 900 + successThreshold: 1 + timeoutSeconds: 5 resources: {{ task_resource_requirements }} - image: '{{ _control_plane_ee_image }}' name: '{{ ansible_operator_meta.name }}-ee'