Skip to content

Commit

Permalink
Support NodePort Proxy service (#500)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MMirelli committed Jun 4, 2024
1 parent cb5c44f commit 6e84409
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/pulsar/templates/proxy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down

0 comments on commit 6e84409

Please sign in to comment.