Skip to content

If readines probe for web pod is enabled, deployment failed due to broken readinessProbe structure #1785

@kurokobo

Description

@kurokobo

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that the AWX Operator is open source software provided for free and that I might not receive a timely response.

Bug Summary

Deployment of AWX with web_readiness_period can't be succeeded due to broken readinessProbe.

httpGet cannot be under exec, but should be under readinessProbe:

readinessProbe:
exec:
httpGet:
path: /api/v2/ping/
scheme: HTTP
port: 8052

Patch:

diff --git a/roles/installer/templates/deployments/web.yaml.j2 b/roles/installer/templates/deployments/web.yaml.j2
index 568a6d6..64b3217 100644
--- a/roles/installer/templates/deployments/web.yaml.j2
+++ b/roles/installer/templates/deployments/web.yaml.j2
@@ -178,11 +178,10 @@ spec:
 {% endif %}
 {% if web_readiness_period|int > 0 %}
           readinessProbe:
-            exec:
-              httpGet:
-                path: /api/v2/ping/
-                scheme: HTTP
-                port: 8052
+            httpGet:
+              path: /api/v2/ping/
+              scheme: HTTP
+              port: 8052
             initialDelaySeconds: {{ web_readiness_initial_delay }}
             periodSeconds: {{ web_readiness_period }}
             failureThreshold: {{ web_readiness_failure_threshold }}

Refer to: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/

AWX Operator version

2.13.1

AWX version

24.0.0

Kubernetes platform

kubernetes

Kubernetes/Platform version

k3s version v1.28.7+k3s1

Modifications

no

Steps to reproduce

Deploy AWX Operator 2.13.1 and minimal AWX CR with web_readiness_period

---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  namespace: awx
  name: awx-demo
spec:
  service_type: nodeport
  web_readiness_period: 15
  web_liveness_period: 15

Expected results

Deployment is successfully completed.

Actual results

The task "Apply deployment resources" is failed.

Additional information

Related to: #1674

Operator Logs

Errors on Operator (formatted):

TASK [installer : Apply deployment resources] **********************************
task path: /opt/ansible/roles/installer/tasks/resources_configuration.yml:248
failed: [localhost] (item=web) => {
	"ansible_loop_var": "item", "changed": false, "item": "web", "msg": "Failed to apply object: b'{
		"kind":"Status",
		"apiVersion":"v1",
		"metadata":{},
		"status":"Failure",
		"message":"Deployment.apps "awx-demo-web" is invalid: spec.template.spec.containers[1].readinessProbe.exec.command: Required value",
		"reason":"Invalid",
		"details":{
			"name":"awx-demo-web",
			"group":"apps",
			"kind":"Deployment",
			"causes":[{
				"reason":"FieldValueRequired",
				"message":"Required value",
				"field":"spec.template.spec.containers[1].readinessProbe.exec.command"
			}]
		},"code":422
	}'", "reason": "Unprocessable Entity"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions