Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
kurokobo opened this issue Mar 21, 2024 · 1 comment · Fixed by #1786
Closed
3 tasks done

Comments

@kurokobo
Copy link
Contributor

kurokobo commented Mar 21, 2024

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"
}
@kurokobo
Copy link
Contributor Author

@dhageman @chrismeyersfsu @kdelee @rooftopcellist
F.Y.I.
I believe no one has tested web_readiness_period at all before merging 😞
Or can httpGet be under exec by some way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant