Skip to content

Commit 52bf3d3

Browse files
authored
Merge pull request #93 from CAAPIM/US1062535-All-Operator-Changes-for-OTK
F159693: Layer7 Operator support for OTK Dual GW Ephemeral
2 parents 3362b2c + ed61b07 commit 52bf3d3

70 files changed

Lines changed: 2369 additions & 3645 deletions

Some content is hidden

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

.github/check_image_tags.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/pr.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
222222

223223
.PHONY: docker-build
224224
docker-build: dockerfile #test ## Build docker image with the manager.
225-
$(CONTAINER_TOOL) build -f operator.Dockerfile -t ${IMG} .
225+
$(CONTAINER_TOOL) build -t ${IMG} -f operator.Dockerfile --build-arg COPYRIGHT="${COPYRIGHT}" --build-arg AUTHOR="layer7" --build-arg TITLE="layer7-operator" --build-arg VERSION="${IMAGE_TAG}" --build-arg CREATED="${CREATED}" .
226226

227227
.PHONY: docker-push
228228
docker-push: ## Push docker image with the manager.

api/v1/gateway_types.go

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ type GatewayStatus struct {
117117
LastAppliedExternalSecrets map[string][]string `json:"lastAppliedExternalSecrets,omitempty"`
118118
// LastAppliedExternalCerts
119119
LastAppliedExternalCerts map[string][]string `json:"lastAppliedExternalCerts,omitempty"`
120+
// LastAppliedOtkFipsCerts tracks which OTK FIPS user certificates have been applied
121+
LastAppliedOtkFipsCerts map[string][]string `json:"lastAppliedOtkFipsCerts,omitempty"`
120122
}
121123

122124
// GatewayState tracks the status of Gateway Resources
@@ -342,6 +344,9 @@ type PortalReference struct {
342344
type Otk struct {
343345
// Enable or disable the OTK initContainer
344346
Enabled bool `json:"enabled,omitempty"`
347+
// ManageCrossNamespace allows a cluster-wide layer7 operator to manage internal/dmz gateways across namespaces
348+
// this is limited to a single kubernetes cluster.
349+
ManageCrossNamespace bool `json:"manageCrossNamespace,omitempty"`
345350
// InitContainerImage for the initContainer
346351
InitContainerImage string `json:"initContainerImage,omitempty"`
347352
// InitContainerImagePullPolicy
@@ -356,21 +361,27 @@ type Otk struct {
356361
Overrides OtkOverrides `json:"overrides,omitempty"`
357362
// A list of subSolutionKitNames - all,internal or dmz cover the primary use cases for the OTK. Only use if directed by support
358363
SubSolutionKitNames []string `json:"subSolutionKitNames,omitempty"`
359-
// InternalOtkGatewayReference to an Operator managed Gateway deployment that is configured with otk.type: internal
360-
// This configures a relationship between DMZ and Internal Gateways.
361-
InternalOtkGatewayReference string `json:"internalGatewayReference,omitempty"`
362-
// InternalGatewayPort defaults to 9443 or graphmanDynamicSync port
363-
InternalGatewayPort int `json:"internalGatewayPort,omitempty"`
364-
// OTKPort is used in Single mode - sets the otk.port cluster-wide property and in Dual-Mode
365-
// sets host_oauth2_auth_server port in #OTK Client Context Variables
366-
// TODO: Make this an array for many dmz deployments to one internal
367-
DmzOtkGatewayReference string `json:"dmzGatewayReference,omitempty"`
368364
// OTKPort defaults to 8443
369365
OTKPort int `json:"port,omitempty"`
370366
// MaintenanceTasks for the OTK database are disabled by default
371367
MaintenanceTasks OtkMaintenanceTasks `json:"maintenanceTasks,omitempty"`
372-
// RuntimeSyncIntervalSeconds how often OTK Gateways should be updated in internal/dmz mode
373-
RuntimeSyncIntervalSeconds int `json:"runtimeSyncIntervalSeconds,omitempty"`
368+
//InternalOTKGateway reference if type is dmz
369+
InternalOTKGateway GatewayReference `json:"internalGateway,omitempty"`
370+
//DmzOTKGateway reference if type is internal
371+
DmzOTKGateway GatewayReference `json:"dmzGateway,omitempty"`
372+
// FipsCertificates is a list of certificate references for FIPS user management
373+
// on Internal gateways. Each entry references a Secret or ConfigMap containing
374+
// leaf certificates for DMZ gateway mTLS client authentication.
375+
FipsCertificates []OtkFipsCertificate `json:"fipsCertificates,omitempty"`
376+
}
377+
378+
type OtkFipsCertificate struct {
379+
// Enabled or disabled
380+
Enabled bool `json:"enabled,omitempty"`
381+
// Name of the Secret or ConfigMap
382+
Name string `json:"name,omitempty"`
383+
// Type of the referenced resource: "secret" or "configmap"
384+
Type string `json:"type,omitempty"`
374385
}
375386

376387
// OtkMaintenanceTasks are included in the install bundle as disabled scheduled tasks
@@ -380,6 +391,19 @@ type OtkMaintenanceTasks struct {
380391
Enabled bool `json:"enabled,omitempty"`
381392
}
382393

394+
type GatewayReference struct {
395+
// Name of the gateway
396+
// if managing otk gateways across namespaces this must match the referenced gateway CR
397+
Name string `json:"name,omitempty"`
398+
// Namespace of the referenced gateway if managing gateways cross namespace (optional)
399+
Namespace string `json:"namespace,omitempty"`
400+
// Url of the target gateway
401+
// used for post-installation gateway policy configuration
402+
Url string `json:"url,omitempty"`
403+
// Port of the target gateway
404+
Port int `json:"port,omitempty"`
405+
}
406+
383407
type OtkOverrides struct {
384408
// Enable or disable otk overrides
385409
Enabled bool `json:"enabled,omitempty"`
@@ -893,6 +917,8 @@ type ExternalKey struct {
893917
// only one key usage type is allowed
894918
// SSL | CA | AUDIT_SIGNING | AUDIT_VIEWER
895919
KeyUsageType KeyUsageType `json:"keyUsageType,omitempty"`
920+
// Otk indicates that this key usage was specific for OTK
921+
//Otk bool `json:"otk,omitempty"`
896922
}
897923

898924
type KeyUsageType string

api/v1/zz_generated.deepcopy.go

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

config/crd/bases/security.brcmlabs.com_gateways.yaml

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,12 +4003,47 @@ spec:
40034003
description: Type of OTK Database
40044004
type: string
40054005
type: object
4006-
dmzGatewayReference:
4007-
description: OTKPort is used in Single mode - sets the otk.
4008-
type: string
4006+
dmzGateway:
4007+
description: DmzOTKGateway reference if type is internal
4008+
properties:
4009+
name:
4010+
description: |-
4011+
Name of the gateway
4012+
if managing otk gateways across namespaces this must...
4013+
type: string
4014+
namespace:
4015+
description: Namespace of the referenced gateway if managing
4016+
gateways cross namespace...
4017+
type: string
4018+
port:
4019+
description: Port of the target gateway
4020+
type: integer
4021+
url:
4022+
description: |-
4023+
Url of the target gateway
4024+
used for post-installation gateway policy...
4025+
type: string
4026+
type: object
40094027
enabled:
40104028
description: Enable or disable the OTK initContainer
40114029
type: boolean
4030+
fipsCertificates:
4031+
description: FipsCertificates is a list of certificate references
4032+
for FIPS user...
4033+
items:
4034+
properties:
4035+
enabled:
4036+
description: Enabled or disabled
4037+
type: boolean
4038+
name:
4039+
description: Name of the Secret or ConfigMap
4040+
type: string
4041+
type:
4042+
description: 'Type of the referenced resource: "secret"
4043+
or "configmap"'
4044+
type: string
4045+
type: object
4046+
type: array
40124047
initContainerImage:
40134048
description: InitContainerImage for the initContainer
40144049
type: string
@@ -4142,14 +4177,27 @@ spec:
41424177
type: string
41434178
type: object
41444179
type: object
4145-
internalGatewayPort:
4146-
description: InternalGatewayPort defaults to 9443 or graphmanDynamicSync
4147-
port
4148-
type: integer
4149-
internalGatewayReference:
4150-
description: InternalOtkGatewayReference to an Operator managed
4151-
Gateway deployment that...
4152-
type: string
4180+
internalGateway:
4181+
description: InternalOTKGateway reference if type is dmz
4182+
properties:
4183+
name:
4184+
description: |-
4185+
Name of the gateway
4186+
if managing otk gateways across namespaces this must...
4187+
type: string
4188+
namespace:
4189+
description: Namespace of the referenced gateway if managing
4190+
gateways cross namespace...
4191+
type: string
4192+
port:
4193+
description: Port of the target gateway
4194+
type: integer
4195+
url:
4196+
description: |-
4197+
Url of the target gateway
4198+
used for post-installation gateway policy...
4199+
type: string
4200+
type: object
41534201
maintenanceTasks:
41544202
description: MaintenanceTasks for the OTK database are disabled
41554203
by default
@@ -4158,6 +4206,10 @@ spec:
41584206
description: Enable or disable database maintenance tasks
41594207
type: boolean
41604208
type: object
4209+
manageCrossNamespace:
4210+
description: ManageCrossNamespace allows a cluster-wide layer7
4211+
operator to manage...
4212+
type: boolean
41614213
overrides:
41624214
description: Overrides default OTK install functionality
41634215
properties:
@@ -4192,10 +4244,6 @@ spec:
41924244
port:
41934245
description: OTKPort defaults to 8443
41944246
type: integer
4195-
runtimeSyncIntervalSeconds:
4196-
description: RuntimeSyncIntervalSeconds how often OTK Gateways
4197-
should be updated in...
4198-
type: integer
41994247
subSolutionKitNames:
42004248
description: A list of subSolutionKitNames - all,internal
42014249
or dmz cover the primary use...
@@ -6479,6 +6527,14 @@ spec:
64796527
items:
64806528
type: string
64816529
type: array
6530+
lastAppliedOtkFipsCerts:
6531+
additionalProperties:
6532+
items:
6533+
type: string
6534+
type: array
6535+
description: LastAppliedOtkFipsCerts tracks which OTK FIPS user certificates
6536+
have been...
6537+
type: object
64826538
managementPod:
64836539
description: Management Pod is a Gateway with a special annotation
64846540
is used as a...

0 commit comments

Comments
 (0)