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 ##