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

HostEndpoint node selector + interface name regexp #8840

Open
jonas-jasas opened this issue May 20, 2024 · 5 comments
Open

HostEndpoint node selector + interface name regexp #8840

jonas-jasas opened this issue May 20, 2024 · 5 comments

Comments

@jonas-jasas
Copy link

Feature request

To reduce HostEndpoint resource count in case of multiple node scenario, would be great to have HostEndpoint node selector (based on k8s labels) and interface name match using regexp.

@caseydavenport
Copy link
Member

@jonas-jasas could you provide some more details about what you are looking for here?

  • How have you configured your cluster's host endpoints?
  • How many host endpoints do you have?
  • Are these host endpoints causing problems?
@JonasJasas
Copy link

  • Using Calico Operator
  • 10
  • No

Each node has 4 network interfaces, so I have to create 40 HostEndpoint resources instead of 4.

@caseydavenport
Copy link
Member

Have you considered Calico's auto host endpoint feature? https://docs.tigera.io/calico/latest/network-policy/hosts/kubernetes-nodes#automatic-host-endpoints

Calico can create a single host endpoint per-node that represents all interfaces on the node.

@JonasJasas
Copy link

Is it possible to classify which interface is external which internal using auto host endpoint feature? In my case I do this:

apiVersion: projectcalico.org/v3
kind: HostEndpoint
metadata:
  name: stag-hw1-eth1
  labels:
    role: worker-ext
spec:
  interfaceName: eth1
  node: stag-hw1

---

apiVersion: projectcalico.org/v3
kind: HostEndpoint
metadata:
  name: stag-hw1-eth3
  labels:
    role: worker-ext
spec:
  interfaceName: eth3
  node: stag-hw1

---

apiVersion: projectcalico.org/v3
kind: HostEndpoint
metadata:
  name: stag-hw2-eth1
  labels:
    role: worker-ext
spec:
  interfaceName: eth1
  node: stag-hw2

---

apiVersion: projectcalico.org/v3
kind: HostEndpoint
metadata:
  name: stag-hw2-eth3
  labels:
    role: worker-ext
spec:
  interfaceName: eth3
  node: stag-hw2
@caseydavenport
Copy link
Member

Ah right. No, if you want to be able to treat different interfaces on the same node differently, then today you would need to create HEPs for each.

I think it would be a nice enhancement if we did what you originally suggested, then - a node selector and regex matching on interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants