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

fix: correct readinessProbe for web pod #1786

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

kurokobo
Copy link
Contributor

@kurokobo kurokobo commented Mar 21, 2024

SUMMARY

Closes #1785

This PR corrects readinessProbe for web pod.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
ADDITIONAL INFORMATION

Tested locally:

# Build and deploy custom Operator
$ IMG=registry.example.com/ansible/awx-operator:readiness \
  BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=24.0.0" \
  make docker-build docker-push deploy

# Deploy minimal AWX CR
$ cat ./minimal-awx.yaml 
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  namespace: awx
  name: awx-demo
spec:
  service_type: nodeport
  web_readiness_period: 5
  web_liveness_period: 5

$ kubectl apply -f ./minimal-awx.yaml 

Result:

$ kubectl -n awx get deployment awx-demo-web -o yaml
apiVersion: apps/v1
kind: Deployment
...
spec:
  ...
  template:
    ...
    spec:
      containers:
      - args:
        ...
      - args:
        - /usr/bin/launch_awx_web.sh
        env:
        - name: AWX_COMPONENT
          value: web
        - name: SUPERVISOR_CONFIG_PATH
          value: /etc/supervisord_web.conf
        - name: MY_POD_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: MY_POD_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.podIP
        - name: UWSGI_MOUNT_PATH
          value: /
        image: quay.io/ansible/awx:24.0.0
        imagePullPolicy: IfNotPresent
        livenessProbe:   ✅
          exec:
            command:
            - sh
            - -c
            - |
              (exit $(/usr/bin/supervisorctl -c /etc/supervisord_task.conf status | grep -vc RUNNING))
          failureThreshold: 3
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 1
        name: awx-demo-web
        ports:
        - containerPort: 8052
          protocol: TCP
        readinessProbe:   ✅
          failureThreshold: 3
          httpGet:
            path: /api/v2/ping/
            port: 8052
            scheme: HTTP
          initialDelaySeconds: 20
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        ...

@kurokobo kurokobo changed the title fix: correct readinesProbe for web pod fix: correct readinessProbe for web pod Mar 21, 2024
Copy link
Member

@rooftopcellist rooftopcellist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Good find.

@rooftopcellist rooftopcellist merged commit a6e7a1b into ansible:devel Mar 27, 2024
9 checks passed
@kurokobo kurokobo deleted the web_readiness branch April 1, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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