Skip to content

Commit

Permalink
NE-1516: Adds a field in the cluster ingress config object and Ingres…
Browse files Browse the repository at this point in the history
…s Controller to set EIP via installer and Ingress Controller

`config/v1/types_ingress.go` - Adds an API field `eip-allocations` in the cluster ingress config object whose value is set by the installer using install-config.yaml
`operator/v1/types_ingress.go` - Adds an API field `eip-allocations` in the Ingress Controller CR object using which the Ingress Operator scales an Ingress Controller
with service type balancer whose annotation `service.beta.kubernetes.io/aws-load-balancer-eip-allocations` is set by the value of the field `eip-allocations` of the Ingress Controller.
Epic: https://issues.redhat.com/browse/NE-1274
Story: https://issues.redhat.com/browse/NE-1516
  • Loading branch information
miheer committed Mar 23, 2024
1 parent 6e22bae commit ed72b77
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 7 deletions.
14 changes: 14 additions & 0 deletions config/v1/types_ingress.go
Expand Up @@ -151,8 +151,22 @@ type AWSIngressSpec struct {
// +kubebuilder:validation:Enum:=NLB;Classic
// +kubebuilder:validation:Required
Type AWSLBType `json:"type,omitempty"`

// networkLoadBalancerParameters holds configuration parameters for an AWS
// network load balancer. Present only if type is NLB.
//
// +optional
NetworkLoadBalancerParameters *AWSNetworkLoadBalancerParameters `json:"networkLoadBalancer,omitempty"`
}

// AWSNetworkLoadBalancerParameters holds configuration parameters for an
// AWS Network load balancer.
type AWSNetworkLoadBalancerParameters struct {
EIPAllocations EIPAllocations `json:"eip-allocations,omitempty"`
}

type EIPAllocations string

type AWSLBType string

const (
Expand Down
Expand Up @@ -134,6 +134,14 @@ spec:
description: aws contains settings specific to the Amazon
Web Services infrastructure provider.
properties:
networkLoadBalancer:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type allows user to set a load balancer
type. When this field is set the default ingresscontroller
Expand Down
23 changes: 22 additions & 1 deletion config/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -134,6 +134,14 @@ spec:
description: aws contains settings specific to the Amazon
Web Services infrastructure provider.
properties:
networkLoadBalancer:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type allows user to set a load balancer
type. When this field is set the default ingresscontroller
Expand Down
13 changes: 11 additions & 2 deletions config/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 40 additions & 2 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 22 additions & 2 deletions openapi/openapi.json
Expand Up @@ -4137,6 +4137,10 @@
"description": "AWSIngressSpec holds the desired state of the Ingress for Amazon Web Services infrastructure provider. This only includes fields that can be modified in the cluster.",
"type": "object",
"properties": {
"networkLoadBalancer": {
"description": "networkLoadBalancerParameters holds configuration parameters for an AWS network load balancer. Present only if type is NLB.",
"$ref": "#/definitions/com.github.openshift.api.config.v1.AWSNetworkLoadBalancerParameters"
},
"type": {
"description": "type allows user to set a load balancer type. When this field is set the default ingresscontroller will get created using the specified LBType. If this field is not set then the default ingress controller of LBType Classic will be created. Valid values are:\n\n* \"Classic\": A Classic Load Balancer that makes routing decisions at either\n the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). See\n the following for additional details:\n\n https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb\n\n* \"NLB\": A Network Load Balancer that makes routing decisions at the\n transport layer (TCP/SSL). See the following for additional details:\n\n https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb",
"type": "string"
Expand All @@ -4145,10 +4149,21 @@
"x-kubernetes-unions": [
{
"discriminator": "type",
"fields-to-discriminateBy": {}
"fields-to-discriminateBy": {
"networkLoadBalancer": "NetworkLoadBalancerParameters"
}
}
]
},
"com.github.openshift.api.config.v1.AWSNetworkLoadBalancerParameters": {
"description": "AWSNetworkLoadBalancerParameters holds configuration parameters for an AWS Network load balancer.",
"type": "object",
"properties": {
"eip-allocations": {
"type": "string"
}
}
},
"com.github.openshift.api.config.v1.AWSPlatformSpec": {
"description": "AWSPlatformSpec holds the desired state of the Amazon Web Services infrastructure provider. This only includes fields that can be modified in the cluster.",
"type": "object",
Expand Down Expand Up @@ -25107,7 +25122,12 @@
},
"com.github.openshift.api.operator.v1.AWSNetworkLoadBalancerParameters": {
"description": "AWSNetworkLoadBalancerParameters holds configuration parameters for an AWS Network load balancer.",
"type": "object"
"type": "object",
"properties": {
"eip-allocations": {
"type": "string"
}
}
},
"com.github.openshift.api.operator.v1.AccessLogging": {
"description": "AccessLogging describes how client requests should be logged.",
Expand Down
3 changes: 3 additions & 0 deletions operator/v1/types_ingress.go
Expand Up @@ -635,8 +635,11 @@ type AWSClassicLoadBalancerParameters struct {
// AWSNetworkLoadBalancerParameters holds configuration parameters for an
// AWS Network load balancer.
type AWSNetworkLoadBalancerParameters struct {
EIPAllocations EIPAllocations `json:"eip-allocations,omitempty"`
}

type EIPAllocations string

// HostNetworkStrategy holds parameters for the HostNetwork endpoint publishing
// strategy.
type HostNetworkStrategy struct {
Expand Down
Expand Up @@ -285,6 +285,9 @@ spec:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type is the type of AWS load balancer
Expand Down Expand Up @@ -1910,6 +1913,9 @@ spec:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type is the type of AWS load balancer
Expand Down
Expand Up @@ -285,6 +285,9 @@ spec:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type is the type of AWS load balancer
Expand Down Expand Up @@ -1892,6 +1895,9 @@ spec:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type is the type of AWS load balancer
Expand Down
Expand Up @@ -134,6 +134,14 @@ spec:
description: aws contains settings specific to the Amazon
Web Services infrastructure provider.
properties:
networkLoadBalancer:
description: networkLoadBalancerParameters holds configuration
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eip-allocations:
type: string
type: object
type:
description: "type allows user to set a load balancer
type. When this field is set the default ingresscontroller
Expand Down

0 comments on commit ed72b77

Please sign in to comment.