From f5059c7fd0ba38651515af182248d84039e0e804 Mon Sep 17 00:00:00 2001 From: Daneyon Hansen Date: Mon, 29 Jun 2020 15:17:07 -0700 Subject: [PATCH] Adds AWS Load Balancer Settings to EndpointPublishingStrategy API --- ...ess-operator_00-ingresscontroller.crd.yaml | 28 +++++++++++++++++++ operator/v1/types_ingress.go | 28 +++++++++++++++++++ operator/v1/zz_generated.deepcopy.go | 23 ++++++++++++++- .../v1/zz_generated.swagger_doc_generated.go | 10 +++++++ 4 files changed, 88 insertions(+), 1 deletion(-) diff --git a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index 66648561f08..2ab8ee22c4c 100644 --- a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -101,6 +101,20 @@ spec: - Internal - External type: string + type: + description: "aws provides configuration settings that are specific + to AWS load balancers. \n If this field is empty, the default + values are used." + properties: + type: + description: "type is the type of AWS load balancer to instantiate + for an ingress controller. \n If unspecified, \"Classic\" + is used." + enum: + - Classic + - NLB + type: string + type: object required: - scope type: object @@ -641,6 +655,20 @@ spec: - Internal - External type: string + type: + description: "aws provides configuration settings that are specific + to AWS load balancers. \n If this field is empty, the default + values are used." + properties: + type: + description: "type is the type of AWS load balancer to instantiate + for an ingress controller. \n If unspecified, \"Classic\" + is used." + enum: + - Classic + - NLB + type: string + type: object required: - scope type: object diff --git a/operator/v1/types_ingress.go b/operator/v1/types_ingress.go index f49bc433df4..944831b5a8e 100644 --- a/operator/v1/types_ingress.go +++ b/operator/v1/types_ingress.go @@ -233,8 +233,36 @@ type LoadBalancerStrategy struct { // +kubebuilder:validation:Required // +required Scope LoadBalancerScope `json:"scope"` + // aws provides configuration settings that are specific to AWS + // load balancers. + // + // If this field is empty, the default values are used. + // + // +optional + AWS *AWSLoadBalancerParameters `json:"aws,omitempty"` } +// AWSLoadBalancerParameters provides configuration settings that are +// specific to AWS load balancers. +type AWSLoadBalancerParameters struct { + // type is the type of AWS load balancer to instantiate for an ingress + // controller. + // + // If unspecified, "Classic" is used. + // + // +optional + Type AWSLoadBalancerType `json:"type,omitempty"` +} + +// AWSLoadBalancerType is the type of AWS load balancer to instantiate. +// +kubebuilder:validation:Enum=Classic;NLB +type AWSLoadBalancerType string + +var ( + AWSClassicLoadBalancer AWSLoadBalancerType = "Classic" + AWSNetworkLoadBalancer AWSLoadBalancerType = "NLB" +) + // HostNetworkStrategy holds parameters for the HostNetwork endpoint publishing // strategy. type HostNetworkStrategy struct { diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 63611504601..fe9bc9b2f94 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -11,6 +11,22 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLoadBalancerParameters) DeepCopyInto(out *AWSLoadBalancerParameters) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLoadBalancerParameters. +func (in *AWSLoadBalancerParameters) DeepCopy() *AWSLoadBalancerParameters { + if in == nil { + return nil + } + out := new(AWSLoadBalancerParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AccessLogging) DeepCopyInto(out *AccessLogging) { *out = *in @@ -664,7 +680,7 @@ func (in *EndpointPublishingStrategy) DeepCopyInto(out *EndpointPublishingStrate if in.LoadBalancer != nil { in, out := &in.LoadBalancer, &out.LoadBalancer *out = new(LoadBalancerStrategy) - **out = **in + (*in).DeepCopyInto(*out) } if in.HostNetwork != nil { in, out := &in.HostNetwork, &out.HostNetwork @@ -1474,6 +1490,11 @@ func (in *KuryrConfig) DeepCopy() *KuryrConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancerStrategy) DeepCopyInto(out *LoadBalancerStrategy) { *out = *in + if in.AWS != nil { + in, out := &in.AWS, &out.AWS + *out = new(AWSLoadBalancerParameters) + **out = **in + } return } diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index e35de1d623e..1b4132c35e8 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -329,6 +329,15 @@ func (EtcdList) SwaggerDoc() map[string]string { return map_EtcdList } +var map_AWSLoadBalancerParameters = map[string]string{ + "": "AWSLoadBalancerParameters provides configuration settings that are specific to AWS load balancers.", + "type": "type is the type of AWS load balancer to instantiate for an ingress controller.\n\nIf unspecified, \"Classic\" is used.", +} + +func (AWSLoadBalancerParameters) SwaggerDoc() map[string]string { + return map_AWSLoadBalancerParameters +} + var map_AccessLogging = map[string]string{ "": "AccessLogging describes how client requests should be logged.", "destination": "destination is where access logs go.", @@ -431,6 +440,7 @@ func (IngressControllerStatus) SwaggerDoc() map[string]string { var map_LoadBalancerStrategy = map[string]string{ "": "LoadBalancerStrategy holds parameters for a load balancer.", "scope": "scope indicates the scope at which the load balancer is exposed. Possible values are \"External\" and \"Internal\".", + "aws": "aws provides configuration settings that are specific to AWS load balancers.\n\nIf this field is empty, the default values are used.", } func (LoadBalancerStrategy) SwaggerDoc() map[string]string {