]> git.feebdaed.xyz Git - 0xmirror/cilium.git/commitdiff
nodediscovery: add azure flag to node discovery
authorLiyi Huang <pdshly@gmail.com>
Wed, 3 Dec 2025 16:36:02 +0000 (11:36 -0500)
committerJulian Wiedmann <julianwiedmann@users.noreply.github.com>
Fri, 19 Dec 2025 19:15:08 +0000 (19:15 +0000)
This commit adds the azure-interface-name flag to the node discovery
cell, allowing users to configure the interface name through the CLI

Signed-off-by: Liyi Huang <liyi.huang@isovalent.com>
Documentation/cmdref/cilium-agent.md
Documentation/cmdref/cilium-agent_hive.md
Documentation/cmdref/cilium-agent_hive_dot-graph.md
pkg/nodediscovery/cell.go
pkg/nodediscovery/nodediscovery.go

index 116941580c8426f8aa789a371e4146cf7231b2db..19d368f3c9b0ec26ecb929eb8a52153fa644c626 100644 (file)
@@ -23,6 +23,7 @@ cilium-agent [flags]
       --api-rate-limit string                                     API rate limiting configuration (example: --api-rate-limit endpoint-create=rate-limit:10/m,rate-burst:2)
       --auto-create-cilium-node-resource                          Automatically create CiliumNode resource for own node on startup (default true)
       --auto-direct-node-routes                                   Enable automatic L2 routing between nodes
+      --azure-interface-name string                               InterfaceName the cilium-operator will use to allocate all the IPs on at the node level
       --bgp-router-id-allocation-ip-pool string                   IP pool to allocate the BGP router-id from when the mode is 'ip-pool'
       --bgp-router-id-allocation-mode string                      BGP router-id allocation mode. Currently supported values: 'default' or 'ip-pool' (default "default")
       --bpf-auth-map-max int                                      Maximum number of entries in auth map (default 524288)
index 3a77a5ca2346b0a92e184c0b0b944f2391735321..e478c1f0b4773b80cb679f2bc5978c9f457c805b 100644 (file)
@@ -16,6 +16,7 @@ cilium-agent hive [flags]
       --agent-labels strings                                      Additional labels to identify this agent in monitor events
       --agent-liveness-update-interval duration                   Interval at which the agent updates liveness time for the datapath (default 1s)
       --api-rate-limit string                                     API rate limiting configuration (example: --api-rate-limit endpoint-create=rate-limit:10/m,rate-burst:2)
+      --azure-interface-name string                               InterfaceName the cilium-operator will use to allocate all the IPs on at the node level
       --bpf-lb-algorithm string                                   BPF load balancing algorithm ("random", "maglev") (default "random")
       --bpf-lb-algorithm-annotation                               Enable service-level annotation for configuring BPF load balancing algorithm
       --bpf-lb-dsr-dispatch string                                BPF load balancing DSR dispatch method ("opt", "ipip", "geneve") (default "opt")
index 9dabcf1621cb98ad4ac7efaa2c5074291fa93b1f..c53cca8aab68caf42452377c1e0c6967c69fd596 100644 (file)
@@ -22,6 +22,7 @@ cilium-agent hive dot-graph [flags]
       --agent-labels strings                                      Additional labels to identify this agent in monitor events
       --agent-liveness-update-interval duration                   Interval at which the agent updates liveness time for the datapath (default 1s)
       --api-rate-limit string                                     API rate limiting configuration (example: --api-rate-limit endpoint-create=rate-limit:10/m,rate-burst:2)
+      --azure-interface-name string                               InterfaceName the cilium-operator will use to allocate all the IPs on at the node level
       --bpf-lb-algorithm string                                   BPF load balancing algorithm ("random", "maglev") (default "random")
       --bpf-lb-algorithm-annotation                               Enable service-level annotation for configuring BPF load balancing algorithm
       --bpf-lb-dsr-dispatch string                                BPF load balancing DSR dispatch method ("opt", "ipip", "geneve") (default "opt")
index 07ce6aa8f5974e2b2dcffac1232aa3c7b33893c8..a9b86ad85509c9fb03036320de09e9b5cb49ded5 100644 (file)
@@ -48,6 +48,8 @@ var defaultConfig = config{
        ENIUsePrimaryAddress:       defaults.UseENIPrimaryAddress,
        ENIDisablePrefixDelegation: defaults.ENIDisableNodeLevelPD,
        ENIDeleteOnTermination:     defaults.ENIDeleteOnTermination,
+
+       AzureInterfaceName: "",
 }
 
 type config struct {
@@ -65,6 +67,8 @@ type config struct {
        ENIUsePrimaryAddress       bool
        ENIDisablePrefixDelegation bool
        ENIDeleteOnTermination     bool
+
+       AzureInterfaceName string
 }
 
 func (c config) Flags(flags *pflag.FlagSet) {
@@ -82,4 +86,6 @@ func (c config) Flags(flags *pflag.FlagSet) {
        flags.Bool("eni-use-primary-address", c.ENIUsePrimaryAddress, "Whether an ENI's primary address should be available for allocations on the node at the node level")
        flags.Bool("eni-disable-prefix-delegation", c.ENIDisablePrefixDelegation, "Whether ENI prefix delegation should be disabled on this node at the node level")
        flags.Bool("eni-delete-on-termination", c.ENIDeleteOnTermination, "Whether the ENI should be deleted when the associated instance is terminated at the node level")
+
+       flags.String("azure-interface-name", c.AzureInterfaceName, "InterfaceName the cilium-operator will use to allocate all the IPs on at the node level")
 }
index b7369c28ed11589f05e268ef26647c034f44f83b..b40bbd9a859edf113bef5b17b63cfe4f91e0f931 100644 (file)
@@ -499,6 +499,12 @@ func (n *NodeDiscovery) mutateNodeResource(ctx context.Context, nodeResource *ci
                // consistent results.
                nodeResource.Spec.InstanceID = strings.ToLower(strings.TrimPrefix(ln.Local.ProviderID, azureTypes.ProviderPrefix))
 
+               nodeResource.Spec.IPAM.MinAllocate = n.config.IPAMMinAllocate
+               nodeResource.Spec.IPAM.PreAllocate = n.config.IPAMPreAllocate
+               nodeResource.Spec.IPAM.MaxAllocate = n.config.IPAMMaxAllocate
+               nodeResource.Spec.IPAM.StaticIPTags = n.config.IPAMStaticIPTags
+               nodeResource.Spec.Azure.InterfaceName = n.config.AzureInterfaceName
+
                if c := n.cniConfigManager.GetCustomNetConf(); c != nil {
                        if c.IPAM.MinAllocate != 0 {
                                nodeResource.Spec.IPAM.MinAllocate = c.IPAM.MinAllocate