mirror of https://github.com/k3s-io/k3s
Changed ipv6 config on flannel setup
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>pull/5238/head
parent
073f155fc4
commit
ff85faa7de
|
@ -45,7 +45,7 @@ const (
|
||||||
|
|
||||||
flannelConf = `{
|
flannelConf = `{
|
||||||
"Network": "%CIDR%",
|
"Network": "%CIDR%",
|
||||||
"EnableIPv6": %DUALSTACK%,
|
"EnableIPv6": %IPV6_ENABLED%,
|
||||||
"EnableIPv4": %IPV4_ENABLED%,
|
"EnableIPv4": %IPV4_ENABLED%,
|
||||||
"IPv6Network": "%CIDR_IPV6%",
|
"IPv6Network": "%CIDR_IPV6%",
|
||||||
"Backend": %backend%
|
"Backend": %backend%
|
||||||
|
@ -163,11 +163,11 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
||||||
confJSON := strings.ReplaceAll(flannelConf, "%IPV4_ENABLED%", ipv4Enabled)
|
confJSON := strings.ReplaceAll(flannelConf, "%IPV4_ENABLED%", ipv4Enabled)
|
||||||
if netMode == ipv4 {
|
if netMode == ipv4 {
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", nodeConfig.AgentConfig.ClusterCIDR.String())
|
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", nodeConfig.AgentConfig.ClusterCIDR.String())
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%DUALSTACK%", "false")
|
confJSON = strings.ReplaceAll(confJSON, "%IPV6_ENABLED%", "false")
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%CIDR_IPV6%", emptyIPv6Network)
|
confJSON = strings.ReplaceAll(confJSON, "%CIDR_IPV6%", emptyIPv6Network)
|
||||||
} else if netMode == (ipv4 + ipv6) {
|
} else if netMode == (ipv4 + ipv6) {
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", nodeConfig.AgentConfig.ClusterCIDR.String())
|
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", nodeConfig.AgentConfig.ClusterCIDR.String())
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%DUALSTACK%", "true")
|
confJSON = strings.ReplaceAll(confJSON, "%IPV6_ENABLED%", "true")
|
||||||
for _, cidr := range nodeConfig.AgentConfig.ClusterCIDRs {
|
for _, cidr := range nodeConfig.AgentConfig.ClusterCIDRs {
|
||||||
if utilsnet.IsIPv6(cidr.IP) {
|
if utilsnet.IsIPv6(cidr.IP) {
|
||||||
// Only one ipv6 range available. This might change in future: https://github.com/kubernetes/enhancements/issues/2593
|
// Only one ipv6 range available. This might change in future: https://github.com/kubernetes/enhancements/issues/2593
|
||||||
|
@ -176,7 +176,7 @@ func createFlannelConf(nodeConfig *config.Node) error {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", "0.0.0.0/0")
|
confJSON = strings.ReplaceAll(confJSON, "%CIDR%", "0.0.0.0/0")
|
||||||
confJSON = strings.ReplaceAll(confJSON, "%DUALSTACK%", "true")
|
confJSON = strings.ReplaceAll(confJSON, "%IPV6_ENABLED%", "true")
|
||||||
for _, cidr := range nodeConfig.AgentConfig.ClusterCIDRs {
|
for _, cidr := range nodeConfig.AgentConfig.ClusterCIDRs {
|
||||||
if utilsnet.IsIPv6(cidr.IP) {
|
if utilsnet.IsIPv6(cidr.IP) {
|
||||||
// Only one ipv6 range available. This might change in future: https://github.com/kubernetes/enhancements/issues/2593
|
// Only one ipv6 range available. This might change in future: https://github.com/kubernetes/enhancements/issues/2593
|
||||||
|
|
Loading…
Reference in New Issue