The blog about containerisation, virtual machines and useful shell snippets and findings

initContainer and rabbit mq checks in k8s pod

Sometimes you need to implement ordered loading for the pods. Say, launch rabbit mq container first, than your app container. This could be done using initContainer concept.

Put this into values.yaml of your helm chart definition

  host: rabbit

and this to the app deployment.yaml definition

        - name: check-rabbit-ready
          command: ['sh', '-c', 'until nc -vz {{ }} 5672; do echo "Waiting for rabbit service"; sleep 2; done;']