From 8eb8f905aa17a221cd30d9c9563bd1bb77c37e3d Mon Sep 17 00:00:00 2001 From: Pavan Kumar <64532630+pavankumar-go@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:53:35 +0530 Subject: [PATCH 1/2] allow nodeport & serviceport to be set in additionalContainerPorts --- charts/apisix/templates/service-gateway.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/apisix/templates/service-gateway.yaml b/charts/apisix/templates/service-gateway.yaml index 7797435a..28214992 100644 --- a/charts/apisix/templates/service-gateway.yaml +++ b/charts/apisix/templates/service-gateway.yaml @@ -58,8 +58,11 @@ spec: {{- end }} {{- range .Values.service.http.additionalContainerPorts }} - name: apisix-gateway-{{ .port | toString }} - port: {{ .port }} + port: {{ or .servicePort .port }} targetPort: {{ .port }} + {{- if not (empty .nodePort) }} + nodePort: {{ .nodePort }} + {{- end}} protocol: TCP {{- end }} {{- if or .Values.apisix.ssl.enabled }} From 31e8d2621851ffd4bd72340be989e721e8528967 Mon Sep 17 00:00:00 2001 From: Pavan Kumar <64532630+pavankumar-go@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:15:09 +0530 Subject: [PATCH 2/2] chore: update additionalContainerPorts helper configurations --- charts/apisix/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml index f552c7dc..da8348af 100644 --- a/charts/apisix/values.yaml +++ b/charts/apisix/values.yaml @@ -180,7 +180,8 @@ service: # -- Support multiple http ports, See [Configuration](https://github.com/apache/apisix/blob/0bc65ea9acd726f79f80ae0abd8f50b7eb172e3d/conf/config-default.yaml#L24) additionalContainerPorts: [] # - port: 9081 - # enable_http2: true # If not set, the default value is `false`. + # servicePort: 8080 # Optional, if not set, `.port` value will be used. + # nodePort: 303030 # Optional # - ip: 127.0.0.2 # Specific IP, If not set, the default value is `0.0.0.0`. # port: 9082 # enable_http2: true