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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6e84409  Support NodePort Proxy service (#500)
6e84409 is described below

commit 6e84409b48202a7db4fe11138fe7a6fe2ea059bd
Author: Massimiliano Mirelli <[email protected]>
AuthorDate: Tue Jun 4 18:46:16 2024 +0300

    Support NodePort Proxy service (#500)
    
    * Enables nodeport support for the proxy
    
    * Correct indentation and remove null `nodePort`
    
    Removing null `nodePort` causes k8s to pick up a random port
    
    * Address review comment
    
    https://github.com/apache/pulsar-helm-chart/pull/500/files#r1605762312
---
 charts/pulsar/templates/proxy-service.yaml | 12 ++++++++++++
 charts/pulsar/values.yaml                  |  7 +++++++
 2 files changed, 19 insertions(+)

diff --git a/charts/pulsar/templates/proxy-service.yaml 
b/charts/pulsar/templates/proxy-service.yaml
index 63994e9..cbe73d0 100644
--- a/charts/pulsar/templates/proxy-service.yaml
+++ b/charts/pulsar/templates/proxy-service.yaml
@@ -47,20 +47,32 @@ spec:
       port: {{ .Values.proxy.ports.http }}
       protocol: TCP
       targetPort: sts-http
+      {{- if and (eq .Values.proxy.service.type "NodePort") (ne 
.Values.proxy.service.nodePorts.http "") }}
+      nodePort: {{ .Values.proxy.service.nodePorts.http }}
+      {{- end}}
     - name: "{{ .Values.tcpPrefix }}pulsar"
       port: {{ .Values.proxy.ports.pulsar }}
       protocol: TCP
       targetPort: "sts-{{ .Values.tcpPrefix }}pulsar"
+      {{- if and (eq .Values.proxy.service.type "NodePort") (ne 
.Values.proxy.service.nodePorts.pulsar "") }}
+      nodePort: {{ .Values.proxy.service.nodePorts.pulsar }}
+      {{- end}}
     {{- end }}
     {{- if and .Values.tls.enabled .Values.tls.proxy.enabled }}
     - name: https
       port: {{ .Values.proxy.ports.https }}
       protocol: TCP
       targetPort: sts-https
+      {{- if and (eq .Values.proxy.service.type "NodePort") (ne 
.Values.proxy.service.nodePorts.https "") }}
+      nodePort: {{ .Values.proxy.service.nodePorts.https }}
+      {{- end}}
     - name: "{{ .Values.tlsPrefix }}pulsarssl"
       port: {{ .Values.proxy.ports.pulsarssl }}
       protocol: TCP
       targetPort: "sts-{{ .Values.tlsPrefix }}pulsarssl"
+      {{- if and (eq .Values.proxy.service.type "NodePort") (ne 
.Values.proxy.service.nodePorts.pulsarssl "") }}
+      nodePort: {{ .Values.proxy.service.nodePorts.pulsarssl }}
+      {{- end}}
     {{- end }}
   selector:
     {{- include "pulsar.matchLabels" . | nindent 4 }}
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index 22ad8f0..2f0ef2f 100755
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -1111,6 +1111,13 @@ proxy:
     ## Restrict traffic through the load balancer to specified IPs on 
providers supporting it.
     # loadBalancerSourceRanges:
     #   - 10.0.0.0/8
+    # Optional. When setting proxy.service.type is set to NodePort, nodePorts 
allows to choose the port that will be open on each node to proxy requests to 
each destination proxy service.
+    # Ref: 
https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
+    nodePorts:
+      http: ""
+      https: ""
+      pulsar: ""
+      pulsarssl: ""
   ## Proxy ingress
   ## templates/proxy-ingress.yaml
   ##

Reply via email to