mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
Merge pull request #2001 from pixiake/master
Support enable calico typha in configuration
This commit is contained in:
commit
7db9ae6fb8
|
|
@ -33,6 +33,7 @@ type CalicoCfg struct {
|
|||
VethMTU int `yaml:"vethMTU" json:"vethMTU,omitempty"`
|
||||
Ipv4NatOutgoing *bool `yaml:"ipv4NatOutgoing" json:"ipv4NatOutgoing,omitempty"`
|
||||
DefaultIPPOOL *bool `yaml:"defaultIPPOOL" json:"defaultIPPOOL,omitempty"`
|
||||
EnableTypha *bool `yaml:"enableTypha" json:"enableTypha,omitempty"`
|
||||
}
|
||||
|
||||
type FlannelCfg struct {
|
||||
|
|
@ -183,6 +184,14 @@ func (c *CalicoCfg) EnableDefaultIPPOOL() bool {
|
|||
return *c.DefaultIPPOOL
|
||||
}
|
||||
|
||||
// Typha is used to determine whether to enable calico Typha
|
||||
func (c *CalicoCfg) Typha() bool {
|
||||
if c.EnableTypha == nil {
|
||||
return false
|
||||
}
|
||||
return *c.EnableTypha
|
||||
}
|
||||
|
||||
// EnableInit is used to determine whether to create default network
|
||||
func (h *HybridnetCfg) EnableInit() bool {
|
||||
if h.Init == nil {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ func deployCalico(d *DeployNetworkPluginModule) []task.Interface {
|
|||
"CalicoNodeImage": images.GetImage(d.Runtime, d.KubeConf, "calico-node").ImageName(),
|
||||
"CalicoFlexvolImage": images.GetImage(d.Runtime, d.KubeConf, "calico-flexvol").ImageName(),
|
||||
"CalicoControllersImage": images.GetImage(d.Runtime, d.KubeConf, "calico-kube-controllers").ImageName(),
|
||||
"TyphaEnabled": len(d.Runtime.GetHostsByRole(common.K8s)) > 50,
|
||||
"TyphaEnabled": len(d.Runtime.GetHostsByRole(common.K8s)) > 50 || d.KubeConf.Cluster.Network.Calico.Typha(),
|
||||
"VethMTU": d.KubeConf.Cluster.Network.Calico.VethMTU,
|
||||
"NodeCidrMaskSize": d.KubeConf.Cluster.Kubernetes.NodeCidrMaskSize,
|
||||
"IPIPMode": d.KubeConf.Cluster.Network.Calico.IPIPMode,
|
||||
|
|
@ -137,7 +137,7 @@ func deployCalico(d *DeployNetworkPluginModule) []task.Interface {
|
|||
"CalicoFlexvolImage": images.GetImage(d.Runtime, d.KubeConf, "calico-flexvol").ImageName(),
|
||||
"CalicoControllersImage": images.GetImage(d.Runtime, d.KubeConf, "calico-kube-controllers").ImageName(),
|
||||
"CalicoTyphaImage": images.GetImage(d.Runtime, d.KubeConf, "calico-typha").ImageName(),
|
||||
"TyphaEnabled": len(d.Runtime.GetHostsByRole(common.K8s)) > 50,
|
||||
"TyphaEnabled": len(d.Runtime.GetHostsByRole(common.K8s)) > 50 || d.KubeConf.Cluster.Network.Calico.Typha(),
|
||||
"VethMTU": d.KubeConf.Cluster.Network.Calico.VethMTU,
|
||||
"NodeCidrMaskSize": d.KubeConf.Cluster.Kubernetes.NodeCidrMaskSize,
|
||||
"IPIPMode": d.KubeConf.Cluster.Network.Calico.IPIPMode,
|
||||
|
|
|
|||
Loading…
Reference in New Issue