Skip to content

Commit

Permalink
Add loadbalancerIP as a helm parameter (#2766)
Browse files Browse the repository at this point in the history
Add loadbalancerIP as helm parameter

Problem: Users want to specify load balancer IP when doing a helm install or upgrade.

Solution: Add a parameter loadBalancerIP under service in values.yaml.
  • Loading branch information
salonichf5 authored Nov 12, 2024
1 parent 77be35b commit a48a1ea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/nginx-gateway-fabric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down
3 changes: 3 additions & 0 deletions charts/nginx-gateway-fabric/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions charts/nginx-gateway-fabric/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 3 additions & 0 deletions charts/nginx-gateway-fabric/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a48a1ea

Please sign in to comment.