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
Added ipv6 only support with flannel #5238
Conversation
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
pkg/agent/flannel/setup.go
Outdated
} | ||
} else { | ||
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", "0.0.0.0/0") | ||
confJSON = strings.ReplaceAll(confJSON, "%DUALSTACK%", "true") |
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.
Can you change the %DUALSTACK% parameter to be %IPV6_ENABLED%? I think it makes more sense
confJSON = strings.ReplaceAll(confJSON, "%DUALSTACK%", "true") | ||
for _, cidr := range nodeConfig.AgentConfig.ClusterCIDRs { | ||
if utilsnet.IsIPv6(cidr.IP) { | ||
// Only one ipv6 range available. This might change in future: https://github.com/kubernetes/enhancements/issues/2593 |
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.
What would happen if there were more than one ipv6 range? I wonder if it would be worth checking and if there is more than one fail with an error
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.
It looks to me like after the first ReplaceAll call the %CIDR_IPV6%
template string would be gone from the string, so only the first CIDR block will be used. That seems fine.
Is Flannel OK with the %CIDR_IPV6%
string remaining unsubstituted in the JSON if IPv6 is not enabled?
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 tested it configuring more then one CIDR for IPv4 and IPv6. K3s gives error and does not even start; the logs say that CIDR len should be at least two on dualstack configuration.
If IPv6 is disabled the CIDR config for IPv6 it's not used.
Codecov Report
@@ Coverage Diff @@
## master #5238 +/- ##
=========================================
- Coverage 9.54% 9.53% -0.02%
=========================================
Files 134 134
Lines 9404 9420 +16
=========================================
Hits 898 898
- Misses 8315 8331 +16
Partials 191 191
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
confJSON = strings.ReplaceAll(confJSON, "%DUALSTACK%", "true") | ||
for _, cidr := range nodeConfig.AgentConfig.ClusterCIDRs { | ||
if utilsnet.IsIPv6(cidr.IP) { | ||
// Only one ipv6 range available. This might change in future: https://github.com/kubernetes/enhancements/issues/2593 |
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.
It looks to me like after the first ReplaceAll call the %CIDR_IPV6%
template string would be gone from the string, so only the first CIDR block will be used. That seems fine.
Is Flannel OK with the %CIDR_IPV6%
string remaining unsubstituted in the JSON if IPv6 is not enabled?
Signed-off-by: Roberto Bonafiglia roberto.bonafiglia@suse.com
Proposed Changes
Types of Changes
Added support for IPv6 only setup using flannel
Verification
Setup multiple nodes with IPv6 and configure the IPv6 addresses on the config file
Linked Issues
#5237
User-Facing Change
Further Comments