Skip to content

Commit 20e17b8

Browse files
Fix the label in CRD for versions and add more parameters to NLB spec
1 parent 342a110 commit 20e17b8

11 files changed

+204
-2
lines changed

api/v1beta1/types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,18 @@ type BackendSetDetails struct {
982982
// If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy.
983983
// +optional
984984
IsInstantFailoverEnabled *bool `json:"isInstantFailoverEnabled,omitempty"`
985+
// If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy.
986+
// +optional
987+
HealthChecker HealthChecker `json:"healthChecker,omitempty"`
988+
}
989+
990+
// HealthChecker The health check policy configuration.
991+
// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/HealthCheckPolicies/health-check-policy-management.htm).
992+
type HealthChecker struct {
993+
994+
// The path against which to run the health check.
995+
// Example: `/healthcheck`
996+
UrlPath *string `json:"urlPath,omitempty"`
985997
}
986998

987999
// NetworkSpec specifies what the OCI networking resources should look like.

api/v1beta1/zz_generated.conversion.go

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta2/types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,19 @@ type BackendSetDetails struct {
990990
// If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy.
991991
// +optional
992992
IsInstantFailoverEnabled *bool `json:"isInstantFailoverEnabled,omitempty"`
993+
994+
// If enabled existing connections will be forwarded to an alternative healthy backend as soon as current backend becomes unhealthy.
995+
// +optional
996+
HealthChecker HealthChecker `json:"healthChecker,omitempty"`
997+
}
998+
999+
// HealthChecker The health check policy configuration.
1000+
// For more information, see Editing Health Check Policies (https://docs.cloud.oracle.com/Content/NetworkLoadBalancer/HealthCheckPolicies/health-check-policy-management.htm).
1001+
type HealthChecker struct {
1002+
1003+
// The path against which to run the health check.
1004+
// Example: `/healthcheck`
1005+
UrlPath *string `mandatory:"false" json:"urlPath"`
9931006
}
9941007

9951008
// NetworkSpec specifies what the OCI networking resources should look like.

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/scope/network_load_balancer_reconciler.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ func (s *ClusterScope) CreateNLB(ctx context.Context, lb infrastructurev1beta2.L
155155
}
156156

157157
backendSetDetails := make(map[string]networkloadbalancer.BackendSetDetails)
158+
healthCheckUrl := lb.NLBSpec.BackendSetDetails.HealthChecker.UrlPath
159+
if healthCheckUrl == nil {
160+
healthCheckUrl = common.String("/healthz")
161+
}
158162
backendSetDetails[APIServerLBBackendSetName] = networkloadbalancer.BackendSetDetails{
159163
Policy: LoadBalancerPolicy,
160164
IsPreserveSource: isPreserverSourceIp,
@@ -163,7 +167,7 @@ func (s *ClusterScope) CreateNLB(ctx context.Context, lb infrastructurev1beta2.L
163167
HealthChecker: &networkloadbalancer.HealthChecker{
164168
Port: common.Int(int(s.APIServerPort())),
165169
Protocol: networkloadbalancer.HealthCheckProtocolsHttps,
166-
UrlPath: common.String("/healthz"),
170+
UrlPath: healthCheckUrl,
167171
ReturnCode: common.Int(200),
168172
},
169173
Backends: []networkloadbalancer.Backend{},

cloud/scope/network_load_balancer_reconciler_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ func TestNLBReconciliation(t *testing.T) {
369369
IsInstantFailoverEnabled: common.Bool(true),
370370
IsFailOpen: common.Bool(false),
371371
IsPreserveSource: common.Bool(false),
372+
HealthChecker: infrastructurev1beta2.HealthChecker{
373+
UrlPath: common.String("readyz"),
374+
},
372375
},
373376
},
374377
}
@@ -403,7 +406,7 @@ func TestNLBReconciliation(t *testing.T) {
403406
HealthChecker: &networkloadbalancer.HealthChecker{
404407
Port: common.Int(6443),
405408
Protocol: networkloadbalancer.HealthCheckProtocolsHttps,
406-
UrlPath: common.String("/healthz"),
409+
UrlPath: common.String("readyz"),
407410
ReturnCode: common.Int(200),
408411
},
409412
Backends: []networkloadbalancer.Backend{},

config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ spec:
124124
description: BackendSetDetails specifies the configuration
125125
of a network load balancer backend set.
126126
properties:
127+
healthChecker:
128+
description: If enabled existing connections will
129+
be forwarded to an alternative healthy backend as
130+
soon as current backend becomes unhealthy.
131+
properties:
132+
urlPath:
133+
description: 'The path against which to run the
134+
health check. Example: `/healthcheck`'
135+
type: string
136+
type: object
127137
isFailOpen:
128138
description: If enabled, the network load balancer
129139
will continue to distribute traffic in the configured
@@ -1324,6 +1334,18 @@ spec:
13241334
description: BackendSetDetails specifies the configuration
13251335
of a network load balancer backend set.
13261336
properties:
1337+
healthChecker:
1338+
description: If enabled existing connections will
1339+
be forwarded to an alternative healthy backend as
1340+
soon as current backend becomes unhealthy.
1341+
properties:
1342+
urlPath:
1343+
description: 'The path against which to run the
1344+
health check. Example: `/healthcheck`'
1345+
type: string
1346+
required:
1347+
- urlPath
1348+
type: object
13271349
isFailOpen:
13281350
description: If enabled, the network load balancer
13291351
will continue to distribute traffic in the configured

config/crd/bases/infrastructure.cluster.x-k8s.io_ociclustertemplates.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,17 @@ spec:
136136
description: BackendSetDetails specifies the configuration
137137
of a network load balancer backend set.
138138
properties:
139+
healthChecker:
140+
description: If enabled existing connections
141+
will be forwarded to an alternative healthy
142+
backend as soon as current backend becomes
143+
unhealthy.
144+
properties:
145+
urlPath:
146+
description: 'The path against which to
147+
run the health check. Example: `/healthcheck`'
148+
type: string
149+
type: object
139150
isFailOpen:
140151
description: If enabled, the network load
141152
balancer will continue to distribute traffic
@@ -1386,6 +1397,19 @@ spec:
13861397
description: BackendSetDetails specifies the configuration
13871398
of a network load balancer backend set.
13881399
properties:
1400+
healthChecker:
1401+
description: If enabled existing connections
1402+
will be forwarded to an alternative healthy
1403+
backend as soon as current backend becomes
1404+
unhealthy.
1405+
properties:
1406+
urlPath:
1407+
description: 'The path against which to
1408+
run the health check. Example: `/healthcheck`'
1409+
type: string
1410+
required:
1411+
- urlPath
1412+
type: object
13891413
isFailOpen:
13901414
description: If enabled, the network load
13911415
balancer will continue to distribute traffic

config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclusters.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ spec:
127127
description: BackendSetDetails specifies the configuration
128128
of a network load balancer backend set.
129129
properties:
130+
healthChecker:
131+
description: If enabled existing connections will
132+
be forwarded to an alternative healthy backend as
133+
soon as current backend becomes unhealthy.
134+
properties:
135+
urlPath:
136+
description: 'The path against which to run the
137+
health check. Example: `/healthcheck`'
138+
type: string
139+
type: object
130140
isFailOpen:
131141
description: If enabled, the network load balancer
132142
will continue to distribute traffic in the configured
@@ -1330,6 +1340,18 @@ spec:
13301340
description: BackendSetDetails specifies the configuration
13311341
of a network load balancer backend set.
13321342
properties:
1343+
healthChecker:
1344+
description: If enabled existing connections will
1345+
be forwarded to an alternative healthy backend as
1346+
soon as current backend becomes unhealthy.
1347+
properties:
1348+
urlPath:
1349+
description: 'The path against which to run the
1350+
health check. Example: `/healthcheck`'
1351+
type: string
1352+
required:
1353+
- urlPath
1354+
type: object
13331355
isFailOpen:
13341356
description: If enabled, the network load balancer
13351357
will continue to distribute traffic in the configured

config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ spec:
141141
description: BackendSetDetails specifies the configuration
142142
of a network load balancer backend set.
143143
properties:
144+
healthChecker:
145+
description: If enabled existing connections
146+
will be forwarded to an alternative healthy
147+
backend as soon as current backend becomes
148+
unhealthy.
149+
properties:
150+
urlPath:
151+
description: 'The path against which to
152+
run the health check. Example: `/healthcheck`'
153+
type: string
154+
type: object
144155
isFailOpen:
145156
description: If enabled, the network load
146157
balancer will continue to distribute traffic
@@ -1396,6 +1407,19 @@ spec:
13961407
description: BackendSetDetails specifies the configuration
13971408
of a network load balancer backend set.
13981409
properties:
1410+
healthChecker:
1411+
description: If enabled existing connections
1412+
will be forwarded to an alternative healthy
1413+
backend as soon as current backend becomes
1414+
unhealthy.
1415+
properties:
1416+
urlPath:
1417+
description: 'The path against which to
1418+
run the health check. Example: `/healthcheck`'
1419+
type: string
1420+
required:
1421+
- urlPath
1422+
type: object
13991423
isFailOpen:
14001424
description: If enabled, the network load
14011425
balancer will continue to distribute traffic

0 commit comments

Comments
 (0)