Skip to content

Commit d8f5442

Browse files
authored
[helm] Support custom port configuration for internal service (#9846)
Signed-off-by: Jan-Otto Kröpke <[email protected]>
1 parent ae989d7 commit d8f5442

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

charts/ingress-nginx/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ As of version `1.26.0` of this chart, by simply not providing any clusterIP valu
406406
| controller.service.internal.annotations | object | `{}` | Annotations are mandatory for the load balancer to come up. Varies with the cloud service. |
407407
| controller.service.internal.enabled | bool | `false` | Enables an additional internal load balancer (besides the external one). |
408408
| controller.service.internal.loadBalancerSourceRanges | list | `[]` | Restrict access For LoadBalancer service. Defaults to 0.0.0.0/0. |
409+
| controller.service.internal.ports | object | `{}` | Custom port mapping for internal service |
410+
| controller.service.internal.targetPorts | object | `{}` | Custom target port mapping for internal service |
409411
| controller.service.ipFamilies | list | `["IPv4"]` | List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically based on cluster configuration and the ipFamilyPolicy field. # Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ |
410412
| controller.service.ipFamilyPolicy | string | `"SingleStack"` | Represents the dual-stack-ness requested or required by this Service. Possible values are SingleStack, PreferDualStack or RequireDualStack. The ipFamilies and clusterIPs fields depend on the value of this field. # Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ |
411413
| controller.service.labels | object | `{}` | |

charts/ingress-nginx/ci/deployment-internal-lb-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ controller:
1111
enabled: true
1212
annotations:
1313
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
14+
ports:
15+
http: 443
16+
https: 80
17+
targetPorts:
18+
http: 443
19+
https: 80

charts/ingress-nginx/templates/controller-service-internal.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ spec:
2929
{{- $setNodePorts := (or (eq .Values.controller.service.type "NodePort") (eq .Values.controller.service.type "LoadBalancer")) }}
3030
{{- if .Values.controller.service.enableHttp }}
3131
- name: http
32-
port: {{ .Values.controller.service.ports.http }}
32+
port: {{ .Values.controller.service.internal.ports.http | default .Values.controller.service.ports.http }}
3333
protocol: TCP
34-
targetPort: {{ .Values.controller.service.targetPorts.http }}
34+
targetPort: {{ .Values.controller.service.internal.targetPorts.http | default .Values.controller.service.targetPorts.http }}
3535
{{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
3636
appProtocol: http
3737
{{- end }}
@@ -41,9 +41,9 @@ spec:
4141
{{- end }}
4242
{{- if .Values.controller.service.enableHttps }}
4343
- name: https
44-
port: {{ .Values.controller.service.ports.https }}
44+
port: {{ .Values.controller.service.internal.ports.https | default .Values.controller.service.ports.https }}
4545
protocol: TCP
46-
targetPort: {{ .Values.controller.service.targetPorts.https }}
46+
targetPort: {{ .Values.controller.service.internal.targetPorts.https | default .Values.controller.service.targetPorts.https }}
4747
{{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
4848
appProtocol: https
4949
{{- end }}

charts/ingress-nginx/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,17 @@ controller:
482482
## providers supporting it
483483
## Ref: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-typeloadbalancer
484484
# externalTrafficPolicy: ""
485+
486+
# -- Custom port mapping for internal service
487+
ports: {}
488+
# http: 80
489+
# https: 443
490+
491+
# -- Custom target port mapping for internal service
492+
targetPorts: {}
493+
# http: http
494+
# https: https
495+
485496
# shareProcessNamespace enables process namespace sharing within the pod.
486497
# This can be used for example to signal log rotation using `kill -USR1` from a sidecar.
487498
shareProcessNamespace: false

0 commit comments

Comments
 (0)