Skip to content

Commit

Permalink
Fix calico-node in etcd mode (kubernetes-sigs#10438)
Browse files Browse the repository at this point in the history
* Calico : add ETCD endpoints to install-cni container

* Calico : remove nodename from configmap in etcd mode
  • Loading branch information
olevitt authored and VannTen committed Jan 4, 2024
1 parent 83d5efc commit fc7f3ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions roles/network_plugin/calico/templates/calico-config.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ 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",
Expand Down
7 changes: 7 additions & 0 deletions roles/network_plugin/calico/templates/calico-node.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ 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
Expand Down

0 comments on commit fc7f3ea

Please sign in to comment.