Fix hybridnet configuration bug

Signed-off-by: pixiake <guofeng@yunify.com>
This commit is contained in:
pixiake 2023-08-25 15:59:19 +08:00
parent c6b9708f9f
commit 74b6b72382
3 changed files with 6 additions and 2 deletions

View File

@ -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
}

View File

@ -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)
}

View File

@ -72,7 +72,7 @@ spec:
{{- end }}
{{- if .ExcludeIPs }}
excludeIPs:
{{ toYaml .ReservedIPs | indent 4 }}
{{ toYaml .ExcludeIPs | indent 4 }}
{{- end }}
{{- end }}
{{- end }}