diff --git a/roles/network_plugin/calico/templates/calico-config.yml.j2 b/roles/network_plugin/calico/templates/calico-config.yml.j2 index 26983ecaed4..0ce03aa056a 100644 --- a/roles/network_plugin/calico/templates/calico-config.yml.j2 +++ b/roles/network_plugin/calico/templates/calico-config.yml.j2 @@ -36,6 +36,12 @@ data: {% if calico_datastore == "kdd" %} "datastore_type": "kubernetes", "nodename": "__KUBERNETES_NODE_NAME__", + {% else %} + {% if cloud_provider is defined %} + "nodename": "{{ calico_kubelet_name.stdout }}", + {% else %} + "nodename": "{{ calico_baremetal_nodename }}", + {% endif %} {% endif %} "type": "calico", "log_level": "info", @@ -102,4 +108,3 @@ data: } ] } - diff --git a/roles/network_plugin/calico/templates/calico-node.yml.j2 b/roles/network_plugin/calico/templates/calico-node.yml.j2 index 509201152c0..f3d52201fe2 100644 --- a/roles/network_plugin/calico/templates/calico-node.yml.j2 +++ b/roles/network_plugin/calico/templates/calico-node.yml.j2 @@ -96,13 +96,6 @@ spec: # Prevents the container from sleeping forever. - name: SLEEP value: "false" -{% if calico_datastore == "etcd" %} - - name: ETCD_ENDPOINTS - valueFrom: - configMapKeyRef: - name: calico-config - key: etcd_endpoints -{% endif %} {% if calico_datastore == "kdd" %} # Set the hostname based on the k8s node name. - name: KUBERNETES_NODE_NAME