Merge pull request #15612 from johngmyers/gcp-network

v1alpha3: Rename GCE networking to GCP
This commit is contained in:
Kubernetes Prow Robot 2023-07-09 21:13:05 -07:00 committed by GitHub
commit b915c6047c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 150 additions and 137 deletions

View File

@ -1003,7 +1003,7 @@ func completeNetworking(options *CreateClusterOptions) func(cmd *cobra.Command,
}
if options.CloudProvider == "gce" || options.CloudProvider == "" {
completions = append(completions, "gce")
completions = append(completions, "gcp")
}
}

View File

@ -1645,6 +1645,7 @@ the removal of fields no longer in use.
| networking.cilium.IPTablesRulesNoinstall | networking.cilium.installIptablesRules (value inverted) |
| networking.cilium.toFqdnsDnsRejectResponseCode | networking.cilium.toFQDNsDNSRejectResponseCode |
| networking.cilium.toFqdnsEnablePoller | networking.cilium.toFQDNsEnablePoller |
| networking.gce | networking.gcp |
| networking.kuberouter | networking.kubeRouter |
| nodeTerminationHandler | cloudProvider.aws.nodeTerminationHandler |
| nonMasqueradeCIDR | networking.nonMasqueradeCIDR |

View File

@ -5181,8 +5181,8 @@ spec:
type: integer
type: object
gce:
description: GCENetworkingSpec is the specification of GCE's native
networking mode, using IP aliases
description: GCPNetworkingSpec is the specification of GCP's native
networking mode, using IP aliases.
type: object
kopeio:
description: KopeioNetworkingSpec declares that we want Kopeio

View File

@ -400,7 +400,7 @@ func (b *ContainerdBuilder) buildIPMasqueradeRules(c *fi.NodeupModelBuilderConte
// skips masquerading for all private CIDR ranges, but this depends on an assumption that is likely GCE-specific.
// On GCE custom routes are at the network level, on AWS they are at the route-table / subnet level.
// We cannot generally assume that because something is in the private network space, that it can reach us.
// If we adopt "native" pod IPs (GCE ip-alias, AWS VPC CNI, etc) we can likely move to rules closer to the upstream ones.
// If we adopt "native" pod IPs (GCP ip-alias, AWS VPC CNI, etc) we can likely move to rules closer to the upstream ones.
script := `#!/bin/bash
# Built by kOps - do not edit

View File

@ -77,7 +77,7 @@ type NetworkingSpec struct {
AmazonVPC *AmazonVPCNetworkingSpec `json:"amazonVPC,omitempty"`
Cilium *CiliumNetworkingSpec `json:"cilium,omitempty"`
LyftVPC *LyftVPCNetworkingSpec `json:"lyftvpc,omitempty"`
GCE *GCENetworkingSpec `json:"gce,omitempty"`
GCP *GCPNetworkingSpec `json:"gcp,omitempty"`
}
// UsesKubenet returns true if our networking is derived from kubenet
@ -87,8 +87,8 @@ func (n *NetworkingSpec) UsesKubenet() bool {
}
if n.Kubenet != nil {
return true
} else if n.GCE != nil {
// GCE IP Alias networking is based on kubenet
} else if n.GCP != nil {
// GCP IP Alias networking is based on kubenet
return true
} else if n.External != nil {
// external is based on kubenet
@ -505,5 +505,5 @@ type LyftVPCNetworkingSpec struct {
SubnetTags map[string]string `json:"subnetTags,omitempty"`
}
// GCENetworkingSpec is the specification of GCE's native networking mode, using IP aliases
type GCENetworkingSpec struct{}
// GCPNetworkingSpec is the specification of GCP's native networking mode, using IP aliases.
type GCPNetworkingSpec struct{}

View File

@ -48,13 +48,13 @@ type NetworkingSpec struct {
AmazonVPC *AmazonVPCNetworkingSpec `json:"amazonvpc,omitempty"`
Cilium *CiliumNetworkingSpec `json:"cilium,omitempty"`
LyftVPC *LyftVPCNetworkingSpec `json:"lyftvpc,omitempty"`
GCE *GCENetworkingSpec `json:"gce,omitempty"`
GCP *GCPNetworkingSpec `json:"gce,omitempty"`
}
func (s *NetworkingSpec) IsEmpty() bool {
return s.Classic == nil && s.Kubenet == nil && s.External == nil && s.CNI == nil && s.Kopeio == nil &&
s.Weave == nil && s.Flannel == nil && s.Calico == nil && s.Canal == nil && s.KubeRouter == nil &&
s.Romana == nil && s.AmazonVPC == nil && s.Cilium == nil && s.LyftVPC == nil && s.GCE == nil
s.Romana == nil && s.AmazonVPC == nil && s.Cilium == nil && s.LyftVPC == nil && s.GCP == nil
}
// ClassicNetworkingSpec is the specification of classic networking mode, integrated into kubernetes.
@ -626,5 +626,5 @@ type LyftVPCNetworkingSpec struct {
SubnetTags map[string]string `json:"subnetTags,omitempty"`
}
// GCENetworkingSpec is the specification of GCE's native networking mode, using IP aliases
type GCENetworkingSpec struct{}
// GCPNetworkingSpec is the specification of GCP's native networking mode, using IP aliases.
type GCPNetworkingSpec struct{}

View File

@ -454,13 +454,13 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*GCENetworkingSpec)(nil), (*kops.GCENetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_GCENetworkingSpec_To_kops_GCENetworkingSpec(a.(*GCENetworkingSpec), b.(*kops.GCENetworkingSpec), scope)
if err := s.AddGeneratedConversionFunc((*GCPNetworkingSpec)(nil), (*kops.GCPNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(a.(*GCPNetworkingSpec), b.(*kops.GCPNetworkingSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.GCENetworkingSpec)(nil), (*GCENetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_GCENetworkingSpec_To_v1alpha2_GCENetworkingSpec(a.(*kops.GCENetworkingSpec), b.(*GCENetworkingSpec), scope)
if err := s.AddGeneratedConversionFunc((*kops.GCPNetworkingSpec)(nil), (*GCPNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_GCPNetworkingSpec_To_v1alpha2_GCPNetworkingSpec(a.(*kops.GCPNetworkingSpec), b.(*GCPNetworkingSpec), scope)
}); err != nil {
return err
}
@ -3782,22 +3782,22 @@ func Convert_kops_FlannelNetworkingSpec_To_v1alpha2_FlannelNetworkingSpec(in *ko
return autoConvert_kops_FlannelNetworkingSpec_To_v1alpha2_FlannelNetworkingSpec(in, out, s)
}
func autoConvert_v1alpha2_GCENetworkingSpec_To_kops_GCENetworkingSpec(in *GCENetworkingSpec, out *kops.GCENetworkingSpec, s conversion.Scope) error {
func autoConvert_v1alpha2_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(in *GCPNetworkingSpec, out *kops.GCPNetworkingSpec, s conversion.Scope) error {
return nil
}
// Convert_v1alpha2_GCENetworkingSpec_To_kops_GCENetworkingSpec is an autogenerated conversion function.
func Convert_v1alpha2_GCENetworkingSpec_To_kops_GCENetworkingSpec(in *GCENetworkingSpec, out *kops.GCENetworkingSpec, s conversion.Scope) error {
return autoConvert_v1alpha2_GCENetworkingSpec_To_kops_GCENetworkingSpec(in, out, s)
// Convert_v1alpha2_GCPNetworkingSpec_To_kops_GCPNetworkingSpec is an autogenerated conversion function.
func Convert_v1alpha2_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(in *GCPNetworkingSpec, out *kops.GCPNetworkingSpec, s conversion.Scope) error {
return autoConvert_v1alpha2_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(in, out, s)
}
func autoConvert_kops_GCENetworkingSpec_To_v1alpha2_GCENetworkingSpec(in *kops.GCENetworkingSpec, out *GCENetworkingSpec, s conversion.Scope) error {
func autoConvert_kops_GCPNetworkingSpec_To_v1alpha2_GCPNetworkingSpec(in *kops.GCPNetworkingSpec, out *GCPNetworkingSpec, s conversion.Scope) error {
return nil
}
// Convert_kops_GCENetworkingSpec_To_v1alpha2_GCENetworkingSpec is an autogenerated conversion function.
func Convert_kops_GCENetworkingSpec_To_v1alpha2_GCENetworkingSpec(in *kops.GCENetworkingSpec, out *GCENetworkingSpec, s conversion.Scope) error {
return autoConvert_kops_GCENetworkingSpec_To_v1alpha2_GCENetworkingSpec(in, out, s)
// Convert_kops_GCPNetworkingSpec_To_v1alpha2_GCPNetworkingSpec is an autogenerated conversion function.
func Convert_kops_GCPNetworkingSpec_To_v1alpha2_GCPNetworkingSpec(in *kops.GCPNetworkingSpec, out *GCPNetworkingSpec, s conversion.Scope) error {
return autoConvert_kops_GCPNetworkingSpec_To_v1alpha2_GCPNetworkingSpec(in, out, s)
}
func autoConvert_v1alpha2_GossipConfig_To_kops_GossipConfig(in *GossipConfig, out *kops.GossipConfig, s conversion.Scope) error {
@ -6010,14 +6010,14 @@ func autoConvert_v1alpha2_NetworkingSpec_To_kops_NetworkingSpec(in *NetworkingSp
} else {
out.LyftVPC = nil
}
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(kops.GCENetworkingSpec)
if err := Convert_v1alpha2_GCENetworkingSpec_To_kops_GCENetworkingSpec(*in, *out, s); err != nil {
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(kops.GCPNetworkingSpec)
if err := Convert_v1alpha2_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(*in, *out, s); err != nil {
return err
}
} else {
out.GCE = nil
out.GCP = nil
}
return nil
}
@ -6191,14 +6191,14 @@ func autoConvert_kops_NetworkingSpec_To_v1alpha2_NetworkingSpec(in *kops.Network
} else {
out.LyftVPC = nil
}
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(GCENetworkingSpec)
if err := Convert_kops_GCENetworkingSpec_To_v1alpha2_GCENetworkingSpec(*in, *out, s); err != nil {
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(GCPNetworkingSpec)
if err := Convert_kops_GCPNetworkingSpec_To_v1alpha2_GCPNetworkingSpec(*in, *out, s); err != nil {
return err
}
} else {
out.GCE = nil
out.GCP = nil
}
return nil
}

View File

@ -2094,17 +2094,17 @@ func (in *FlannelNetworkingSpec) DeepCopy() *FlannelNetworkingSpec {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCENetworkingSpec) DeepCopyInto(out *GCENetworkingSpec) {
func (in *GCPNetworkingSpec) DeepCopyInto(out *GCPNetworkingSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCENetworkingSpec.
func (in *GCENetworkingSpec) DeepCopy() *GCENetworkingSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPNetworkingSpec.
func (in *GCPNetworkingSpec) DeepCopy() *GCPNetworkingSpec {
if in == nil {
return nil
}
out := new(GCENetworkingSpec)
out := new(GCPNetworkingSpec)
in.DeepCopyInto(out)
return out
}
@ -4428,9 +4428,9 @@ func (in *NetworkingSpec) DeepCopyInto(out *NetworkingSpec) {
*out = new(LyftVPCNetworkingSpec)
(*in).DeepCopyInto(*out)
}
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(GCENetworkingSpec)
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(GCPNetworkingSpec)
**out = **in
}
return

View File

@ -81,7 +81,7 @@ type NetworkingSpec struct {
AmazonVPC *AmazonVPCNetworkingSpec `json:"amazonVPC,omitempty"`
Cilium *CiliumNetworkingSpec `json:"cilium,omitempty"`
LyftVPC *kops.LyftVPCNetworkingSpec `json:"-"`
GCE *GCENetworkingSpec `json:"gce,omitempty"`
GCP *GCPNetworkingSpec `json:"gcp,omitempty"`
}
// KubenetNetworkingSpec is the specification for kubenet networking, largely integrated but intended to replace classic
@ -462,5 +462,5 @@ type HubbleSpec struct {
Metrics []string `json:"metrics,omitempty"`
}
// GCENetworkingSpec is the specification of GCE's native networking mode, using IP aliases
type GCENetworkingSpec struct{}
// GCPNetworkingSpec is the specification of GCP's native networking mode, using IP aliases.
type GCPNetworkingSpec struct{}

View File

@ -514,16 +514,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*GCENetworkingSpec)(nil), (*kops.GCENetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_GCENetworkingSpec_To_kops_GCENetworkingSpec(a.(*GCENetworkingSpec), b.(*kops.GCENetworkingSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.GCENetworkingSpec)(nil), (*GCENetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_GCENetworkingSpec_To_v1alpha3_GCENetworkingSpec(a.(*kops.GCENetworkingSpec), b.(*GCENetworkingSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*GCESpec)(nil), (*kops.GCESpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_GCESpec_To_kops_GCESpec(a.(*GCESpec), b.(*kops.GCESpec), scope)
}); err != nil {
@ -534,6 +524,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*GCPNetworkingSpec)(nil), (*kops.GCPNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(a.(*GCPNetworkingSpec), b.(*kops.GCPNetworkingSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.GCPNetworkingSpec)(nil), (*GCPNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec(a.(*kops.GCPNetworkingSpec), b.(*GCPNetworkingSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*GossipConfig)(nil), (*kops.GossipConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_GossipConfig_To_kops_GossipConfig(a.(*GossipConfig), b.(*kops.GossipConfig), scope)
}); err != nil {
@ -4017,24 +4017,6 @@ func Convert_kops_FlannelNetworkingSpec_To_v1alpha3_FlannelNetworkingSpec(in *ko
return autoConvert_kops_FlannelNetworkingSpec_To_v1alpha3_FlannelNetworkingSpec(in, out, s)
}
func autoConvert_v1alpha3_GCENetworkingSpec_To_kops_GCENetworkingSpec(in *GCENetworkingSpec, out *kops.GCENetworkingSpec, s conversion.Scope) error {
return nil
}
// Convert_v1alpha3_GCENetworkingSpec_To_kops_GCENetworkingSpec is an autogenerated conversion function.
func Convert_v1alpha3_GCENetworkingSpec_To_kops_GCENetworkingSpec(in *GCENetworkingSpec, out *kops.GCENetworkingSpec, s conversion.Scope) error {
return autoConvert_v1alpha3_GCENetworkingSpec_To_kops_GCENetworkingSpec(in, out, s)
}
func autoConvert_kops_GCENetworkingSpec_To_v1alpha3_GCENetworkingSpec(in *kops.GCENetworkingSpec, out *GCENetworkingSpec, s conversion.Scope) error {
return nil
}
// Convert_kops_GCENetworkingSpec_To_v1alpha3_GCENetworkingSpec is an autogenerated conversion function.
func Convert_kops_GCENetworkingSpec_To_v1alpha3_GCENetworkingSpec(in *kops.GCENetworkingSpec, out *GCENetworkingSpec, s conversion.Scope) error {
return autoConvert_kops_GCENetworkingSpec_To_v1alpha3_GCENetworkingSpec(in, out, s)
}
func autoConvert_v1alpha3_GCESpec_To_kops_GCESpec(in *GCESpec, out *kops.GCESpec, s conversion.Scope) error {
out.Project = in.Project
out.ServiceAccount = in.ServiceAccount
@ -4081,6 +4063,24 @@ func Convert_kops_GCESpec_To_v1alpha3_GCESpec(in *kops.GCESpec, out *GCESpec, s
return autoConvert_kops_GCESpec_To_v1alpha3_GCESpec(in, out, s)
}
func autoConvert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(in *GCPNetworkingSpec, out *kops.GCPNetworkingSpec, s conversion.Scope) error {
return nil
}
// Convert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec is an autogenerated conversion function.
func Convert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(in *GCPNetworkingSpec, out *kops.GCPNetworkingSpec, s conversion.Scope) error {
return autoConvert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(in, out, s)
}
func autoConvert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec(in *kops.GCPNetworkingSpec, out *GCPNetworkingSpec, s conversion.Scope) error {
return nil
}
// Convert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec is an autogenerated conversion function.
func Convert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec(in *kops.GCPNetworkingSpec, out *GCPNetworkingSpec, s conversion.Scope) error {
return autoConvert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec(in, out, s)
}
func autoConvert_v1alpha3_GossipConfig_To_kops_GossipConfig(in *GossipConfig, out *kops.GossipConfig, s conversion.Scope) error {
out.Protocol = in.Protocol
out.Listen = in.Listen
@ -6323,14 +6323,14 @@ func autoConvert_v1alpha3_NetworkingSpec_To_kops_NetworkingSpec(in *NetworkingSp
out.Cilium = nil
}
out.LyftVPC = in.LyftVPC
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(kops.GCENetworkingSpec)
if err := Convert_v1alpha3_GCENetworkingSpec_To_kops_GCENetworkingSpec(*in, *out, s); err != nil {
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(kops.GCPNetworkingSpec)
if err := Convert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(*in, *out, s); err != nil {
return err
}
} else {
out.GCE = nil
out.GCP = nil
}
return nil
}
@ -6480,14 +6480,14 @@ func autoConvert_kops_NetworkingSpec_To_v1alpha3_NetworkingSpec(in *kops.Network
out.Cilium = nil
}
out.LyftVPC = in.LyftVPC
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(GCENetworkingSpec)
if err := Convert_kops_GCENetworkingSpec_To_v1alpha3_GCENetworkingSpec(*in, *out, s); err != nil {
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(GCPNetworkingSpec)
if err := Convert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec(*in, *out, s); err != nil {
return err
}
} else {
out.GCE = nil
out.GCP = nil
}
return nil
}

View File

@ -1983,22 +1983,6 @@ func (in *FlannelNetworkingSpec) DeepCopy() *FlannelNetworkingSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCENetworkingSpec) DeepCopyInto(out *GCENetworkingSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCENetworkingSpec.
func (in *GCENetworkingSpec) DeepCopy() *GCENetworkingSpec {
if in == nil {
return nil
}
out := new(GCENetworkingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCESpec) DeepCopyInto(out *GCESpec) {
*out = *in
@ -2035,6 +2019,22 @@ func (in *GCESpec) DeepCopy() *GCESpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCPNetworkingSpec) DeepCopyInto(out *GCPNetworkingSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPNetworkingSpec.
func (in *GCPNetworkingSpec) DeepCopy() *GCPNetworkingSpec {
if in == nil {
return nil
}
out := new(GCPNetworkingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GossipConfig) DeepCopyInto(out *GossipConfig) {
*out = *in
@ -4358,9 +4358,9 @@ func (in *NetworkingSpec) DeepCopyInto(out *NetworkingSpec) {
*out = new(kops.LyftVPCNetworkingSpec)
(*in).DeepCopyInto(*out)
}
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(GCENetworkingSpec)
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(GCPNetworkingSpec)
**out = **in
}
return

View File

@ -1128,12 +1128,12 @@ func validateNetworking(cluster *kops.Cluster, v *kops.NetworkingSpec, fldPath *
allErrs = append(allErrs, field.Forbidden(fldPath.Child("lyftvp"), "support for LyftVPC has been removed"))
}
if v.GCE != nil {
if v.GCP != nil {
if optionTaken {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("gce"), "only one networking option permitted"))
allErrs = append(allErrs, field.Forbidden(fldPath.Child("gcp"), "only one networking option permitted"))
}
allErrs = append(allErrs, validateNetworkingGCE(c, v.GCE, fldPath.Child("gce"))...)
allErrs = append(allErrs, validateNetworkingGCP(c, v.GCP, fldPath.Child("gcp"))...)
}
return allErrs
@ -1300,15 +1300,15 @@ func validateNetworkingCilium(cluster *kops.Cluster, v *kops.CiliumNetworkingSpe
return allErrs
}
func validateNetworkingGCE(c *kops.ClusterSpec, v *kops.GCENetworkingSpec, fldPath *field.Path) field.ErrorList {
func validateNetworkingGCP(c *kops.ClusterSpec, v *kops.GCPNetworkingSpec, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if c.GetCloudProvider() != kops.CloudProviderGCE {
allErrs = append(allErrs, field.Forbidden(fldPath, "GCE networking is supported only when on GCP"))
allErrs = append(allErrs, field.Forbidden(fldPath, "GCP networking is supported only when on GCP"))
}
if c.IsIPv6Only() {
allErrs = append(allErrs, field.Forbidden(fldPath, "GCE networking does not support IPv6"))
allErrs = append(allErrs, field.Forbidden(fldPath, "GCP networking does not support IPv6"))
}
return allErrs

View File

@ -2146,22 +2146,6 @@ func (in *FlannelNetworkingSpec) DeepCopy() *FlannelNetworkingSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCENetworkingSpec) DeepCopyInto(out *GCENetworkingSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCENetworkingSpec.
func (in *GCENetworkingSpec) DeepCopy() *GCENetworkingSpec {
if in == nil {
return nil
}
out := new(GCENetworkingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCESpec) DeepCopyInto(out *GCESpec) {
*out = *in
@ -2198,6 +2182,22 @@ func (in *GCESpec) DeepCopy() *GCESpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCPNetworkingSpec) DeepCopyInto(out *GCPNetworkingSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPNetworkingSpec.
func (in *GCPNetworkingSpec) DeepCopy() *GCPNetworkingSpec {
if in == nil {
return nil
}
out := new(GCPNetworkingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GossipConfig) DeepCopyInto(out *GossipConfig) {
*out = *in
@ -4576,9 +4576,9 @@ func (in *NetworkingSpec) DeepCopyInto(out *NetworkingSpec) {
*out = new(LyftVPCNetworkingSpec)
(*in).DeepCopyInto(*out)
}
if in.GCE != nil {
in, out := &in.GCE, &out.GCE
*out = new(GCENetworkingSpec)
if in.GCP != nil {
in, out := &in.GCP, &out.GCP
*out = new(GCPNetworkingSpec)
**out = **in
}
return

View File

@ -64,7 +64,7 @@ func (b *AWSCloudControllerManagerOptionsBuilder) BuildOptions(o interface{}) er
networking := &clusterSpec.Networking
if networking.Kubenet != nil {
eccm.ConfigureCloudRoutes = fi.PtrTo(true)
} else if networking.GCE != nil {
} else if networking.GCP != nil {
eccm.ConfigureCloudRoutes = fi.PtrTo(false)
eccm.CIDRAllocatorType = fi.PtrTo("CloudAllocator")

View File

@ -58,8 +58,8 @@ func (b *GCPCloudControllerManagerOptionsBuilder) BuildOptions(options interface
ccmConfig.ClusterCIDR = clusterSpec.Networking.PodCIDR
}
if clusterSpec.Networking.GCE != nil {
// "GCE" networking mode is called "ip-alias" or "vpc-native" on GKE.
if clusterSpec.Networking.GCP != nil {
// "GCP" networking mode is called "ip-alias" or "vpc-native" on GKE.
// We don't need to configure routes if we are using "real" IPs.
ccmConfig.ConfigureCloudRoutes = fi.PtrTo(false)
}

View File

@ -148,7 +148,7 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
networking := &clusterSpec.Networking
if networking.Kubenet != nil {
kcm.ConfigureCloudRoutes = fi.PtrTo(true)
} else if networking.GCE != nil {
} else if networking.GCP != nil {
kcm.ConfigureCloudRoutes = fi.PtrTo(false)
if kcm.CloudProvider == "external" {
// kcm should not allocate node cidrs with the CloudAllocator if we're using the external CCM

View File

@ -43,7 +43,7 @@ func (b *NetworkingOptionsBuilder) BuildOptions(o interface{}) error {
if b.Context.IsKubernetesLT("1.24") {
if UsesCNI(networking) {
options.Kubelet.NetworkPluginName = fi.PtrTo("cni")
} else if networking.GCE != nil {
} else if networking.GCP != nil {
options.Kubelet.NetworkPluginName = fi.PtrTo("kubenet")
}
}

View File

@ -133,7 +133,7 @@ func (c *GCEModelContext) NameForFirewallRule(id string) string {
}
func (c *GCEModelContext) NetworkingIsIPAlias() bool {
return c.Cluster.Spec.Networking.GCE != nil
return c.Cluster.Spec.Networking.GCP != nil
}
func (c *GCEModelContext) NetworkingIsGCERoutes() bool {

View File

@ -31,7 +31,7 @@ import (
// UsesIPAliases checks if the cluster uses IP aliases for network connectivity
func UsesIPAliases(c *kops.Cluster) bool {
if c.Spec.Networking.GCE != nil {
if c.Spec.Networking.GCP != nil {
return true
}
return false

View File

@ -1142,8 +1142,8 @@ func setupNetworking(opt *NewClusterOptions, cluster *api.Cluster) error {
case "cilium-eni":
addCiliumNetwork(cluster)
cluster.Spec.Networking.Cilium.IPAM = "eni"
case "gce":
cluster.Spec.Networking.GCE = &api.GCENetworkingSpec{}
case "gcp", "gce":
cluster.Spec.Networking.GCP = &api.GCPNetworkingSpec{}
default:
return fmt.Errorf("unknown networking mode %q", opt.Networking)
}

View File

@ -296,7 +296,19 @@ func TestSetupNetworking(t *testing.T) {
expected: api.Cluster{
Spec: api.ClusterSpec{
Networking: api.NetworkingSpec{
GCE: &api.GCENetworkingSpec{},
GCP: &api.GCPNetworkingSpec{},
},
},
},
},
{
options: NewClusterOptions{
Networking: "gcp",
},
expected: api.Cluster{
Spec: api.ClusterSpec{
Networking: api.NetworkingSpec{
GCP: &api.GCPNetworkingSpec{},
},
},
},