This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d9afdd  feat(apisix): expose stream proxy tcp/udp ports (#227)
3d9afdd is described below

commit 3d9afddb1b6ae022fefcbe19bf1f7ed8671f5b2f
Author: Gallardot <ttt...@163.com>
AuthorDate: Thu Feb 10 12:10:00 2022 +0800

    feat(apisix): expose stream proxy tcp/udp ports (#227)
---
 charts/apisix/templates/deployment.yaml      | 18 ++++++++++++++++++
 charts/apisix/templates/service-gateway.yaml | 20 ++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/charts/apisix/templates/deployment.yaml 
b/charts/apisix/templates/deployment.yaml
index 97df7ab..523110e 100644
--- a/charts/apisix/templates/deployment.yaml
+++ b/charts/apisix/templates/deployment.yaml
@@ -68,6 +68,24 @@ spec:
               containerPort: {{ .Values.serviceMonitor.containerPort }}
               protocol: TCP
             {{- end }}
+            {{- if and .Values.gateway.stream.enabled (or (gt (len 
.Values.gateway.stream.tcp) 0) (gt (len .Values.gateway.stream.udp) 0)) }}
+            {{- with .Values.gateway.stream }}
+            {{- if (gt (len .tcp) 0) }}
+            {{- range $index, $port := .tcp }}
+            - name: proxy-tcp-{{ $index | toString }}
+              containerPort: {{ $port }}
+              protocol: TCP
+            {{- end }}
+            {{- end }}
+            {{- if (gt (len .udp) 0) }}
+            {{- range $index, $port := .udp }}
+            - name: proxy-udp-{{ $index | toString }}
+              containerPort: {{ $port }}
+              protocol: UDP
+            {{- end }}
+            {{- end }}
+            {{- end }}
+            {{- end }}
           readinessProbe:
             failureThreshold: 6
             initialDelaySeconds: 10
diff --git a/charts/apisix/templates/service-gateway.yaml 
b/charts/apisix/templates/service-gateway.yaml
index 1361872..db88c4a 100644
--- a/charts/apisix/templates/service-gateway.yaml
+++ b/charts/apisix/templates/service-gateway.yaml
@@ -66,6 +66,26 @@ spec:
   {{- end }}
     protocol: TCP
   {{- end }}
+  {{- if and .Values.gateway.stream.enabled (or (gt (len 
.Values.gateway.stream.tcp) 0) (gt (len .Values.gateway.stream.udp) 0)) }}
+  {{- with .Values.gateway.stream }}
+  {{- if (gt (len .tcp) 0) }}
+  {{- range $index, $port := .tcp }}
+  - name: proxy-tcp-{{ $index | toString }}
+    port: {{ $port }}
+    targetPort: {{ $port }}
+    protocol: TCP
+  {{- end }}
+  {{- end }}
+  {{- if (gt (len .udp) 0) }}
+  {{- range $index, $port := .udp }}
+  - name: proxy-udp-{{ $index | toString }}
+    port: {{ $port }}
+    targetPort: {{ $port }}
+    protocol: UDP
+  {{- end }}
+  {{- end }}
+  {{- end }}
+  {{- end }}
   selector:
     {{- include "apisix.selectorLabels" . | nindent 4 }}
 {{- end }}

Reply via email to