mirror of https://github.com/kubernetes/kops.git
Support ChainInsertMode config option for Calico Networking
This commit is contained in:
parent
ecac8c5f14
commit
2fb1a4ecd2
|
@ -2116,6 +2116,9 @@ spec:
|
||||||
calico:
|
calico:
|
||||||
description: CalicoNetworkingSpec declares that we want Calico networking
|
description: CalicoNetworkingSpec declares that we want Calico networking
|
||||||
properties:
|
properties:
|
||||||
|
chainInsertMode:
|
||||||
|
description: 'ChainInsertMode controls whether Felix inserts rules to the top of iptables chains, or appends to the bottom. Leaving the default option is safest to prevent accidentally breaking connectivity. Default: ''insert'' (other options: ''append'')'
|
||||||
|
type: string
|
||||||
cpuRequest:
|
cpuRequest:
|
||||||
anyOf:
|
anyOf:
|
||||||
- type: integer
|
- type: integer
|
||||||
|
|
|
@ -100,6 +100,10 @@ type FlannelNetworkingSpec struct {
|
||||||
|
|
||||||
// CalicoNetworkingSpec declares that we want Calico networking
|
// CalicoNetworkingSpec declares that we want Calico networking
|
||||||
type CalicoNetworkingSpec struct {
|
type CalicoNetworkingSpec struct {
|
||||||
|
// ChainInsertMode controls whether Felix inserts rules to the top of iptables chains, or
|
||||||
|
// appends to the bottom. Leaving the default option is safest to prevent accidentally
|
||||||
|
// breaking connectivity. Default: 'insert' (other options: 'append')
|
||||||
|
ChainInsertMode string `json:"chainInsertMode,omitempty"`
|
||||||
// CPURequest CPU request of Calico container. Default: 100m
|
// CPURequest CPU request of Calico container. Default: 100m
|
||||||
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
|
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
|
||||||
// CrossSubnet enables Calico's cross-subnet mode when set to true
|
// CrossSubnet enables Calico's cross-subnet mode when set to true
|
||||||
|
|
|
@ -100,6 +100,10 @@ type FlannelNetworkingSpec struct {
|
||||||
|
|
||||||
// CalicoNetworkingSpec declares that we want Calico networking
|
// CalicoNetworkingSpec declares that we want Calico networking
|
||||||
type CalicoNetworkingSpec struct {
|
type CalicoNetworkingSpec struct {
|
||||||
|
// ChainInsertMode controls whether Felix inserts rules to the top of iptables chains, or
|
||||||
|
// appends to the bottom. Leaving the default option is safest to prevent accidentally
|
||||||
|
// breaking connectivity. Default: 'insert' (other options: 'append')
|
||||||
|
ChainInsertMode string `json:"chainInsertMode,omitempty"`
|
||||||
// CPURequest CPU request of Calico container. Default: 100m
|
// CPURequest CPU request of Calico container. Default: 100m
|
||||||
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
|
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
|
||||||
// CrossSubnet enables Calico's cross-subnet mode when set to true
|
// CrossSubnet enables Calico's cross-subnet mode when set to true
|
||||||
|
|
|
@ -1305,6 +1305,7 @@ func Convert_kops_CNINetworkingSpec_To_v1alpha2_CNINetworkingSpec(in *kops.CNINe
|
||||||
}
|
}
|
||||||
|
|
||||||
func autoConvert_v1alpha2_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *CalicoNetworkingSpec, out *kops.CalicoNetworkingSpec, s conversion.Scope) error {
|
func autoConvert_v1alpha2_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *CalicoNetworkingSpec, out *kops.CalicoNetworkingSpec, s conversion.Scope) error {
|
||||||
|
out.ChainInsertMode = in.ChainInsertMode
|
||||||
out.CPURequest = in.CPURequest
|
out.CPURequest = in.CPURequest
|
||||||
out.CrossSubnet = in.CrossSubnet
|
out.CrossSubnet = in.CrossSubnet
|
||||||
out.LogSeverityScreen = in.LogSeverityScreen
|
out.LogSeverityScreen = in.LogSeverityScreen
|
||||||
|
@ -1330,6 +1331,7 @@ func Convert_v1alpha2_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(in *Cali
|
||||||
}
|
}
|
||||||
|
|
||||||
func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha2_CalicoNetworkingSpec(in *kops.CalicoNetworkingSpec, out *CalicoNetworkingSpec, s conversion.Scope) error {
|
func autoConvert_kops_CalicoNetworkingSpec_To_v1alpha2_CalicoNetworkingSpec(in *kops.CalicoNetworkingSpec, out *CalicoNetworkingSpec, s conversion.Scope) error {
|
||||||
|
out.ChainInsertMode = in.ChainInsertMode
|
||||||
out.CPURequest = in.CPURequest
|
out.CPURequest = in.CPURequest
|
||||||
out.CrossSubnet = in.CrossSubnet
|
out.CrossSubnet = in.CrossSubnet
|
||||||
out.LogSeverityScreen = in.LogSeverityScreen
|
out.LogSeverityScreen = in.LogSeverityScreen
|
||||||
|
|
|
@ -957,6 +957,11 @@ func validateNetworkingCalico(v *kops.CalicoNetworkingSpec, e kops.EtcdClusterSp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v.ChainInsertMode != "" {
|
||||||
|
valid := []string{"insert", "append"}
|
||||||
|
allErrs = append(allErrs, IsValidValue(fldPath.Child("chainInsertMode"), &v.ChainInsertMode, valid)...)
|
||||||
|
}
|
||||||
|
|
||||||
if v.IptablesBackend != "" {
|
if v.IptablesBackend != "" {
|
||||||
valid := []string{"Auto", "Legacy", "NFT"}
|
valid := []string{"Auto", "Legacy", "NFT"}
|
||||||
allErrs = append(allErrs, IsValidValue(fldPath.Child("iptablesBackend"), &v.IptablesBackend, valid)...)
|
allErrs = append(allErrs, IsValidValue(fldPath.Child("iptablesBackend"), &v.IptablesBackend, valid)...)
|
||||||
|
|
|
@ -12837,6 +12837,9 @@ spec:
|
||||||
value: "true"
|
value: "true"
|
||||||
|
|
||||||
# kops additions
|
# kops additions
|
||||||
|
# Controls whether Felix inserts rules to the top of iptables chains, or appends to the bottom
|
||||||
|
- name: FELIX_CHAININSERTMODE
|
||||||
|
value: "{{- or .Networking.Calico.ChainInsertMode "insert" }}"
|
||||||
# Set Felix iptables binary variant, Legacy or NFT
|
# Set Felix iptables binary variant, Legacy or NFT
|
||||||
- name: FELIX_IPTABLESBACKEND
|
- name: FELIX_IPTABLESBACKEND
|
||||||
value: "{{- or .Networking.Calico.IptablesBackend "Auto" }}"
|
value: "{{- or .Networking.Calico.IptablesBackend "Auto" }}"
|
||||||
|
|
|
@ -3875,6 +3875,9 @@ spec:
|
||||||
value: "true"
|
value: "true"
|
||||||
|
|
||||||
# kops additions
|
# kops additions
|
||||||
|
# Controls whether Felix inserts rules to the top of iptables chains, or appends to the bottom
|
||||||
|
- name: FELIX_CHAININSERTMODE
|
||||||
|
value: "{{- or .Networking.Calico.ChainInsertMode "insert" }}"
|
||||||
# Set Felix iptables binary variant, Legacy or NFT
|
# Set Felix iptables binary variant, Legacy or NFT
|
||||||
- name: FELIX_IPTABLESBACKEND
|
- name: FELIX_IPTABLESBACKEND
|
||||||
value: "{{- or .Networking.Calico.IptablesBackend "Auto" }}"
|
value: "{{- or .Networking.Calico.IptablesBackend "Auto" }}"
|
||||||
|
|
|
@ -815,7 +815,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann
|
||||||
"k8s-1.7": "2.6.12-kops.1",
|
"k8s-1.7": "2.6.12-kops.1",
|
||||||
"k8s-1.7-v3": "3.8.0-kops.2",
|
"k8s-1.7-v3": "3.8.0-kops.2",
|
||||||
"k8s-1.12": "3.9.6-kops.1",
|
"k8s-1.12": "3.9.6-kops.1",
|
||||||
"k8s-1.16": "3.16.1-kops.1",
|
"k8s-1.16": "3.16.1-kops.2",
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue