From 08ece34aeca2725db3837b93ab964cd9fc67b7b2 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Tue, 1 Feb 2022 10:03:33 +0000 Subject: [PATCH] fix: use dns name to reach rest Using the host name creates a race as rest must start ahead. Instead, simply use the dns name, which will be updated whenever rest is ready. Resolves: https://github.com/openebs/mayastor/issues/1076 --- chart/templates/csi-deployment.yaml | 2 +- chart/templates/msp-deployment.yaml | 2 +- deploy/core-agents-deployment.yaml | 6 ++++-- deploy/csi-deployment.yaml | 5 +++-- deploy/jaeger-operator/deployment.yaml | 11 ----------- deploy/jaeger-operator/jaeger.yaml | 11 ----------- deploy/msp-deployment.yaml | 8 +++++--- deploy/rest-deployment.yaml | 6 ++++-- 8 files changed, 18 insertions(+), 33 deletions(-) diff --git a/chart/templates/csi-deployment.yaml b/chart/templates/csi-deployment.yaml index ac42b5b3c..a2f797ecc 100644 --- a/chart/templates/csi-deployment.yaml +++ b/chart/templates/csi-deployment.yaml @@ -57,7 +57,7 @@ spec: imagePullPolicy: {{ .Values.mayastorCP.pullPolicy }} args: - "--csi-socket=/var/lib/csi/sockets/pluginproxy/csi.sock" - - "--rest-endpoint=http://$(REST_SERVICE_HOST):8081"{{ if .Values.base.jaeger.enabled }} + - "--rest-endpoint=http://rest:8081"{{ if .Values.base.jaeger.enabled }} - "--jaeger={{ .Values.base.jaeger.agent.name }}:{{ .Values.base.jaeger.agent.port }}"{{ end }} env: - name: RUST_LOG diff --git a/chart/templates/msp-deployment.yaml b/chart/templates/msp-deployment.yaml index 1483d9e9b..ced77d79d 100644 --- a/chart/templates/msp-deployment.yaml +++ b/chart/templates/msp-deployment.yaml @@ -26,7 +26,7 @@ spec: image: {{ .Values.mayastorCP.registry }}mayadata/mcp-msp-operator:{{ .Values.mayastorCP.tag }} imagePullPolicy: {{ .Values.mayastorCP.pullPolicy }} args: - - "-e http://$(REST_SERVICE_HOST):8081" + - "-e http://rest:8081" - "--interval={{ .Values.base.cache_poll_period }}"{{ if .Values.base.jaeger.enabled }} - "--jaeger={{ .Values.base.jaeger.agent.name }}:{{ .Values.base.jaeger.agent.port }}"{{ end }} env: diff --git a/deploy/core-agents-deployment.yaml b/deploy/core-agents-deployment.yaml index 797a270b8..b237c5fd0 100644 --- a/deploy/core-agents-deployment.yaml +++ b/deploy/core-agents-deployment.yaml @@ -23,13 +23,15 @@ spec: - command: - sh - -c - - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep 1; done; + - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep + 1; done; image: busybox:latest name: nats-probe - command: - sh - -c - - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd..."; sleep 1; done; + - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd..."; + sleep 1; done; image: busybox:latest name: etcd-probe containers: diff --git a/deploy/csi-deployment.yaml b/deploy/csi-deployment.yaml index 7bcc1e974..989c1de1a 100644 --- a/deploy/csi-deployment.yaml +++ b/deploy/csi-deployment.yaml @@ -26,7 +26,8 @@ spec: - command: - sh - -c - - trap "exit 1" TERM; until nc -vz rest 8081; do echo "Waiting for REST API endpoint to become available"; sleep 1; done; + - trap "exit 1" TERM; until nc -vz rest 8081; do echo "Waiting for REST API endpoint + to become available"; sleep 1; done; image: busybox:latest name: rest-probe containers: @@ -69,7 +70,7 @@ spec: imagePullPolicy: IfNotPresent args: - "--csi-socket=/var/lib/csi/sockets/pluginproxy/csi.sock" - - "--rest-endpoint=http://$(REST_SERVICE_HOST):8081" + - "--rest-endpoint=http://rest:8081" env: - name: RUST_LOG value: info diff --git a/deploy/jaeger-operator/deployment.yaml b/deploy/jaeger-operator/deployment.yaml index 690dbdf1a..36549d512 100644 --- a/deploy/jaeger-operator/deployment.yaml +++ b/deploy/jaeger-operator/deployment.yaml @@ -45,14 +45,3 @@ spec: value: "mayastor-jaeger-operator" resources: {} - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/master - operator: In - values: - - "" - tolerations: - - key: node-role.kubernetes.io/master diff --git a/deploy/jaeger-operator/jaeger.yaml b/deploy/jaeger-operator/jaeger.yaml index edf7a5ec5..722e2e5ae 100644 --- a/deploy/jaeger-operator/jaeger.yaml +++ b/deploy/jaeger-operator/jaeger.yaml @@ -9,17 +9,6 @@ spec: strategy: allInOne ingress: enabled: false - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/master - operator: In - values: - - "" - tolerations: - - key: node-role.kubernetes.io/master query: serviceType: NodePort nodePort: 30012 diff --git a/deploy/msp-deployment.yaml b/deploy/msp-deployment.yaml index 7dccfaad4..748e468f8 100644 --- a/deploy/msp-deployment.yaml +++ b/deploy/msp-deployment.yaml @@ -24,13 +24,15 @@ spec: - command: - sh - -c - - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep 1; done; + - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep + 1; done; image: busybox:latest name: nats-probe - command: - sh - -c - - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd..."; sleep 1; done; + - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd..."; + sleep 1; done; image: busybox:latest name: etcd-probe containers: @@ -45,7 +47,7 @@ spec: image: mayadata/mcp-msp-operator:v1.0.0 imagePullPolicy: IfNotPresent args: - - "-e http://$(REST_SERVICE_HOST):8081" + - "-e http://rest:8081" - "--interval=30s" env: - name: RUST_LOG diff --git a/deploy/rest-deployment.yaml b/deploy/rest-deployment.yaml index 197810c9b..e0033c726 100644 --- a/deploy/rest-deployment.yaml +++ b/deploy/rest-deployment.yaml @@ -23,13 +23,15 @@ spec: - command: - sh - -c - - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep 1; done; + - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep + 1; done; image: busybox:latest name: nats-probe - command: - sh - -c - - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd..."; sleep 1; done; + - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd..."; + sleep 1; done; image: busybox:latest name: etcd-probe containers: