From 061f5cd143e3f7542c5a26e4c30429314964d640 Mon Sep 17 00:00:00 2001 From: Philipp Born Date: Mon, 30 Oct 2023 09:10:33 +0100 Subject: [PATCH] chart: allow setting allocateLoadBalancerNodePorts Signed-off-by: Philipp Born --- .../templates/controller-service-internal.yaml | 3 +++ charts/ingress-nginx/templates/controller-service.yaml | 3 +++ charts/ingress-nginx/values.yaml | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/charts/ingress-nginx/templates/controller-service-internal.yaml b/charts/ingress-nginx/templates/controller-service-internal.yaml index 3966b32603..46c75fa520 100644 --- a/charts/ingress-nginx/templates/controller-service-internal.yaml +++ b/charts/ingress-nginx/templates/controller-service-internal.yaml @@ -16,6 +16,9 @@ metadata: namespace: {{ .Release.Namespace }} spec: type: "{{ .Values.controller.service.type }}" +{{- if hasKey .Values.controller.service.internal "allocateLoadBalancerNodePorts" }} + allocateLoadBalancerNodePorts: {{ .Values.controller.service.internal.allocateLoadBalancerNodePorts }} +{{- end }} {{- if .Values.controller.service.internal.loadBalancerIP }} loadBalancerIP: {{ .Values.controller.service.internal.loadBalancerIP }} {{- end }} diff --git a/charts/ingress-nginx/templates/controller-service.yaml b/charts/ingress-nginx/templates/controller-service.yaml index f079fd4d82..58d86b6d2d 100644 --- a/charts/ingress-nginx/templates/controller-service.yaml +++ b/charts/ingress-nginx/templates/controller-service.yaml @@ -16,6 +16,9 @@ metadata: namespace: {{ .Release.Namespace }} spec: type: {{ .Values.controller.service.type }} +{{- if hasKey .Values.controller.service "allocateLoadBalancerNodePorts" }} + allocateLoadBalancerNodePorts: {{ .Values.controller.service.allocateLoadBalancerNodePorts }} +{{- end }} {{- if .Values.controller.service.clusterIP }} clusterIP: {{ .Values.controller.service.clusterIP }} {{- end }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 227043b9cc..23755fd334 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -449,6 +449,9 @@ controller: ## Ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips ## externalIPs: [] + # -- Set to false to disable loadbalancer node port allocation + # See https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation + # allocateLoadBalancerNodePorts: true # -- Used by cloud providers to connect the resulting `LoadBalancer` to a pre-existing static IP according to https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer loadBalancerIP: "" loadBalancerSourceRanges: [] @@ -504,6 +507,9 @@ controller: enabled: false # -- Annotations are mandatory for the load balancer to come up. Varies with the cloud service. Values passed through helm tpl engine. annotations: {} + # -- Set to false to disable loadbalancer node port allocation + # See https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-nodeport-allocation + # allocateLoadBalancerNodePorts: true # -- Used by cloud providers to connect the resulting internal LoadBalancer to a pre-existing static IP. Make sure to add to the service the needed annotation to specify the subnet which the static IP belongs to. For instance, `networking.gke.io/internal-load-balancer-subnet` for GCP and `service.beta.kubernetes.io/aws-load-balancer-subnets` for AWS. loadBalancerIP: "" # -- Restrict access For LoadBalancer service. Defaults to 0.0.0.0/0.