Skip to content

Commit f67e778

Browse files
[4211][helm] add korifiGatewayNamespace to allow gateway ns override (#4214)
* [4211][helm] add korifiGatewayNamespace to allow gateway ns override * [4211][helm] add korifiGatewayNamespace to allow gateway ns override * Add configurable gatewayNamespace with validation - Add gatewayNamespace as a networking Helm value (default: korifi-gateway) - Update values.schema.json with proper validation for the new field - Modify gateway.yaml to use configurable namespace instead of release-name based - Update api/ingress.yaml to reference gateway in the correct namespace - Add pre-install/pre-upgrade hook to validate namespace exists before installation - Include TTL on validation job for automatic cleanup - Update Helm documentation to reflect the new configuration option This change allows users to specify a custom namespace for the Korifi Gateway instead of being hardcoded to {release-namespace}-gateway, while ensuring backwards compatibility and proper validation. * upd korifi-api ns * remove unneeded validation cronjob --------- Co-authored-by: Danail Branekov <[email protected]>
1 parent 470b866 commit f67e778

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

README.helm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Here are all the values that can be set for the chart:
116116
- `networking`: Networking configuration
117117
- `gatewayClass` (_String_): The name of the GatewayClass Korifi Gateway references
118118
- `gatewayInfrastructure`: Optional GatewayInfrastructure property of the Gateway, see https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.GatewayInfrastructure for contents
119+
- `gatewayNamespace` (_String_): The namespace where the Korifi Gateway will be created. If the namespace does not exist, the helm chart will fail.
119120
- `gatewayPorts`: Ports for the Gateway listeners
120121
- `http` (_Integer_): HTTP port
121122
- `https` (_Integer_): HTTPS port

helm/korifi/api/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
- group: gateway.networking.k8s.io
99
kind: Gateway
1010
name: korifi
11-
namespace: {{ .Release.Namespace }}-gateway
11+
namespace: {{ .Values.networking.gatewayNamespace }}
1212
hostnames:
1313
- {{ .Values.api.apiServer.url }}
1414
rules:

helm/korifi/templates/gateway.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
apiVersion: v1
2-
kind: Namespace
3-
metadata:
4-
name: {{ .Release.Namespace }}-gateway
5-
---
61
apiVersion: gateway.networking.k8s.io/v1beta1
72
kind: ReferenceGrant
83
metadata:
@@ -12,7 +7,7 @@ spec:
127
from:
138
- group: gateway.networking.k8s.io
149
kind: Gateway
15-
namespace: {{ .Release.Namespace }}-gateway
10+
namespace: {{ .Values.networking.gatewayNamespace }}
1611
to:
1712
- group: ""
1813
kind: Secret
@@ -22,7 +17,7 @@ kind: Gateway
2217
apiVersion: gateway.networking.k8s.io/v1beta1
2318
metadata:
2419
name: korifi
25-
namespace: {{ .Release.Namespace }}-gateway
20+
namespace: {{ .Values.networking.gatewayNamespace }}
2621
spec:
2722
gatewayClassName: {{ .Values.networking.gatewayClass }}
2823
{{- if .Values.networking.gatewayInfrastructure }}

helm/korifi/values.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@
472472
"type": "object",
473473
"description": "Networking configuration",
474474
"properties": {
475+
"gatewayNamespace": {
476+
"description": "The namespace where the Korifi Gateway will be created. If the namespace does not exist, the helm chart will fail.",
477+
"type": "string",
478+
"default": "korifi-gateway"
479+
},
475480
"gatewayClass": {
476481
"description": "The name of the GatewayClass Korifi Gateway references",
477482
"type": "string"

helm/korifi/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ helm:
115115
hooksImage: alpine/k8s:1.25.2
116116

117117
networking:
118+
gatewayNamespace: korifi-gateway
118119
gatewayPorts:
119120
http: 80
120121
https: 443

0 commit comments

Comments
 (0)