-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[1.26 feature] Add flannelOpts flag and deprecate only server flannel options #6557
Conversation
pkg/cli/cmds/server.go
Outdated
@@ -208,20 +209,25 @@ var ServerFlags = []cli.Flag{ | |||
ClusterDomain, | |||
cli.StringFlag{ | |||
Name: "flannel-backend", | |||
Usage: "(networking) backend<=option1=val1,option2=val2> where backend is one of 'none', 'vxlan', 'ipsec', 'host-gw', 'wireguard-native', or 'wireguard' (deprecated)", | |||
Usage: "(deprecated) use --flannel-opts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should add --disable-flannel
or something?
Hiding the option to disable flannel even further, when it's a very common option for users that want to deploy their own CNI, seems like a step backwards from a UX perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, disable-flannel
was deprecated and removed. The way to do it now if using none as backend
pkg/cli/cmds/server.go
Outdated
Destination: &ServerConfig.FlannelExternalIP, | ||
}, | ||
cli.StringSliceFlag{ | ||
Name: "flannel-opts", | ||
Usage: "(networking) Flannel options: backend:<option>, ipv6-masq, external-ip. Backend is one of 'none', 'vxlan', 'ipsec', 'host-gw' or 'wireguard-native'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to drop ipsec as well, so lets just list the still-supported backends.
Usage: "(networking) Flannel options: backend:<option>, ipv6-masq, external-ip. Backend is one of 'none', 'vxlan', 'ipsec', 'host-gw' or 'wireguard-native'", | |
Usage: "(networking) Flannel options: backend=string, ipv6-masq=bool, external-ip=bool. backend is one of 'none', 'vxlan', 'host-gw' or 'wireguard-native'", |
I would argue for two separate flannel flags, |
I don't have a strong opinion. Just remember that the reason to create this PR was because there were more than 2 flannel options in the server, which was observed as too many. If we remove |
I totally understand, I was one of the people pushing for the |
Destination: &ServerConfig.FlannelIPv6Masq, | ||
}, | ||
cli.BoolFlag{ | ||
Name: "flannel-external-ip", | ||
Usage: "(networking) Use node external IP addresses for Flannel traffic", | ||
Usage: "(deprecated) use --flannel-opts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add logrus.Warn
when these flags are used as per https://github.com/dereknola/k3s/blob/master/docs/adrs/deprecating-and-removing-flags.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I missed that
Destination: &ServerConfig.FlannelBackend, | ||
Value: "vxlan", | ||
}, | ||
cli.BoolFlag{ | ||
Name: "flannel-ipv6-masq", | ||
Usage: "(networking) Enable IPv6 masquerading for pod", | ||
Usage: "(deprecated) use --flannel-opts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add logrus.Warn
when these flags are used as per https://github.com/dereknola/k3s/blob/master/docs/adrs/deprecating-and-removing-flags.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I missed that
That's a good point, flannel-backend is too complicated. I think allowing to configure extra options through it (apart from the backend) was a mistake because we can do it using |
ad999ad
to
90e5624
Compare
pkg/agent/config/config.go
Outdated
case strings.Contains(opt, "external-ip"): | ||
externalIP = true | ||
default: | ||
return false, false, fmt.Errorf("wrong arg: %s passed in --flannel-opts. Correct args are backend, ipv6-masq and external-ip", opt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: serial comma?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! I did not know about the serial comma concept
pkg/cli/cmds/server.go
Outdated
@@ -208,20 +209,25 @@ var ServerFlags = []cli.Flag{ | |||
ClusterDomain, | |||
cli.StringFlag{ | |||
Name: "flannel-backend", | |||
Usage: "(networking) backend<=option1=val1,option2=val2> where backend is one of 'none', 'vxlan', 'ipsec', 'host-gw', 'wireguard-native', or 'wireguard' (deprecated)", | |||
Usage: "(networking) backend<=option1=val1,option2=val2> where backend is one of 'none', 'vxlan', 'ipsec', 'host-gw' or 'wireguard-native'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: serial comma
Message for my future self: update the docs! |
4cfcf90
to
817aad6
Compare
It might be worth doing a full ADR for how we'd like to handle Flannel configuration in K3s. I get that the current set of flags doesn't scale well, but I feel like this could be a step backwards in terms of user experience. It would be nice to capture:
|
I can create an ADR tomorrow. The user related questions are relevant but not sure how we can answer that :P |
817aad6
to
37a6dc6
Compare
Signed-off-by: Manuel Buil <mbuil@suse.com>
37a6dc6
to
f09b51c
Compare
* Use it for potential new flannel server flags | ||
|
||
Downsides: | ||
* Users are used to those flags, specially `flannel-backend`, therefore it might be seen as a negative changei. That's why we should carefully follow the deprecation policy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Users are used to those flags, specially `flannel-backend`, therefore it might be seen as a negative changei. That's why we should carefully follow the deprecation policy. | |
* Users are used to those flags, specially `flannel-backend`, therefore it might be seen as a negative change. That's why we should carefully follow the deprecation policy. |
|
||
## Proposal | ||
|
||
Starting in v1.26, introduce a new `flannel-opts` flag that includes flannel server options. The redundant flags are deprecated and removed in a few releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so just to be clear we're only talking about making changes to the server flags - the agent flags that allow users to pass custom flannel and cni config files would be retained?
If our goal is to simplify the user's life, packing everything into one giant --flannel-opts that requires extensive documentation feels like a step backwards. Right now the flannel-backend flag is pretty self-explanatory; the only detail we need to get into for that is what backends are available and why someone would chose one over another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. I think I'm going to close this PR because it does not bring much user benefit. If in the future, there are more flannel flags coming (unlikely), we can reconsider this. But I think we are complicating things for just two flags, so the benefit is small
Signed-off-by: Manuel Buil mbuil@suse.com
Proposed Changes
Combine the only-server flannel options:
into one cli.StringSlice (flannel-opts) and deprecate those as single flags
Types of Changes
Breaking API change
Verification
Deploy with --flannel-opts, for example
--flannel-opts=[backend=wireguard, ipv6-masq]
Testing
Linked Issues
#6556
User-Facing Change
Further Comments