From c73f69422bbe176ed97df80c0e02f7798c957007 Mon Sep 17 00:00:00 2001 From: Cedric Hnyda Date: Mon, 2 Jan 2023 15:07:07 +0100 Subject: [PATCH] [ingress] Allow setting node_port for the svc Signed-off-by: Cedric Hnyda Change-Id: I55feb2f8ed01a81331cfcfc97ca6cc76653d9fd4 --- ingress/Chart.yaml | 2 +- ingress/templates/service-ingress.yaml | 9 +++++++++ ingress/values.yaml | 4 ++++ releasenotes/notes/ingress.yaml | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ingress/Chart.yaml b/ingress/Chart.yaml index a3beeb58d..b424eddca 100644 --- a/ingress/Chart.yaml +++ b/ingress/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v0.42.0 description: OpenStack-Helm Ingress Controller name: ingress -version: 0.2.12 +version: 0.2.13 home: https://github.com/kubernetes/ingress sources: - https://github.com/kubernetes/ingress diff --git a/ingress/templates/service-ingress.yaml b/ingress/templates/service-ingress.yaml index a87255150..8fe9a69bc 100644 --- a/ingress/templates/service-ingress.yaml +++ b/ingress/templates/service-ingress.yaml @@ -37,10 +37,16 @@ spec: port: {{ tuple "ingress" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} protocol: TCP targetPort: {{ tuple "ingress" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + {{- if .Values.network.ingress.node_port.enabled }} + nodePort: {{ .Values.network.ingress.node_port.http_port }} + {{- end }} - name: https port: {{ tuple "ingress" "internal" "https" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} protocol: TCP targetPort: {{ tuple "ingress" "internal" "https" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + {{- if .Values.network.ingress.node_port.enabled }} + nodePort: {{ .Values.network.ingress.node_port.https_port }} + {{- end }} - name: status port: {{ tuple "ingress" "internal" "status" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} protocol: TCP @@ -65,4 +71,7 @@ spec: selector: {{ tuple $envAll "ingress" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{- end }} +{{- if .Values.network.ingress.node_port.enabled }} + type: NodePort +{{- end }} {{- end }} diff --git a/ingress/values.yaml b/ingress/values.yaml index 2026f980b..de00f7613 100644 --- a/ingress/values.yaml +++ b/ingress/values.yaml @@ -152,6 +152,10 @@ network: # Useful if the CNI or provider can set up routes, etc. assign_as_external_ip: false ingress: + node_port: + enabled: false + http_port: 30080 + https_port: 30443 annotations: # NOTE(portdirect): if left blank this is populated from # .deployment.cluster.class diff --git a/releasenotes/notes/ingress.yaml b/releasenotes/notes/ingress.yaml index 8c9a28b34..1e91d4b8f 100644 --- a/releasenotes/notes/ingress.yaml +++ b/releasenotes/notes/ingress.yaml @@ -16,4 +16,5 @@ ingress: - 0.2.10 Update neutron images to xena release - 0.2.11 Fix resource name in the role - 0.2.12 Uplift ingress to 1.5.1 + - 0.2.13 Allow setting node_port for the svc ...