Skip to content

Commit

Permalink
Merge pull request #1966 from pixiake/master
Browse files Browse the repository at this point in the history
Fix hybridnet configuration bug
  • Loading branch information
ks-ci-bot authored Aug 25, 2023
2 parents 38b4af8 + 74b6b72 commit ebfde7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/kk/apis/kubekey/v1alpha2/network_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (n *NetworkConfig) EnableMultusCNI() bool {
// EnableIPV4POOL_NAT_OUTGOING is used to determine whether to enable CALICO_IPV4POOL_NAT_OUTGOING.
func (c *CalicoCfg) EnableIPV4POOL_NAT_OUTGOING() bool {
if c.Ipv4NatOutgoing == nil {
return false
return true
}
return *c.Ipv4NatOutgoing
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/kk/pkg/plugins/network/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ func (d *DeployHybridnet) Execute(runtime connector.Runtime) error {
cmd = fmt.Sprintf("%s --set daemon.enableNetworkPolicy=false", cmd)
}

if d.KubeConf.Cluster.Network.Hybridnet.DefaultNetworkType != "" {
cmd = fmt.Sprintf("%s --set defaultNetworkType=%s", cmd, d.KubeConf.Cluster.Network.Hybridnet.DefaultNetworkType)
}

if d.KubeConf.Cluster.Network.Hybridnet.PreferBGPInterfaces != "" {
cmd = fmt.Sprintf("%s --set daemon.preferBGPInterfaces=%s", cmd, d.KubeConf.Cluster.Network.Hybridnet.PreferBGPInterfaces)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/kk/pkg/plugins/network/templates/hybridnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
{{- end }}
{{- if .ExcludeIPs }}
excludeIPs:
{{ toYaml .ReservedIPs | indent 4 }}
{{ toYaml .ExcludeIPs | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
Expand Down

0 comments on commit ebfde7c

Please sign in to comment.