summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2021-01-25 07:44:49 +0100
committerKonrad Ba?ka <k.banka@samsung.com>2021-01-26 12:20:34 +0000
commitee6adc26d171a2a005955f7e6a65f5d3af8c04df (patch)
tree2e1169a8e84cf4d384ccfd2824162137a7a5bfe4
parent755be6d61e2704f1f87281f1701c6747cf101260 (diff)
[COMMON][ETCD] Skip startup self-discovery for etcd nodesfrankfurt
Current startup script of etcd checks whether all assumed other nodes are already running, before proceeding. This check, however, also includes checking localhost, but due to using headless service statefulset pod DNS discovery, it doesnt succeed immediately. In some deployments k8s DNS server may be laggy, thus failing startup script to finish before liveness check. This patch fixes such failures of 1 pod etcd clusters, and improves startup time for any size ones. Signed-off-by: Konrad Bańka <k.banka@samsung.com> Issue-ID: OOM-2668 Change-Id: I2f9263a0f4964b0a495631775d0cbbceef25e85b
-rw-r--r--kubernetes/common/etcd/templates/statefulset.yaml4
1 files changed, 4 insertions, 0 deletions
diff --git a/kubernetes/common/etcd/templates/statefulset.yaml b/kubernetes/common/etcd/templates/statefulset.yaml
index 96cda89c1f..b09e7c6c14 100644
--- a/kubernetes/common/etcd/templates/statefulset.yaml
+++ b/kubernetes/common/etcd/templates/statefulset.yaml
@@ -128,6 +128,10 @@ spec:
# we should wait for other pods to be up before trying to join
# otherwise we got "no such host" errors when trying to resolve other members
for i in $(seq 0 $((${INITIAL_CLUSTER_SIZE} - 1))); do
+ if [ "${SET_NAME}-${i}" == "${HOSTNAME}" ]; then
+ echo "Skipping self-checking"
+ continue
+ fi
while true; do
echo "Waiting for ${SET_NAME}-${i}.${SERVICE_NAME} to come up"
ping -W 1 -c 1 ${SET_NAME}-${i}.${SERVICE_NAME} > /dev/null && break