Ivan
Ivan

Reputation: 21

Kubernetes - calico IP_AUTODETECTION_METHOD impossible to set

I want to force the interface, setting the IP_AUTODETECTION_METHOD:

$ kubectl set env daemonset/calico-node -n calico-system IP_AUTODETECTION_METHOD=interface=ens192
  daemonset.apps/calico-node env updated

But nothing happens:

$ kubectl set env daemonset/calico-node -n calico-system --list | grep IP_AUTODETECTION_METHOD
  IP_AUTODETECTION_METHOD=first-found

Upvotes: 2

Views: 4618

Answers (3)

Taha Yousuf Ali
Taha Yousuf Ali

Reputation: 11

kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=interface=ens192 # replace with your interface

screenshot

Restart the calico pod after running this command and it should work fine as it will now use your desired interface.

Upvotes: 1

Rafał Dziwiński
Rafał Dziwiński

Reputation: 1

You have to change it via tigera-operator like this:

kind: Installation
apiVersion: operator.tigera.io/v1
metadata:
  name: default
  namespace: tigera-operator
spec:
  calicoNetwork:
    nodeAddressAutodetectionV4:
      cidrs:
        - "10.44.0.0/22"

At this example node interial Ips are at 10.44.0.0/22 CIDR.

Upvotes: 0

FLBzh
FLBzh

Reputation: 141

On my cluster, running this:

kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=interface=vbmgt0

from the control node did the trick as expected.

Are you running kubectl from the proper node ?

Upvotes: 1

Related Questions