datopian / ckan-cloud-helm

CKAN on Kubernetes (k8s) - Helm charts
https://tech.datopian.com/
MIT License
20 stars 10 forks source link

Add readinessProbe to jobs deployment #41

Closed pdelboca closed 2 years ago

pdelboca commented 2 years ago

This PR adds a readiness probe to ensure that the jobs command has been executed successfully.

This way we can ensure that the pod contains running workers. This will allow silent failings due that the pod is up. but there are no workers running on it.

zelima commented 2 years ago

@pdelboca I've released v0.0.44-rc0 with your changes. And bumped the version in SBX environment. Let's test this in POC as well. We can merge after we are sure it is working and release v0.0.44

zelima commented 2 years ago

On sandbox it went fine

kubectl get deployment jobs -n dataexchange-sbx -o yaml | grep readinessProbe -A 10
        readinessProbe:
          exec:
            command:
            - /bin/sh
            - -c
            - if ! ps -x | grep "bin/ckan jobs worker" | grep -v grep > /dev/null;
              then echo "Jobs worker are not running."; fi;
          failureThreshold: 15
          initialDelaySeconds: 30
          periodSeconds: 5
          successThreshold: 1
zelima commented 2 years ago

@pdelboca Pushed to POC as well. Is there a way to test this and confirm it is working? If so let's test and gonna merge

pdelboca commented 2 years ago

@zelima I changed readiness for liveness since the first one didn't have the intended effect. (Endless restarts without clear notifications on why)

Can we try again with a new release?

zelima commented 2 years ago

v0.0.44-rc1 is released with latest changes

zelima commented 2 years ago

@pdelboca did this work? Can we merge?