mirror of https://github.com/kubernetes/kops.git
Allow setting MTU for calico networking
This commit does the following two changes: 1. Changes the default calico mtu to 8198. 2. Enables setting the mtu explicitly in the config as: ``` networking: calico: mtu: 2048 ``` Testing done: 1. Created cluster on AWS with networking set to calico. No additional details were provided. Verified that the mtu was set to 8198. Also verified that the FELIX_IPINIPMTU environment variable was set to 8198. 2. Created a cluster explicitly setting the calico mtu to 2048. Verified that the mtu for the 'cali*' interfaces inside the pods was set to 2048. Also, verified that the FELIX_IPINIPMTU environment variable was set to 2048. 3. make test passed. Closes #4042
This commit is contained in:
parent
3489ea317e
commit
e4638de5f4
|
@ -83,6 +83,8 @@ type CalicoNetworkingSpec struct {
|
||||||
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
|
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
|
||||||
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
|
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
|
||||||
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
|
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
|
||||||
|
// MTU to be set in the cni-network-config for calico.
|
||||||
|
MTU *int32 `json:"mtu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanalNetworkingSpec declares that we want Canal networking
|
// CanalNetworkingSpec declares that we want Canal networking
|
||||||
|
|
|
@ -83,6 +83,8 @@ type CalicoNetworkingSpec struct {
|
||||||
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
|
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
|
||||||
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
|
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
|
||||||
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
|
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
|
||||||
|
// MTU to be set in the cni-network-config for calico.
|
||||||
|
MTU *int32 `json:"mtu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanalNetworkingSpec declares that we want Canal networking
|
// CanalNetworkingSpec declares that we want Canal networking
|
||||||
|
|
|
@ -425,6 +425,7 @@ func autoConvert_v1alpha1_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *
|
||||||
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
||||||
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
||||||
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
||||||
|
out.MTU = in.MTU
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,6 +441,7 @@ func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha1_CalicoNetworkingSpec(in *
|
||||||
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
||||||
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
||||||
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
||||||
|
out.MTU = in.MTU
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,6 +280,15 @@ func (in *CNINetworkingSpec) DeepCopy() *CNINetworkingSpec {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *CalicoNetworkingSpec) DeepCopyInto(out *CalicoNetworkingSpec) {
|
func (in *CalicoNetworkingSpec) DeepCopyInto(out *CalicoNetworkingSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.MTU != nil {
|
||||||
|
in, out := &in.MTU, &out.MTU
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2826,7 +2835,7 @@ func (in *NetworkingSpec) DeepCopyInto(out *NetworkingSpec) {
|
||||||
*out = nil
|
*out = nil
|
||||||
} else {
|
} else {
|
||||||
*out = new(CalicoNetworkingSpec)
|
*out = new(CalicoNetworkingSpec)
|
||||||
**out = **in
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.Canal != nil {
|
if in.Canal != nil {
|
||||||
|
|
|
@ -83,6 +83,8 @@ type CalicoNetworkingSpec struct {
|
||||||
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
|
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
|
||||||
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
|
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
|
||||||
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
|
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
|
||||||
|
// MTU to be set in the cni-network-config for calico.
|
||||||
|
MTU *int32 `json:"mtu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanalNetworkingSpec declares that we want Canal networking
|
// CanalNetworkingSpec declares that we want Canal networking
|
||||||
|
|
|
@ -461,6 +461,7 @@ func autoConvert_v1alpha2_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *
|
||||||
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
||||||
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
||||||
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
||||||
|
out.MTU = in.MTU
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,6 +477,7 @@ func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha2_CalicoNetworkingSpec(in *
|
||||||
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
out.PrometheusMetricsPort = in.PrometheusMetricsPort
|
||||||
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
out.PrometheusGoMetricsEnabled = in.PrometheusGoMetricsEnabled
|
||||||
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
out.PrometheusProcessMetricsEnabled = in.PrometheusProcessMetricsEnabled
|
||||||
|
out.MTU = in.MTU
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,15 @@ func (in *CNINetworkingSpec) DeepCopy() *CNINetworkingSpec {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *CalicoNetworkingSpec) DeepCopyInto(out *CalicoNetworkingSpec) {
|
func (in *CalicoNetworkingSpec) DeepCopyInto(out *CalicoNetworkingSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.MTU != nil {
|
||||||
|
in, out := &in.MTU, &out.MTU
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2907,7 +2916,7 @@ func (in *NetworkingSpec) DeepCopyInto(out *NetworkingSpec) {
|
||||||
*out = nil
|
*out = nil
|
||||||
} else {
|
} else {
|
||||||
*out = new(CalicoNetworkingSpec)
|
*out = new(CalicoNetworkingSpec)
|
||||||
**out = **in
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.Canal != nil {
|
if in.Canal != nil {
|
||||||
|
|
|
@ -269,6 +269,15 @@ func (in *CNINetworkingSpec) DeepCopy() *CNINetworkingSpec {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *CalicoNetworkingSpec) DeepCopyInto(out *CalicoNetworkingSpec) {
|
func (in *CalicoNetworkingSpec) DeepCopyInto(out *CalicoNetworkingSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.MTU != nil {
|
||||||
|
in, out := &in.MTU, &out.MTU
|
||||||
|
if *in == nil {
|
||||||
|
*out = nil
|
||||||
|
} else {
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3102,7 +3111,7 @@ func (in *NetworkingSpec) DeepCopyInto(out *NetworkingSpec) {
|
||||||
*out = nil
|
*out = nil
|
||||||
} else {
|
} else {
|
||||||
*out = new(CalicoNetworkingSpec)
|
*out = new(CalicoNetworkingSpec)
|
||||||
**out = **in
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.Canal != nil {
|
if in.Canal != nil {
|
||||||
|
|
|
@ -32,6 +32,7 @@ data:
|
||||||
"etcd_scheme": "https",
|
"etcd_scheme": "https",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
"log_level": "info",
|
"log_level": "info",
|
||||||
|
"mtu": {{- or .Networking.Calico.MTU 8981 }},
|
||||||
"ipam": {
|
"ipam": {
|
||||||
"type": "calico-ipam"
|
"type": "calico-ipam"
|
||||||
},
|
},
|
||||||
|
@ -216,6 +217,8 @@ spec:
|
||||||
value: "{{- or .Networking.Calico.PrometheusProcessMetricsEnabled "true" }}"
|
value: "{{- or .Networking.Calico.PrometheusProcessMetricsEnabled "true" }}"
|
||||||
- name: FELIX_HEALTHENABLED
|
- name: FELIX_HEALTHENABLED
|
||||||
value: "true"
|
value: "true"
|
||||||
|
- name: FELIX_IPINIPMTU
|
||||||
|
value: "{{- or .Networking.Calico.MTU 8981 }}"
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|
Loading…
Reference in New Issue