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 7e9ea8d  fix: enable tls for the tcp address (#401)
7e9ea8d is described below

commit 7e9ea8d0c0efb0152121a4e8f1fb937819c7fc33
Author: chengzw <[email protected]>
AuthorDate: Wed Jan 18 11:05:31 2023 +0800

    fix: enable tls for the tcp address (#401)
    
    Co-authored-by: Cheng, Seven <[email protected]>
---
 charts/apisix/templates/_pod.tpl             | 4 ++++
 charts/apisix/templates/configmap.yaml       | 7 +++++++
 charts/apisix/templates/service-gateway.yaml | 6 ++++++
 3 files changed, 17 insertions(+)

diff --git a/charts/apisix/templates/_pod.tpl b/charts/apisix/templates/_pod.tpl
index db2bc46..5c5eedd 100644
--- a/charts/apisix/templates/_pod.tpl
+++ b/charts/apisix/templates/_pod.tpl
@@ -62,7 +62,11 @@ spec:
         {{- if (gt (len .tcp) 0) }}
         {{- range $index, $port := .tcp }}
         - name: proxy-tcp-{{ $index | toString }}
+        {{- if kindIs "map" $port }}
+          containerPort: {{ splitList ":" ($port.addr | toString) | last }}
+        {{- else }}
           containerPort: {{ $port }}
+        {{- end }}
           protocol: TCP
         {{- end }}
         {{- end }}
diff --git a/charts/apisix/templates/configmap.yaml 
b/charts/apisix/templates/configmap.yaml
index 4ff0276..42e9adf 100644
--- a/charts/apisix/templates/configmap.yaml
+++ b/charts/apisix/templates/configmap.yaml
@@ -100,8 +100,15 @@ data:
         tcp:                        # TCP proxy port list
           {{- if gt (len .Values.gateway.stream.tcp) 0}}
           {{- range .Values.gateway.stream.tcp }}
+          {{- if kindIs "map" . }}
+          - addr: {{ .addr }}
+          {{- if hasKey . "tls" }}
+            tls: {{ .tls }}
+          {{- end }}
+          {{- else }}
           - {{ . }}
           {{- end }}
+          {{- end }}
           {{- else}}
           - 9100
           {{- end }}
diff --git a/charts/apisix/templates/service-gateway.yaml 
b/charts/apisix/templates/service-gateway.yaml
index db88c4a..794c718 100644
--- a/charts/apisix/templates/service-gateway.yaml
+++ b/charts/apisix/templates/service-gateway.yaml
@@ -71,11 +71,17 @@ spec:
   {{- if (gt (len .tcp) 0) }}
   {{- range $index, $port := .tcp }}
   - name: proxy-tcp-{{ $index | toString }}
+  {{- if kindIs "map" $port }}
+    port: {{ splitList ":" ($port.addr | toString) | last }}
+    targetPort: {{ splitList ":" ($port.addr | toString) | last }}
+    protocol: TCP
+  {{- else }}
     port: {{ $port }}
     targetPort: {{ $port }}
     protocol: TCP
   {{- end }}
   {{- end }}
+  {{- end }}
   {{- if (gt (len .udp) 0) }}
   {{- range $index, $port := .udp }}
   - name: proxy-udp-{{ $index | toString }}

Reply via email to