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

[1.26 feature] Add flannelOpts flag and deprecate only server flannel options #6557

Closed
wants to merge 1 commit into from

Conversation

manuelbuil
Copy link
Contributor

@manuelbuil manuelbuil commented Nov 24, 2022

Signed-off-by: Manuel Buil mbuil@suse.com

Proposed Changes

Combine the only-server flannel options:

  • backend (in 1.27)
  • ipv6-masq
  • external-ip

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

Deprecate flannel-backend, flannel-ipv6-masq, flannel-external-ip flags and replace them with flannel-opts flag

Further Comments

@manuelbuil manuelbuil requested a review from a team as a code owner November 24, 2022 15:18
@@ -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",
Copy link
Member

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.

Copy link
Contributor Author

@manuelbuil manuelbuil Nov 29, 2022

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

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'",
Copy link
Member

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.

Suggested change
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'",

@dereknola
Copy link
Member

I would argue for two separate flannel flags, flannel-backend as we have it now and flannel-opts with everything else.

@manuelbuil
Copy link
Contributor Author

I would argue for two separate flannel flags, flannel-backend as we have it now and flannel-opts with everything else.

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 flannel-backend from the PR, we are back to 2 flags, which makes me wonder if it makes sense to proceed :P

@dereknola
Copy link
Member

I totally understand, I was one of the people pushing for the flannel-opts flag. But the flannel-backend is already a complex flag with lots of options, and deprecating it is going to be a nightmare. The new flannel flags were bools , so having a single flag to encapsulate all the bools makes sense to me.

Destination: &ServerConfig.FlannelIPv6Masq,
},
cli.BoolFlag{
Name: "flannel-external-ip",
Usage: "(networking) Use node external IP addresses for Flannel traffic",
Usage: "(deprecated) use --flannel-opts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I missed that

@manuelbuil
Copy link
Contributor Author

manuelbuil commented Dec 2, 2022

I totally understand, I was one of the people pushing for the flannel-opts flag. But the flannel-backend is already a complex flag with lots of options, and deprecating it is going to be a nightmare. The new flannel flags were bools , so having a single flag to encapsulate all the bools makes sense to me.

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 flannel-conf flag. I have noticed that Roberto already added a deprecation message for 1.27 ==> 26e9405, that's good. Then, maybe we can collapse flannel-backend inside flannel-opts when releasing 1.27

@manuelbuil manuelbuil force-pushed the flannelopts branch 4 times, most recently from ad999ad to 90e5624 Compare December 2, 2022 18:39
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: serial comma?

Copy link
Contributor Author

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

@@ -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'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: serial comma

@manuelbuil
Copy link
Contributor Author

Message for my future self: update the docs!

@manuelbuil manuelbuil force-pushed the flannelopts branch 2 times, most recently from 4cfcf90 to 817aad6 Compare December 5, 2022 17:26
@manuelbuil manuelbuil requested a review from matttrach December 5, 2022 17:26
@brandond
Copy link
Member

brandond commented Dec 5, 2022

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:

  • What we currently allow configuring
  • How we currently allow configuring these items (can some be achieved multiple ways?)
  • How often do we think users use the current flags
  • Do users have any work-arounds for settings that we don't allow configuring?

@manuelbuil
Copy link
Contributor Author

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:

  • What we currently allow configuring
  • How we currently allow configuring these items (can some be achieved multiple ways?)
  • How often do we think users use the current flags
  • Do users have any work-arounds for settings that we don't allow configuring?

I can create an ADR tomorrow. The user related questions are relevant but not sure how we can answer that :P

Signed-off-by: Manuel Buil <mbuil@suse.com>
* 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
Copy link
Member

@brandond brandond Dec 14, 2022

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.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants