fix: allow overriding node-ip
diff --git a/roles/kubernetes/defaults/main.yml b/roles/kubernetes/defaults/main.yml
index c834aae..1cbfc72 100644
--- a/roles/kubernetes/defaults/main.yml
+++ b/roles/kubernetes/defaults/main.yml
@@ -73,3 +73,6 @@
openvswitch: enabled
# ]]]
+
+# Node IP address
+kubernetes_node_ip: "{{ ansible_default_ipv4.address }}"
diff --git a/roles/kubernetes/templates/kubeadm.yaml.j2 b/roles/kubernetes/templates/kubeadm.yaml.j2
index 4179141..7f5cd59 100644
--- a/roles/kubernetes/templates/kubeadm.yaml.j2
+++ b/roles/kubernetes/templates/kubeadm.yaml.j2
@@ -7,7 +7,7 @@
kubeletExtraArgs:
cgroups-per-qos: "false"
enforce-node-allocatable: ""
- node-ip: "{{ ansible_default_ipv4.address }}"
+ node-ip: "{{ kubernetes_node_ip }}"
container-runtime: "remote"
container-runtime-endpoint: "{{ kubernetes_cri_socket }}"
---
@@ -17,7 +17,7 @@
kubeletExtraArgs:
cgroups-per-qos: "false"
enforce-node-allocatable: ""
- node-ip: "{{ ansible_default_ipv4.address }}"
+ node-ip: "{{ kubernetes_node_ip }}"
container-runtime: "remote"
container-runtime-endpoint: "{{ kubernetes_cri_socket }}"
{% if (_kubernetes_bootstrap_node is not defined) or (_kubernetes_bootstrap_node is defined and inventory_hostname != _kubernetes_bootstrap_node) %}