Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

[v0.16.0] make flannel subnetLen configurable for big clusters #1848

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions builtin/files/cluster.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,14 @@ kubernetes:
# typhaImage:
# repo: quay.io/calico/typha
# tag: v3.9.1
# # By default, flannel assigns a /24 per node for pod's ips, this is effectively limiting your cluster size
# # to 255 nodes since each lease will be preserved for 24h.
# # If you have a bigger cluster you may want to tune this number to assign an smaller block per node.
# # Be aware that network should be able to accomodate at least 4 subnets, and networks smaller than /28
# # will make flannel panic and exit.
# # Ref: https://github.com/coreos/flannel/blob/62a1314e51047e25606b4e4e30bd23d7a8d746bc/subnet/config.go#L69
# flannelConfig:
# subnetLen: 24

# Create MountTargets to subnets managed by kube-aws for a pre-existing Elastic File System (Amazon EFS),
# and then mount to every node.
Expand Down
6 changes: 6 additions & 0 deletions builtin/files/userdata/cloud-config-controller
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,9 @@ write_files:
net-conf.json: |
{
"Network": "{{ .PodCIDR }}",
{{ if gt .Kubernetes.Networking.SelfHosting.FlannelConfig.SubnetLen 0 -}}
"SubnetLen": "{{ .Kubernetes.Networking.SelfHosting.FlannelConfig.SubnetLen }}",
{{- end }}
"Backend": {
"Type": "vxlan"
}
Expand Down Expand Up @@ -2348,6 +2351,9 @@ write_files:
net-conf.json: |
{
"Network": "{{ .PodCIDR }}",
{{ if gt .Kubernetes.Networking.SelfHosting.FlannelConfig.SubnetLen 0 -}}
"SubnetLen": "{{ .Kubernetes.Networking.SelfHosting.FlannelConfig.SubnetLen }}",
{{- end }}
"Backend": {
"Type": "vxlan"
}
Expand Down
1 change: 1 addition & 0 deletions pkg/api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ func NewDefaultCluster() *Cluster {
FlannelImage: Image{Repo: "quay.io/coreos/flannel", Tag: kubeNetworkingSelfHostingDefaultFlannelImageTag, RktPullDocker: false},
FlannelCniImage: Image{Repo: "quay.io/coreos/flannel-cni", Tag: kubeNetworkingSelfHostingDefaultFlannelCniImageTag, RktPullDocker: false},
TyphaImage: Image{Repo: "quay.io/calico/typha", Tag: kubeNetworkingSelfHostingDefaultTyphaImageTag, RktPullDocker: false},
FlannelConfig: FlannelConfig{SubnetLen: int32(0)},
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions pkg/api/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ type SelfHosting struct {
FlannelImage Image `yaml:"flannelImage"`
FlannelCniImage Image `yaml:"flannelCniImage"`
TyphaImage Image `yaml:"typhaImage"`
FlannelConfig FlannelConfig `yaml:"flannelConfig"`
}

type FlannelConfig struct {
SubnetLen int32 `yaml:"subnetLen"`
}