From b4799157370294ae2d47e15cdcb3ff4b991e052a Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Fri, 6 May 2022 13:44:41 -0400 Subject: [PATCH] feat!: rename BOOTSTRAP_ANSIBLE_KUBE_VIP_* to BOOTSTRAP_KUBE_VIP_* Signed-off-by: Devin Buhl --- .config.sample.env | 18 ++++++++++++------ configure.sh | 8 ++++---- tmpl/ansible/kube-vip.yml | 4 ++-- tmpl/cluster/kube-vip-daemonset.yaml | 4 ++-- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.config.sample.env b/.config.sample.env index 891458bd..a43eef21 100644 --- a/.config.sample.env +++ b/.config.sample.env @@ -5,11 +5,13 @@ # The repo you created from this template # e.g. https://github.com/k8s-at-home/home-cluster export BOOTSTRAP_GIT_REPOSITORY="" + # To enable Flux to update your cluster on `git push` set the following to one of: # `ignored` - this feature will be disabled # `generated` - this will generate a token and print it in the logs # Set this to any other string and it will be used for the secret export BOOTSTRAP_FLUX_GITHUB_WEBHOOK_SECRET="ignored" + # Choose one of your cloudflare domains # e.g. k8s-at-home.com export BOOTSTRAP_CLOUDFLARE_DOMAIN="" @@ -17,6 +19,7 @@ export BOOTSTRAP_CLOUDFLARE_DOMAIN="" export BOOTSTRAP_CLOUDFLARE_EMAIL="" # Your global Cloudflare API Key export BOOTSTRAP_CLOUDFLARE_APIKEY="" + # Pick a range of unused IPs that are on the same network as your nodes # You don't need many IPs, just choose 10 IPs to start with # e.g. 192.168.1.220-192.168.1.230 @@ -28,24 +31,27 @@ export BOOTSTRAP_METALLB_K8S_GATEWAY_ADDR="" # that doesn't conflict with any other IP addresses here # e.g. 192.168.1.221 export BOOTSTRAP_METALLB_TRAEFIK_ADDR="" + # Age Public Key - string should start with age # e.g. age15uzrw396e67z9wdzsxzdk7ka0g2gr3l460e0slaea563zll3hdfqwqxdta export BOOTSTRAP_AGE_PUBLIC_KEY="" -# -# Ansible related variables -# - # The network interface on the host kube-vip should attach to # Look this up on your nodes to verify what NIC to use +# This name should be the same across your nodes, see: +# https://github.com/k8s-at-home/template-cluster-k3s/issues/310 # e.g. eno1 -export BOOTSTRAP_ANSIBLE_KUBE_VIP_INTERFACE="" +export BOOTSTRAP_KUBE_VIP_INTERFACE="" # The IP Address to use with KubeVIP # Pick a unused IP that is on the same network as your nodes # and outside the ${BOOTSTRAP_METALLB_LB_RANGE} range # and doesn't conflict with any other IP addresses here # e.g. 192.168.1.254 -export BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR="" +export BOOTSTRAP_KUBE_VIP_ADDR="" + +# +# Ansible related variables +# # # Default prefixes for hostnames assigned by Ansible diff --git a/configure.sh b/configure.sh index 4af09810..d51a8d9a 100755 --- a/configure.sh +++ b/configure.sh @@ -174,8 +174,8 @@ verify_binaries() { } verify_kubevip() { - _has_envar "BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR" - _has_valid_ip "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" "BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR" + _has_envar "BOOTSTRAP_KUBE_VIP_ADDR" + _has_valid_ip "${BOOTSTRAP_KUBE_VIP_ADDR}" "BOOTSTRAP_KUBE_VIP_ADDR" } verify_metallb() { @@ -284,8 +284,8 @@ verify_ansible_hosts() { _has_envar "${node_control}" _has_optional_envar "${node_hostname}" - 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}'" + if [[ "${!node_addr}" == "${BOOTSTRAP_KUBE_VIP_ADDR}" ]]; then + _log "ERROR" "The kube-vip IP '${BOOTSTRAP_KUBE_VIP_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 acbf087d..2449053b 100644 --- a/tmpl/ansible/kube-vip.yml +++ b/tmpl/ansible/kube-vip.yml @@ -1,5 +1,5 @@ --- # (string) The interface on the host kube-vip should attach to -kubevip_interface: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_INTERFACE}" +kubevip_interface: "${BOOTSTRAP_KUBE_VIP_INTERFACE}" # (string) The ARP address kube-vip broadcasts -kubevip_address: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" +kubevip_address: "${BOOTSTRAP_KUBE_VIP_ADDR}" diff --git a/tmpl/cluster/kube-vip-daemonset.yaml b/tmpl/cluster/kube-vip-daemonset.yaml index 01e1ded0..25e619a1 100644 --- a/tmpl/cluster/kube-vip-daemonset.yaml +++ b/tmpl/cluster/kube-vip-daemonset.yaml @@ -28,7 +28,7 @@ spec: - name: vip_arp value: "true" - name: vip_interface - value: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_INTERFACE}" + value: "${BOOTSTRAP_KUBE_VIP_INTERFACE}" - name: port value: "6443" - name: vip_cidr @@ -40,7 +40,7 @@ spec: - name: svc_enable value: "false" - name: address - value: "${BOOTSTRAP_ANSIBLE_KUBE_VIP_ADDR}" + value: "${BOOTSTRAP_KUBE_VIP_ADDR}" securityContext: capabilities: add: