You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(kg): add --internal-cidr flag to filter IP auto-detection
Add a new --internal-cidr flag that allows users to specify which CIDRs
should be considered during internal IP auto-detection. This flag can
be specified multiple times to allow multiple CIDRs.
When set, only IPs within these CIDRs will be selected as the internal
IP, preventing incorrect IP selection (e.g., when CiliumInternalIP is
chosen over the real node IP due to lexicographic sorting).
Example usage:
--internal-cidr=192.168.0.0/16
--internal-cidr=$(NODE_IP)/32
Also update manifests for cilium and flannel deployments to use this
flag with NODE_IP from Kubernetes Downward API.
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Andrei Kvapil <[email protected]>
Copy file name to clipboardExpand all lines: cmd/kg/main.go
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,7 @@ var (
120
120
topologyLabelstring
121
121
portint
122
122
serviceCIDRsRaw []string
123
+
internalCIDRsRaw []string
123
124
subnetstring
124
125
resyncPeriod time.Duration
125
126
iptablesForwardRulebool
@@ -152,6 +153,7 @@ func init() {
152
153
cmd.Flags().StringVar(&topologyLabel, "topology-label", k8s.RegionLabelKey, "Kubernetes node label used to group nodes into logical locations.")
153
154
cmd.Flags().IntVar(&port, "port", mesh.DefaultKiloPort, "The port over which WireGuard peers should communicate.")
154
155
cmd.Flags().StringSliceVar(&serviceCIDRsRaw, "service-cidr", nil, "The service CIDR for the Kubernetes cluster. Can be provided optionally to avoid masquerading packets sent to service IPs. Can be specified multiple times.")
156
+
cmd.Flags().StringSliceVar(&internalCIDRsRaw, "internal-cidr", nil, "CIDRs to consider for internal IP auto-detection. If specified, only IPs within these CIDRs will be used. Can be specified multiple times.")
155
157
cmd.Flags().StringVar(&subnet, "subnet", mesh.DefaultKiloSubnet.String(), "CIDR from which to allocate addresses for WireGuard interfaces.")
156
158
cmd.Flags().DurationVar(&resyncPeriod, "resync-period", 30*time.Second, "How often should the Kilo controllers reconcile?")
157
159
cmd.Flags().BoolVar(&iptablesForwardRule, "iptables-forward-rules", false, "Add default accept rules to the FORWARD chain in iptables. Warning: this may break firewalls with a deny all policy and is potentially insecure!")
0 commit comments