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

daemon: Make --devices to accept names with wildcards #15693

Closed
brb opened this issue Apr 14, 2021 · 1 comment · Fixed by #15697
Closed

daemon: Make --devices to accept names with wildcards #15693

brb opened this issue Apr 14, 2021 · 1 comment · Fixed by #15697
Assignees
Labels
area/daemon Impacts operation of the Cilium daemon. kind/feature This introduces new functionality.

Comments

@brb
Copy link
Member

brb commented Apr 14, 2021

Currently, the cilium-agent's flag --devices allows a user to specify devices to which bpf_host program should be attached (the latter is responsible for NodePort BPF, host-fw, etc).

This works fine in a homogeneous cluster in which all to-be attached devices are named the same. The problem arises when this is not the case, as cilium-agent panics if it cannot find any user specified device.

To fix this, we could add iptables-style matching:

If the interface name ends in a "+", then any interface which begins with this name will match.

So for example, if user specifies --devices=eth+,en+, then the program should be attached to any matching device (eth0, eth1, eth2, en0, etc).

If a given interface name doesn't match any device, the cilium-agent should not panic.

@brb brb added kind/feature This introduces new functionality. area/daemon Impacts operation of the Cilium daemon. labels Apr 14, 2021
@joamaki
Copy link
Contributor

joamaki commented Apr 14, 2021

Alternatively I suppose the wildcard syntax could be in the style of shell globs (e.g. implemented with https://golang.org/pkg/path/filepath/#Match) or as regexp. Any idea how much flexibility is needed? Do we know of a specific case where the current --devices flag fell short?

joamaki added a commit to joamaki/cilium that referenced this issue Apr 28, 2021
This adds support for device name wildcards to the "--devices"
option, e.g. if user specifies "--devices=eth+,en+" the agent
will match devices eth0, eth1, en0, etc.

Fixes: cilium#15693

Signed-off-by: Jussi Maki <jussi@isovalent.com>
joestringer pushed a commit that referenced this issue Apr 28, 2021
This adds support for device name wildcards to the "--devices"
option, e.g. if user specifies "--devices=eth+,en+" the agent
will match devices eth0, eth1, en0, etc.

Fixes: #15693

Signed-off-by: Jussi Maki <jussi@isovalent.com>
christarazi pushed a commit to christarazi/cilium that referenced this issue May 6, 2021
[ upstream commit efb3a72 ]

This adds support for device name wildcards to the "--devices"
option, e.g. if user specifies "--devices=eth+,en+" the agent
will match devices eth0, eth1, en0, etc.

Fixes: cilium#15693

Signed-off-by: Jussi Maki <jussi@isovalent.com>
Signed-off-by: Chris Tarazi <chris@isovalent.com>
joestringer pushed a commit that referenced this issue May 6, 2021
[ upstream commit efb3a72 ]

This adds support for device name wildcards to the "--devices"
option, e.g. if user specifies "--devices=eth+,en+" the agent
will match devices eth0, eth1, en0, etc.

Fixes: #15693

Signed-off-by: Jussi Maki <jussi@isovalent.com>
Signed-off-by: Chris Tarazi <chris@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/daemon Impacts operation of the Cilium daemon. kind/feature This introduces new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants