diff --git a/.config.sample.env b/.config.sample.env index ffc06277..7a79482c 100644 --- a/.config.sample.env +++ b/.config.sample.env @@ -43,7 +43,7 @@ export BOOTSTRAP_ANSIBLE_KUBE_VIP_INTERFACE="" # Pick a unused IP that is on the same network as your nodes # and also outside the ${BOOTSTRAP_METALLB_TRAEFIK_ADDR} range # e.g. 192.168.1.254 -export BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS="" +export BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR="" # # Default prefixes for hostnames assigned by Ansible diff --git a/configure.sh b/configure.sh index 182bde92..4af09810 100755 --- a/configure.sh +++ b/configure.sh @@ -174,8 +174,8 @@ verify_binaries() { } verify_kubevip() { - _has_envar "BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS" - _has_valid_ip "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS}" "BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS" + _has_envar "BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR" + _has_valid_ip "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" "BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR" } verify_metallb() { @@ -284,18 +284,18 @@ 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}'" + if [[ "${!node_addr}" == "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" ]]; then + _log "ERROR" "The kube-vip IP '${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}' 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}'" + 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}'" + 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 diff --git a/tmpl/ansible/kube-vip.yml b/tmpl/ansible/kube-vip.yml index 6e901889..acbf087d 100644 --- a/tmpl/ansible/kube-vip.yml +++ b/tmpl/ansible/kube-vip.yml @@ -2,4 +2,4 @@ # (string) The interface on the host kube-vip should attach to kubevip_interface: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_INTERFACE}" # (string) The ARP address kube-vip broadcasts -kubevip_address: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS}" +kubevip_address: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" diff --git a/tmpl/cluster/kube-vip-daemonset.yaml b/tmpl/cluster/kube-vip-daemonset.yaml index 78c37f4f..01e1ded0 100644 --- a/tmpl/cluster/kube-vip-daemonset.yaml +++ b/tmpl/cluster/kube-vip-daemonset.yaml @@ -40,7 +40,7 @@ spec: - name: svc_enable value: "false" - name: address - value: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDRESS}" + value: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" securityContext: capabilities: add: