mirror of https://github.com/kubernetes/kops.git
Change DisableFlannelForwardRules to match upstream naming in v1alpha3
This commit is contained in:
parent
9996f6c54a
commit
8bbc0e00e5
|
@ -207,9 +207,9 @@ type CanalNetworkingSpec struct {
|
|||
// for traffic between pod to host after calico rules have been processed.
|
||||
// Default: ACCEPT (other options: DROP, RETURN)
|
||||
DefaultEndpointToHostAction string `json:"defaultEndpointToHostAction,omitempty"`
|
||||
// DisableFlannelForwardRules configures Flannel to NOT add the
|
||||
// default ACCEPT traffic rules to the iptables FORWARD chain
|
||||
DisableFlannelForwardRules bool `json:"disableFlannelForwardRules,omitempty"`
|
||||
// FlanneldIptablesForwardRules configures Flannel to add the
|
||||
// default ACCEPT traffic rules to the iptables FORWARD chain. (default: true)
|
||||
FlanneldIptablesForwardRules *bool `json:"flanneldIptablesForwardRules,omitempty"`
|
||||
// IptablesBackend controls which variant of iptables binary Felix uses
|
||||
// Default: Auto (other options: Legacy, NFT)
|
||||
IptablesBackend string `json:"iptablesBackend,omitempty"`
|
||||
|
|
|
@ -22,6 +22,28 @@ import (
|
|||
"k8s.io/kops/pkg/values"
|
||||
)
|
||||
|
||||
// Convert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec is an autogenerated conversion function.
|
||||
func Convert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in *CanalNetworkingSpec, out *kops.CanalNetworkingSpec, s conversion.Scope) error {
|
||||
if err := autoConvert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in, out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.FlanneldIptablesForwardRules != nil {
|
||||
out.FlanneldIptablesForwardRules = values.Bool(!*in.FlanneldIptablesForwardRules)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec is an autogenerated conversion function.
|
||||
func Convert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(in *kops.CanalNetworkingSpec, out *CanalNetworkingSpec, s conversion.Scope) error {
|
||||
if err := autoConvert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(in, out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.FlanneldIptablesForwardRules != nil {
|
||||
out.FlanneldIptablesForwardRules = values.Bool(!*in.FlanneldIptablesForwardRules)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1alpha2_ClusterSpec_To_kops_ClusterSpec(in *ClusterSpec, out *kops.ClusterSpec, s conversion.Scope) error {
|
||||
if err := autoConvert_v1alpha2_ClusterSpec_To_kops_ClusterSpec(in, out, s); err != nil {
|
||||
return err
|
||||
|
|
|
@ -215,7 +215,7 @@ type CanalNetworkingSpec struct {
|
|||
DefaultEndpointToHostAction string `json:"defaultEndpointToHostAction,omitempty"`
|
||||
// DisableFlannelForwardRules configures Flannel to NOT add the
|
||||
// default ACCEPT traffic rules to the iptables FORWARD chain
|
||||
DisableFlannelForwardRules bool `json:"disableFlannelForwardRules,omitempty"`
|
||||
FlanneldIptablesForwardRules *bool `json:"disableFlannelForwardRules,omitempty"`
|
||||
// DisableTxChecksumOffloading is unused.
|
||||
// +k8s:conversion-gen=false
|
||||
DisableTxChecksumOffloading bool `json:"disableTxChecksumOffloading,omitempty"`
|
||||
|
|
|
@ -214,16 +214,6 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*CanalNetworkingSpec)(nil), (*kops.CanalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(a.(*CanalNetworkingSpec), b.(*kops.CanalNetworkingSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*kops.CanalNetworkingSpec)(nil), (*CanalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(a.(*kops.CanalNetworkingSpec), b.(*CanalNetworkingSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*CertManagerConfig)(nil), (*kops.CertManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha2_CertManagerConfig_To_kops_CertManagerConfig(a.(*CertManagerConfig), b.(*kops.CertManagerConfig), scope)
|
||||
}); err != nil {
|
||||
|
@ -1134,6 +1124,11 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*kops.CanalNetworkingSpec)(nil), (*CanalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(a.(*kops.CanalNetworkingSpec), b.(*CanalNetworkingSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*kops.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_kops_ClusterSpec_To_v1alpha2_ClusterSpec(a.(*kops.ClusterSpec), b.(*ClusterSpec), scope)
|
||||
}); err != nil {
|
||||
|
@ -1144,6 +1139,11 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*CanalNetworkingSpec)(nil), (*kops.CanalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(a.(*CanalNetworkingSpec), b.(*kops.CanalNetworkingSpec), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddConversionFunc((*ClusterSpec)(nil), (*kops.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha2_ClusterSpec_To_kops_ClusterSpec(a.(*ClusterSpec), b.(*kops.ClusterSpec), scope)
|
||||
}); err != nil {
|
||||
|
@ -1782,7 +1782,7 @@ func autoConvert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in *Ca
|
|||
out.ChainInsertMode = in.ChainInsertMode
|
||||
out.CPURequest = in.CPURequest
|
||||
out.DefaultEndpointToHostAction = in.DefaultEndpointToHostAction
|
||||
out.DisableFlannelForwardRules = in.DisableFlannelForwardRules
|
||||
out.FlanneldIptablesForwardRules = in.FlanneldIptablesForwardRules
|
||||
// INFO: in.DisableTxChecksumOffloading opted out of conversion generation
|
||||
out.IptablesBackend = in.IptablesBackend
|
||||
out.LogSeveritySys = in.LogSeveritySys
|
||||
|
@ -1797,16 +1797,11 @@ func autoConvert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in *Ca
|
|||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec is an autogenerated conversion function.
|
||||
func Convert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in *CanalNetworkingSpec, out *kops.CanalNetworkingSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha2_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(in *kops.CanalNetworkingSpec, out *CanalNetworkingSpec, s conversion.Scope) error {
|
||||
out.ChainInsertMode = in.ChainInsertMode
|
||||
out.CPURequest = in.CPURequest
|
||||
out.DefaultEndpointToHostAction = in.DefaultEndpointToHostAction
|
||||
out.DisableFlannelForwardRules = in.DisableFlannelForwardRules
|
||||
out.FlanneldIptablesForwardRules = in.FlanneldIptablesForwardRules
|
||||
out.IptablesBackend = in.IptablesBackend
|
||||
out.LogSeveritySys = in.LogSeveritySys
|
||||
out.MTU = in.MTU
|
||||
|
@ -1820,11 +1815,6 @@ func autoConvert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(in *ko
|
|||
return nil
|
||||
}
|
||||
|
||||
// Convert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec is an autogenerated conversion function.
|
||||
func Convert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(in *kops.CanalNetworkingSpec, out *CanalNetworkingSpec, s conversion.Scope) error {
|
||||
return autoConvert_kops_CanalNetworkingSpec_To_v1alpha2_CanalNetworkingSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha2_CertManagerConfig_To_kops_CertManagerConfig(in *CertManagerConfig, out *kops.CertManagerConfig, s conversion.Scope) error {
|
||||
out.Enabled = in.Enabled
|
||||
out.Managed = in.Managed
|
||||
|
|
|
@ -466,6 +466,11 @@ func (in *CanalNetworkingSpec) DeepCopyInto(out *CanalNetworkingSpec) {
|
|||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.FlanneldIptablesForwardRules != nil {
|
||||
in, out := &in.FlanneldIptablesForwardRules, &out.FlanneldIptablesForwardRules
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.MTU != nil {
|
||||
in, out := &in.MTU, &out.MTU
|
||||
*out = new(int32)
|
||||
|
|
|
@ -205,9 +205,9 @@ type CanalNetworkingSpec struct {
|
|||
// for traffic between pod to host after calico rules have been processed.
|
||||
// Default: ACCEPT (other options: DROP, RETURN)
|
||||
DefaultEndpointToHostAction string `json:"defaultEndpointToHostAction,omitempty"`
|
||||
// DisableFlannelForwardRules configures Flannel to NOT add the
|
||||
// default ACCEPT traffic rules to the iptables FORWARD chain
|
||||
DisableFlannelForwardRules bool `json:"disableFlannelForwardRules,omitempty"`
|
||||
// FlanneldIptablesForwardRules configures Flannel to add the
|
||||
// default ACCEPT traffic rules to the iptables FORWARD chain. (default: true)
|
||||
FlanneldIptablesForwardRules *bool `json:"flanneldIptablesForwardRules,omitempty"`
|
||||
// IptablesBackend controls which variant of iptables binary Felix uses
|
||||
// Default: Auto (other options: Legacy, NFT)
|
||||
IptablesBackend string `json:"iptablesBackend,omitempty"`
|
||||
|
|
|
@ -1731,7 +1731,7 @@ func autoConvert_v1alpha3_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(in *Ca
|
|||
out.ChainInsertMode = in.ChainInsertMode
|
||||
out.CPURequest = in.CPURequest
|
||||
out.DefaultEndpointToHostAction = in.DefaultEndpointToHostAction
|
||||
out.DisableFlannelForwardRules = in.DisableFlannelForwardRules
|
||||
out.FlanneldIptablesForwardRules = in.FlanneldIptablesForwardRules
|
||||
out.IptablesBackend = in.IptablesBackend
|
||||
out.LogSeveritySys = in.LogSeveritySys
|
||||
out.MTU = in.MTU
|
||||
|
@ -1754,7 +1754,7 @@ func autoConvert_kops_CanalNetworkingSpec_To_v1alpha3_CanalNetworkingSpec(in *ko
|
|||
out.ChainInsertMode = in.ChainInsertMode
|
||||
out.CPURequest = in.CPURequest
|
||||
out.DefaultEndpointToHostAction = in.DefaultEndpointToHostAction
|
||||
out.DisableFlannelForwardRules = in.DisableFlannelForwardRules
|
||||
out.FlanneldIptablesForwardRules = in.FlanneldIptablesForwardRules
|
||||
out.IptablesBackend = in.IptablesBackend
|
||||
out.LogSeveritySys = in.LogSeveritySys
|
||||
out.MTU = in.MTU
|
||||
|
|
|
@ -467,6 +467,11 @@ func (in *CanalNetworkingSpec) DeepCopyInto(out *CanalNetworkingSpec) {
|
|||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.FlanneldIptablesForwardRules != nil {
|
||||
in, out := &in.FlanneldIptablesForwardRules, &out.FlanneldIptablesForwardRules
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.MTU != nil {
|
||||
in, out := &in.MTU, &out.MTU
|
||||
*out = new(int32)
|
||||
|
|
|
@ -466,6 +466,11 @@ func (in *CanalNetworkingSpec) DeepCopyInto(out *CanalNetworkingSpec) {
|
|||
x := (*in).DeepCopy()
|
||||
*out = &x
|
||||
}
|
||||
if in.FlanneldIptablesForwardRules != nil {
|
||||
in, out := &in.FlanneldIptablesForwardRules, &out.FlanneldIptablesForwardRules
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.MTU != nil {
|
||||
in, out := &in.MTU, &out.MTU
|
||||
*out = new(int32)
|
||||
|
|
|
@ -20,6 +20,7 @@ filegroup(
|
|||
name = "exported_testdata",
|
||||
srcs = glob([
|
||||
"aws/**",
|
||||
"canal/**",
|
||||
"minimal/**",
|
||||
]),
|
||||
visibility = ["//visibility:public"],
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: Cluster
|
||||
metadata:
|
||||
creationTimestamp: "2016-12-10T22:42:27Z"
|
||||
name: minimal.example.com
|
||||
spec:
|
||||
additionalSans:
|
||||
- proxy.api.minimal.example.com
|
||||
addons:
|
||||
- manifest: s3://somebucket/example.yaml
|
||||
api:
|
||||
dns: {}
|
||||
authorization:
|
||||
alwaysAllow: {}
|
||||
channel: stable
|
||||
cloudProvider: aws
|
||||
configBase: memfs://clusters.example.com/minimal.example.com
|
||||
etcdClusters:
|
||||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- instanceGroup: master-us-test-1a
|
||||
name: us-test-1a
|
||||
memoryRequest: 100Mi
|
||||
name: main
|
||||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- instanceGroup: master-us-test-1a
|
||||
name: us-test-1a
|
||||
memoryRequest: 100Mi
|
||||
name: events
|
||||
iam:
|
||||
legacy: false
|
||||
kubernetesApiAccess:
|
||||
- 0.0.0.0/0
|
||||
kubernetesVersion: v1.14.0
|
||||
masterInternalName: api.internal.minimal.example.com
|
||||
masterPublicName: api.minimal.example.com
|
||||
networkCIDR: 172.20.0.0/16
|
||||
networking:
|
||||
canal:
|
||||
disableFlannelForwardRules: true
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
sshAccess:
|
||||
- 0.0.0.0/0
|
||||
subnets:
|
||||
- cidr: 172.20.32.0/19
|
||||
name: us-test-1a
|
||||
type: Public
|
||||
zone: us-test-1a
|
||||
topology:
|
||||
dns:
|
||||
type: Public
|
||||
masters: public
|
||||
nodes: public
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2016-12-10T22:42:28Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: minimal.example.com
|
||||
name: nodes
|
||||
spec:
|
||||
associatePublicIp: true
|
||||
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
|
||||
machineType: t2.medium
|
||||
maxSize: 2
|
||||
minSize: 2
|
||||
role: Node
|
||||
subnets:
|
||||
- us-test-1a
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha2
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2016-12-10T22:42:28Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: minimal.example.com
|
||||
name: master-us-test-1a
|
||||
spec:
|
||||
associatePublicIp: true
|
||||
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
|
||||
machineType: m3.medium
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- us-test-1a
|
|
@ -0,0 +1,91 @@
|
|||
apiVersion: kops.k8s.io/v1alpha3
|
||||
kind: Cluster
|
||||
metadata:
|
||||
creationTimestamp: "2016-12-10T22:42:27Z"
|
||||
name: minimal.example.com
|
||||
spec:
|
||||
additionalSANs:
|
||||
- proxy.api.minimal.example.com
|
||||
addons:
|
||||
- manifest: s3://somebucket/example.yaml
|
||||
api:
|
||||
dns: {}
|
||||
authorization:
|
||||
alwaysAllow: {}
|
||||
channel: stable
|
||||
cloudProvider: aws
|
||||
configBase: memfs://clusters.example.com/minimal.example.com
|
||||
etcdClusters:
|
||||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- instanceGroup: master-us-test-1a
|
||||
name: us-test-1a
|
||||
memoryRequest: 100Mi
|
||||
name: main
|
||||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- instanceGroup: master-us-test-1a
|
||||
name: us-test-1a
|
||||
memoryRequest: 100Mi
|
||||
name: events
|
||||
iam: {}
|
||||
kubernetesAPIAccess:
|
||||
- 0.0.0.0/0
|
||||
kubernetesVersion: v1.14.0
|
||||
masterInternalName: api.internal.minimal.example.com
|
||||
masterPublicName: api.minimal.example.com
|
||||
networkCIDR: 172.20.0.0/16
|
||||
networking:
|
||||
canal:
|
||||
flanneldIptablesForwardRules: false
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
sshAccess:
|
||||
- 0.0.0.0/0
|
||||
subnets:
|
||||
- cidr: 172.20.32.0/19
|
||||
name: us-test-1a
|
||||
type: Public
|
||||
zone: us-test-1a
|
||||
topology:
|
||||
dns:
|
||||
type: Public
|
||||
masters: public
|
||||
nodes: public
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha3
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2016-12-10T22:42:28Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: minimal.example.com
|
||||
name: nodes
|
||||
spec:
|
||||
associatePublicIP: true
|
||||
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
|
||||
machineType: t2.medium
|
||||
maxSize: 2
|
||||
minSize: 2
|
||||
role: Node
|
||||
subnets:
|
||||
- us-test-1a
|
||||
|
||||
---
|
||||
|
||||
apiVersion: kops.k8s.io/v1alpha3
|
||||
kind: InstanceGroup
|
||||
metadata:
|
||||
creationTimestamp: "2016-12-10T22:42:28Z"
|
||||
labels:
|
||||
kops.k8s.io/cluster: minimal.example.com
|
||||
name: master-us-test-1a
|
||||
spec:
|
||||
associatePublicIP: true
|
||||
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
|
||||
machineType: m3.medium
|
||||
maxSize: 1
|
||||
minSize: 1
|
||||
role: Master
|
||||
subnets:
|
||||
- us-test-1a
|
|
@ -43,6 +43,11 @@ func TestConversionAWS(t *testing.T) {
|
|||
runTest(t, "aws", "v1alpha3", "v1alpha2")
|
||||
}
|
||||
|
||||
func TestConversionCanal(t *testing.T) {
|
||||
runTest(t, "canal", "v1alpha2", "v1alpha3")
|
||||
runTest(t, "canal", "v1alpha3", "v1alpha2")
|
||||
}
|
||||
|
||||
func runTest(t *testing.T, srcDir string, fromVersion string, toVersion string) {
|
||||
t.Run(fromVersion+"-"+toVersion, func(t *testing.T) {
|
||||
sourcePath := path.Join(srcDir, fromVersion+".yaml")
|
||||
|
|
|
@ -800,7 +800,7 @@ spec:
|
|||
configMapKeyRef:
|
||||
name: canal-config
|
||||
key: masquerade
|
||||
{{- if eq .Networking.Canal.DisableFlannelForwardRules true }}
|
||||
{{- if not (WithDefaultBool .Networking.Canal.FlanneldIptablesForwardRules true) }}
|
||||
- name: FLANNELD_IPTABLES_FORWARD_RULES
|
||||
value: "false"
|
||||
{{- end }}
|
||||
|
|
|
@ -4464,7 +4464,7 @@ spec:
|
|||
configMapKeyRef:
|
||||
name: canal-config
|
||||
key: masquerade
|
||||
{{- if .Networking.Canal.DisableFlannelForwardRules }}
|
||||
{{- if not (WithDefaultBool .Networking.Canal.FlanneldIptablesForwardRules true) }}
|
||||
- name: FLANNELD_IPTABLES_FORWARD_RULES
|
||||
value: "false"
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in New Issue