From 4f9def0ebe946035bd8e7558e1a36cb3300f45be Mon Sep 17 00:00:00 2001 From: portdirect Date: Thu, 18 Jan 2018 21:42:01 -0500 Subject: [PATCH] Validate that node hostname matches the kube node name before join This PS validates that the node hostname matches the kube node name before attempting to join the cluster. Change-Id: Ib8e0d4e91c29203e9d8a48f081c88991d513acef Partial-Bug: https://github.com/att-comdev/promenade/issues/49 --- promenade/templates/scripts/genesis.sh | 5 +++++ promenade/templates/scripts/join.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/promenade/templates/scripts/genesis.sh b/promenade/templates/scripts/genesis.sh index 795cfe92..c4150992 100644 --- a/promenade/templates/scripts/genesis.sh +++ b/promenade/templates/scripts/genesis.sh @@ -1,3 +1,8 @@ +if [ "$(hostname)" != "{{ config['Genesis:hostname'] }}" ]; then + echo "The node hostname must match the Kubernetes node name" 1>&2 + exit 1 +fi + {% include "header.sh" with context %} {% include "up.sh" with context %} diff --git a/promenade/templates/scripts/join.sh b/promenade/templates/scripts/join.sh index 2e0fcbfe..acd1eef7 100644 --- a/promenade/templates/scripts/join.sh +++ b/promenade/templates/scripts/join.sh @@ -1,3 +1,8 @@ +if [ "$(hostname)" != "{{ config['KubernetesNode:hostname'] }}" ]; then + echo "The node hostname must match the Kubernetes node name" 1>&2 + exit 1 +fi + {% include "header.sh" with context %} {% include "up.sh" with context %}