Skip to content

Commit a01ed6c

Browse files
Merge pull request #1109 from miheer/eip-refactor
NE-1674: Add LB EIP Allocation for AWS
2 parents a9b7292 + 8b768d2 commit a01ed6c

File tree

92 files changed

+145816
-2817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+145816
-2817
lines changed

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/google/go-cmp v0.6.0
2222
github.com/google/gopacket v1.1.19
2323
github.com/jongio/azidext/go/azidext v0.4.0
24-
github.com/maistra/istio-operator v0.0.0-20230322122339-793794762e67
24+
github.com/maistra/istio-operator v0.0.0-20240712143246-fd7dfc8af831
2525
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
2626
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8
2727
github.com/openshift/library-go v0.0.0-20240419113445-f1541d628746
@@ -80,6 +80,7 @@ require (
8080
github.com/go-playground/locales v0.13.0 // indirect
8181
github.com/go-playground/universal-translator v0.17.0 // indirect
8282
github.com/go-stack/stack v1.8.0 // indirect
83+
github.com/goccy/go-yaml v1.8.8 // indirect
8384
github.com/gogo/protobuf v1.3.2 // indirect
8485
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
8586
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -133,6 +134,7 @@ require (
133134
golang.org/x/sys v0.18.0 // indirect
134135
golang.org/x/term v0.18.0 // indirect
135136
golang.org/x/text v0.14.0 // indirect
137+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
136138
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
137139
google.golang.org/appengine v1.6.7 // indirect
138140
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
@@ -155,6 +157,6 @@ require (
155157
// github.com/operator-framework/operator-sdk.
156158
replace (
157159
bitbucket.org/ww/goautoneg => github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d
158-
github.com/openshift/api => github.com/openshift/api v0.0.0-20240715101244-b0adfa1f6357
160+
github.com/openshift/api => github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42
159161
k8s.io/client-go => k8s.io/client-go v0.29.0
160162
)

go.sum

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on
803803
github.com/containerd/containerd v1.2.7/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
804804
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
805805
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
806+
github.com/containerd/containerd v1.4.8/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
806807
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
807808
github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
808809
github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY=
@@ -1066,6 +1067,7 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c
10661067
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
10671068
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
10681069
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
1070+
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
10691071
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
10701072
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
10711073
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
@@ -1109,6 +1111,7 @@ github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kE
11091111
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
11101112
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
11111113
github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
1114+
github.com/goccy/go-yaml v1.8.8 h1:MGfRB1GeSn/hWXYWS2Pt67iC2GJNnebdIro01ddyucA=
11121115
github.com/goccy/go-yaml v1.8.8/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA=
11131116
github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0=
11141117
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
@@ -1486,8 +1489,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN
14861489
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
14871490
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
14881491
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
1489-
github.com/maistra/istio-operator v0.0.0-20230322122339-793794762e67 h1:MKacYZbpog8jM+uN3/TQS/FUO+Emz/qdAhma63x1pCk=
1490-
github.com/maistra/istio-operator v0.0.0-20230322122339-793794762e67/go.mod h1:OTwsAjzSt6870+UXseGMkEPwiyif2xr8A6xyTUrGXVg=
1492+
github.com/maistra/istio-operator v0.0.0-20240712143246-fd7dfc8af831 h1:BBZSqzUOFeNJ6v14I6ppSJEWOZ7DTNq66g9mp5DYons=
1493+
github.com/maistra/istio-operator v0.0.0-20240712143246-fd7dfc8af831/go.mod h1:Kb3f1dhD5zwRFR4AFpSItjy/djRNQsV69NrMeeDL85A=
14911494
github.com/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs=
14921495
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
14931496
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
@@ -1659,8 +1662,8 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m
16591662
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
16601663
github.com/opencontainers/runtime-spec v1.0.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
16611664
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
1662-
github.com/openshift/api v0.0.0-20240715101244-b0adfa1f6357 h1:yp8QH1cSR7zynJlJMdluuD/QEGxY980uV1cooF2snio=
1663-
github.com/openshift/api v0.0.0-20240715101244-b0adfa1f6357/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
1665+
github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42 h1:6dvhH92q5/tuU1T4U1s3P3yuVO9ADiXa1hwBHLIYVYE=
1666+
github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
16641667
github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc=
16651668
github.com/openshift/client-go v0.0.0-20200116152001-92a2713fa240/go.mod h1:4riOwdj99Hd/q+iAcJZfNCsQQQMwURnZV6RL4WHYS5w=
16661669
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8 h1:HGfbllzRcrJBSiwzNjBCs7sExLUxC5/1evnvlNGB0Cg=
@@ -2548,6 +2551,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T
25482551
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
25492552
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
25502553
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
2554+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
25512555
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
25522556
gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU=
25532557
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=

manifests/00-custom-resource-definition-CustomNoUpgrade.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,44 @@ spec:
368368
parameters for an AWS network load balancer. Present
369369
only if type is NLB.
370370
properties:
371+
eipAllocations:
372+
description: "eipAllocations is a list of IDs
373+
for Elastic IP (EIP) addresses that are assigned
374+
to the Network Load Balancer. The following
375+
restrictions apply: \n eipAllocations can only
376+
be used with external scope, not internal. An
377+
EIP can be allocated to only a single IngressController.
378+
The number of EIP allocations must match the
379+
number of subnets that are used for the load
380+
balancer. Each EIP allocation must be unique.
381+
A maximum of 10 EIP allocations are permitted.
382+
\n See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
383+
for general information about configuration,
384+
characteristics, and limitations of Elastic
385+
IP addresses."
386+
items:
387+
description: EIPAllocation is an ID for an Elastic
388+
IP (EIP) address that can be allocated to
389+
an ELB in the AWS environment. Values must
390+
begin with `eipalloc-` followed by exactly
391+
17 hexadecimal (`[0-9a-fA-F]`) characters.
392+
maxLength: 26
393+
minLength: 26
394+
type: string
395+
x-kubernetes-validations:
396+
- message: eipAllocations should start with
397+
'eipalloc-'
398+
rule: self.startsWith('eipalloc-')
399+
- message: eipAllocations must be 'eipalloc-'
400+
followed by exactly 17 hexadecimal characters
401+
(0-9, a-f, A-F)
402+
rule: self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')
403+
maxItems: 10
404+
type: array
405+
x-kubernetes-list-type: atomic
406+
x-kubernetes-validations:
407+
- message: eipAllocations cannot contain duplicates
408+
rule: self.all(x, self.exists_one(y, x == y))
371409
subnets:
372410
description: "subnets specifies the subnets to
373411
which the load balancer will attach. The subnets
@@ -444,6 +482,25 @@ spec:
444482
rule: has(self.ids) && self.ids.size() > 0 ||
445483
has(self.names) && self.names.size() > 0
446484
type: object
485+
x-kubernetes-validations:
486+
- message: number of subnets must be equal to number
487+
of eipAllocations
488+
rule: 'has(self.subnets) && has(self.subnets.ids)
489+
&& has(self.subnets.names) && has(self.eipAllocations)
490+
? size(self.subnets.ids + self.subnets.names)
491+
== size(self.eipAllocations) : true'
492+
- message: number of subnets must be equal to number
493+
of eipAllocations
494+
rule: 'has(self.subnets) && has(self.subnets.ids)
495+
&& !has(self.subnets.names) && has(self.eipAllocations)
496+
? size(self.subnets.ids) == size(self.eipAllocations)
497+
: true'
498+
- message: number of subnets must be equal to number
499+
of eipAllocations
500+
rule: 'has(self.subnets) && has(self.subnets.names)
501+
&& !has(self.subnets.ids) && has(self.eipAllocations)
502+
? size(self.subnets.names) == size(self.eipAllocations)
503+
: true'
447504
type:
448505
description: "type is the type of AWS load balancer
449506
to instantiate for an ingresscontroller. \n Valid
@@ -547,6 +604,11 @@ spec:
547604
- dnsManagementPolicy
548605
- scope
549606
type: object
607+
x-kubernetes-validations:
608+
- message: eipAllocations are forbidden when the scope is Internal.
609+
rule: '!has(self.scope) || self.scope != ''Internal'' || !has(self.providerParameters)
610+
|| !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer)
611+
|| !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)'
550612
nodePort:
551613
description: nodePort holds parameters for the NodePortService
552614
endpoint publishing strategy. Present only if type is NodePortService.
@@ -2172,6 +2234,44 @@ spec:
21722234
parameters for an AWS network load balancer. Present
21732235
only if type is NLB.
21742236
properties:
2237+
eipAllocations:
2238+
description: "eipAllocations is a list of IDs
2239+
for Elastic IP (EIP) addresses that are assigned
2240+
to the Network Load Balancer. The following
2241+
restrictions apply: \n eipAllocations can only
2242+
be used with external scope, not internal. An
2243+
EIP can be allocated to only a single IngressController.
2244+
The number of EIP allocations must match the
2245+
number of subnets that are used for the load
2246+
balancer. Each EIP allocation must be unique.
2247+
A maximum of 10 EIP allocations are permitted.
2248+
\n See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
2249+
for general information about configuration,
2250+
characteristics, and limitations of Elastic
2251+
IP addresses."
2252+
items:
2253+
description: EIPAllocation is an ID for an Elastic
2254+
IP (EIP) address that can be allocated to
2255+
an ELB in the AWS environment. Values must
2256+
begin with `eipalloc-` followed by exactly
2257+
17 hexadecimal (`[0-9a-fA-F]`) characters.
2258+
maxLength: 26
2259+
minLength: 26
2260+
type: string
2261+
x-kubernetes-validations:
2262+
- message: eipAllocations should start with
2263+
'eipalloc-'
2264+
rule: self.startsWith('eipalloc-')
2265+
- message: eipAllocations must be 'eipalloc-'
2266+
followed by exactly 17 hexadecimal characters
2267+
(0-9, a-f, A-F)
2268+
rule: self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')
2269+
maxItems: 10
2270+
type: array
2271+
x-kubernetes-list-type: atomic
2272+
x-kubernetes-validations:
2273+
- message: eipAllocations cannot contain duplicates
2274+
rule: self.all(x, self.exists_one(y, x == y))
21752275
subnets:
21762276
description: "subnets specifies the subnets to
21772277
which the load balancer will attach. The subnets
@@ -2248,6 +2348,25 @@ spec:
22482348
rule: has(self.ids) && self.ids.size() > 0 ||
22492349
has(self.names) && self.names.size() > 0
22502350
type: object
2351+
x-kubernetes-validations:
2352+
- message: number of subnets must be equal to number
2353+
of eipAllocations
2354+
rule: 'has(self.subnets) && has(self.subnets.ids)
2355+
&& has(self.subnets.names) && has(self.eipAllocations)
2356+
? size(self.subnets.ids + self.subnets.names)
2357+
== size(self.eipAllocations) : true'
2358+
- message: number of subnets must be equal to number
2359+
of eipAllocations
2360+
rule: 'has(self.subnets) && has(self.subnets.ids)
2361+
&& !has(self.subnets.names) && has(self.eipAllocations)
2362+
? size(self.subnets.ids) == size(self.eipAllocations)
2363+
: true'
2364+
- message: number of subnets must be equal to number
2365+
of eipAllocations
2366+
rule: 'has(self.subnets) && has(self.subnets.names)
2367+
&& !has(self.subnets.ids) && has(self.eipAllocations)
2368+
? size(self.subnets.names) == size(self.eipAllocations)
2369+
: true'
22512370
type:
22522371
description: "type is the type of AWS load balancer
22532372
to instantiate for an ingresscontroller. \n Valid
@@ -2351,6 +2470,11 @@ spec:
23512470
- dnsManagementPolicy
23522471
- scope
23532472
type: object
2473+
x-kubernetes-validations:
2474+
- message: eipAllocations are forbidden when the scope is Internal.
2475+
rule: '!has(self.scope) || self.scope != ''Internal'' || !has(self.providerParameters)
2476+
|| !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer)
2477+
|| !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)'
23542478
nodePort:
23552479
description: nodePort holds parameters for the NodePortService
23562480
endpoint publishing strategy. Present only if type is NodePortService.

0 commit comments

Comments
 (0)