From ea5a31b35b90536ba578821f82f7eb6bdb1a7501 Mon Sep 17 00:00:00 2001 From: Saloni Date: Fri, 8 Nov 2024 14:49:04 -0800 Subject: [PATCH] add loadbalancerIP as helm parameter --- charts/nginx-gateway-fabric/README.md | 1 + charts/nginx-gateway-fabric/templates/service.yaml | 3 +++ charts/nginx-gateway-fabric/values.schema.json | 7 +++++++ charts/nginx-gateway-fabric/values.yaml | 3 +++ 4 files changed, 14 insertions(+) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index b8c6a35b3e..0a7745dca1 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -299,6 +299,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | `service.annotations` | The annotations of the NGINX Gateway Fabric service. | object | `{}` | | `service.create` | Creates a service to expose the NGINX Gateway Fabric pods. | bool | `true` | | `service.externalTrafficPolicy` | The externalTrafficPolicy of the service. The value Local preserves the client source IP. | string | `"Local"` | +| `service.loadBalancerIP` | The static IP address for the load balancer. Requires service.type set to LoadBalancer. | string | `""` | | `service.ports` | A list of ports to expose through the NGINX Gateway Fabric service. Update it to match the listener ports from your Gateway resource. Follows the conventional Kubernetes yaml syntax for service ports. | list | `[{"name":"http","port":80,"protocol":"TCP","targetPort":80},{"name":"https","port":443,"protocol":"TCP","targetPort":443}]` | | `service.type` | The type of service to create for the NGINX Gateway Fabric. | string | `"LoadBalancer"` | | `serviceAccount.annotations` | Set of custom annotations for the NGINX Gateway Fabric service account. | object | `{}` | diff --git a/charts/nginx-gateway-fabric/templates/service.yaml b/charts/nginx-gateway-fabric/templates/service.yaml index 21b802308d..00b095383f 100644 --- a/charts/nginx-gateway-fabric/templates/service.yaml +++ b/charts/nginx-gateway-fabric/templates/service.yaml @@ -17,6 +17,9 @@ spec: {{- end }} {{- end }} type: {{ .Values.service.type }} +{{- if and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end}} selector: {{- include "nginx-gateway.selectorLabels" . | nindent 4 }} ports: # Update the following ports to match your Gateway Listener ports diff --git a/charts/nginx-gateway-fabric/values.schema.json b/charts/nginx-gateway-fabric/values.schema.json index 38cbbd34d2..2b0e99a32b 100644 --- a/charts/nginx-gateway-fabric/values.schema.json +++ b/charts/nginx-gateway-fabric/values.schema.json @@ -573,6 +573,13 @@ "required": [], "title": "externalTrafficPolicy" }, + "loadBalancerIP": { + "default": "", + "description": "The static IP address for the load balancer. Requires service.type set to LoadBalancer.", + "required": [], + "title": "loadBalancerIP", + "type": "string" + }, "ports": { "description": "A list of ports to expose through the NGINX Gateway Fabric service. Update it to match the listener ports from\nyour Gateway resource. Follows the conventional Kubernetes yaml syntax for service ports.", "items": { diff --git a/charts/nginx-gateway-fabric/values.yaml b/charts/nginx-gateway-fabric/values.yaml index 3200a4eae9..deb45ab818 100644 --- a/charts/nginx-gateway-fabric/values.yaml +++ b/charts/nginx-gateway-fabric/values.yaml @@ -303,6 +303,9 @@ service: # -- The annotations of the NGINX Gateway Fabric service. annotations: {} + # -- The static IP address for the load balancer. Requires service.type set to LoadBalancer. + loadBalancerIP: "" + # @schema # type: array # items: