Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CALICO-IPAM not using NODENAME nor FELIX_FELIXHOSTNAME #826

Closed
frederic-loui opened this issue Jun 1, 2017 · 2 comments · Fixed by projectcalico/cni-plugin#375
Closed
Assignees
Labels
Milestone

Comments

@frederic-loui
Copy link

When a pod is created on a cluster with minions having multiple interface. Calico/Felix does not use NODENAME / FELIX_FELIXHOSTNAME but still use "get_host_by_name()" in order to write the key in etcd.

Expected Behavior

In etcd the key written should be in the form:
/calico/ipam/v2/host//ipv4/block/192.168.3.128-26
Now it is still in the form:
/calico/ipam/v2/host/<sys.gethostbyname()>/ipv4/block/192.168.3.128-26

calico/felix should use NODENAME or FELIX_FELIXHOSTNAME when precised.

Current Behavior

The result is that only /32 route to pod is advertised and not the right /26
host-local tested and calico-ipam node tested.

Possible Solution

calico/felix should use NODENAME or FELIX_FELIXHOSTNAME when precised.

Steps to Reproduce (for bugs)

  1. fired up a k8s cluster with multiple interface
  2. use IP address for NODENAME or FELX_FELIXNODENAME in cni config an systemd calico config
  3. establish BGP
  4. ls --recursively etcd database you'll see different /26 allocation s

Context

Only /32 pod route were advertised into the cluster. Not the /26.

Your Environment

  • Calico version: 2.2
  • Orchestrator version (e.g. kubernetes, mesos, rkt): kubernetes 1.6.4
  • Operating System and version: Ubuntu 16.04
@caseydavenport
Copy link
Member

Hm. It's not Felix that writes those values into etcd, rather it's the calico-ipam CNI plugin. What does your CNI config look like? Does it have a hostname or nodename specified?

@frederic-loui
Copy link
Author

frederic-loui commented Jun 1, 2017

Thanks for the clarification/precision.
When my workers start I use the environment variable: NODENAME=10.1.0.2 and in doubt also set HOSTNAME=10.1.0.2. etcd reflect everything but when I fire up a pod the hostname()=kube2-2 is written into etcd insteadd of 10.1.0.2. I've corrected my CNI config file and removed "nodename": "10.1.0.2" and used the hostname as NODENAME. (i.e NODENAME=kube2-2) that fixed the issue. But I feel that this is not the right behaviour. If NODENAME is precised, calico-ipam should use it and write into etcd NODENAME value and not use gethostbyname() function.

My CNI config:

{
    "name": "calico-k8s-network",
    "nodename": "10.1.0.2"
    "cniVersion": "0.1.0",
    "type": "calico",
    "etcd_endpoints": "https://172.16.1.1:2379",
    "etcd_ca_cert_file": "/var/lib/kubernetes/ca.pem",
    "etcd_cert_file": "/var/lib/kubernetes/kubernetes.pem",
    "etcd_key_file": "/var/lib/kubernetes/kubernetes-key.pem",
    "log_level": "info",
    "ipam": {
        "type": "calico-ipam",
        "assign_ipv4": "true",
        "assign_ipv6": "false",
        "ipv4_pools": ["192.168.2.0/24"]
    },
    "policy": {
        "type": "k8s"
    },
    "kubernetes": {
        "kubeconfig": "/var/lib/kubelet/kubeconfig"
    }
}

@frederic-loui frederic-loui changed the title CALICO/FELIX not using NODENAME nor FELIX_FELIXHOSTNAME CALICO-IPAM not using NODENAME nor FELIX_FELIXHOSTNAME Jun 2, 2017
@heschlie heschlie self-assigned this Sep 1, 2017
caseydavenport pushed a commit that referenced this issue Dec 14, 2021
…-release-v3.20

[release-v3.20] Semaphore Auto Pin Update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants