fix: add validations for node IPs and load balancer IPs
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
2 files changed
+18
-1
No files matched your search
@@ -284,6 +284,21 @@ verify_ansible_hosts() {
|
||||
_has_envar "${node_control}"
|
||||
_has_optional_envar "${node_hostname}"
|
||||
|
||||
if [[ "${node_addr}" == "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS}" ]]; then
|
||||
_log "ERROR" "The kube-vip IP '${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS}' should not be the same as the IP for node '${node_addr}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${node_addr}" == "${BOOTSTRAP_METALLB_K8S_GATEWAY_ADDR}" ]]; then
|
||||
_log "ERROR" "The k8s-gateway load balancer IP '${BOOTSTRAP_METALLB_K8S_GATEWAY_ADDR}' should not be the same as the IP for node '${node_addr}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${node_addr}" == "${BOOTSTRAP_METALLB_TRAEFIK_ADDR}" ]]; then
|
||||
_log "ERROR" "The traefik load balancer IP '${BOOTSTRAP_METALLB_TRAEFIK_ADDR}' should not be the same as the IP for node '${node_addr}'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ssh -q -o BatchMode=yes -o ConnectTimeout=5 "${!node_username}"@"${!var}" "true"; then
|
||||
_log "INFO" "Successfully SSH'ed into host '${!var}' with username '${!node_username}'"
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user