From 76bbdaed64ce9b65b866bcf145dbaf11eb0dc0c4 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Wed, 7 Oct 2020 15:19:45 +0100 Subject: [PATCH] CAS-481: wait for message bus On k8s, even before even attempting to start mayastor we should make sure that the nats service is ready. --- deploy/mayastor-daemonset-config.yaml | 6 +++++- deploy/mayastor-daemonset.yaml | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/deploy/mayastor-daemonset-config.yaml b/deploy/mayastor-daemonset-config.yaml index e39adb9cf..578a685c4 100644 --- a/deploy/mayastor-daemonset-config.yaml +++ b/deploy/mayastor-daemonset-config.yaml @@ -29,9 +29,13 @@ spec: # belong to Guaranteed QoS class, hence can never get evicted in case of # pressure unless they exceed those limits. limits and requests must be # the same. + initContainers: + - name: message-bus-probe + image: busybox:latest + command: ['sh', '-c', 'until nc -vz nats 4222; do echo "Waiting for message bus..."; sleep 1; done;'] containers: - name: mayastor - image: 192.168.1.119:5000/mayastor:dev + image: mayadata/mayastor:latest imagePullPolicy: Always env: - name: MY_NODE_NAME diff --git a/deploy/mayastor-daemonset.yaml b/deploy/mayastor-daemonset.yaml index 18afd1f30..69e3c62a7 100644 --- a/deploy/mayastor-daemonset.yaml +++ b/deploy/mayastor-daemonset.yaml @@ -29,6 +29,10 @@ spec: # belong to Guaranteed QoS class, hence can never get evicted in case of # pressure unless they exceed those limits. limits and requests must be # the same. + initContainers: + - name: message-bus-probe + image: busybox:latest + command: ['sh', '-c', 'until nc -vz nats 4222; do echo "Waiting for message bus..."; sleep 1; done;'] containers: - name: mayastor image: mayadata/mayastor:latest @@ -42,8 +46,6 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - - name: IMPORT_NEXUSES - value: "false" args: - "-N$(MY_NODE_NAME)" - "-g$(MY_POD_IP)"