Skip to content

Commit

Permalink
Default the Canal MTU to 1450 when the v1alpha1 API is used and add t…
Browse files Browse the repository at this point in the history
…he Canal MTU field to the example config (#1016)

* Default Canal MTU to 1450 when the v1alpha1 API is used

* Add the Canal MTU to the example config
  • Loading branch information
xmudrii authored Aug 4, 2020
1 parent 494ec57 commit 40cf996
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkg/apis/kubeone/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func Convert_v1alpha1_CNI_To_kubeone_CNI(in *CNI, out *kubeoneapi.CNI, s convers

switch in.Provider {
case CNIProviderCanal:
out.Canal = &kubeoneapi.CanalSpec{}
out.Canal = &kubeoneapi.CanalSpec{
MTU: 1450,
}
case CNIProviderWeaveNet:
out.WeaveNet = &kubeoneapi.WeaveNetSpec{
Encrypted: in.Encrypted,
Expand Down
12 changes: 9 additions & 3 deletions pkg/apis/kubeone/v1alpha1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ func TestCNIRoundTripConversion(t *testing.T) {
Provider: CNIProviderCanal,
},
expectedInternalCNI: &kubeoneapi.CNI{
Canal: &kubeoneapi.CanalSpec{},
Canal: &kubeoneapi.CanalSpec{
MTU: 1450,
},
},
},
{
Expand Down Expand Up @@ -111,7 +113,9 @@ func TestCNIWithEncryptionRoundTripConversion(t *testing.T) {
Encrypted: true,
},
expectedInternalCNI: &kubeoneapi.CNI{
Canal: &kubeoneapi.CanalSpec{},
Canal: &kubeoneapi.CanalSpec{
MTU: 1450,
},
},
expectedVersionedCNI: &CNI{
Provider: CNIProviderCanal,
Expand Down Expand Up @@ -415,7 +419,9 @@ func TestClusterNetworkRoundTripConversion(t *testing.T) {
ServiceSubnet: "192.168.1.0/24",
ServiceDomainName: "cluster.local",
CNI: &kubeoneapi.CNI{
Canal: &kubeoneapi.CanalSpec{},
Canal: &kubeoneapi.CanalSpec{
MTU: 1450,
},
},
},
},
Expand Down
10 changes: 9 additions & 1 deletion pkg/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,15 @@ clusterNetwork:
# * canal
# * weave-net
# * external - The CNI plugin can be installed as an addon or manually
canal: {}
canal:
# MTU represents the maximum transmission unit.
# Default MTU value depends on the specified provider:
# * AWS - 8951 (9001 AWS Jumbo Frame - 50 VXLAN bytes)
# * GCE - 1410 (GCE specific 1460 bytes - 50 VXLAN bytes)
# * Hetzner - 1400 (Hetzner specific 1450 bytes - 50 VXLAN bytes)
# * OpenStack - 1400 (Hetzner specific 1450 bytes - 50 VXLAN bytes)
# * Default - 1450
mtu: 1450
# weaveNet:
# # When true is set, secret will be automatically generated and
# # referenced in appropriate manifests. Currently only weave-net
Expand Down

0 comments on commit 40cf996

Please sign in to comment.