Skip to content

Commit

Permalink
CAS-481: wait for message bus
Browse files Browse the repository at this point in the history
On k8s, even before even attempting to start mayastor we should make
sure that the nats service is ready.
  • Loading branch information
tiagolobocastro committed Oct 7, 2020
1 parent fb10129 commit 76bbdae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion deploy/mayastor-daemonset-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions deploy/mayastor-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,8 +46,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: IMPORT_NEXUSES
value: "false"
args:
- "-N$(MY_NODE_NAME)"
- "-g$(MY_POD_IP)"
Expand Down

0 comments on commit 76bbdae

Please sign in to comment.