Allow broker's service clusterIP customisation (#498)

* Allow broker's service clusterIP customisation

This customisation is useful to configure headless vs non-headless
broker's service. The default is headless broker service, i.e. a
service for which kubernetes  does not allocate an IP
address (https://kubernetes.io/docs/concepts/services-networking/service/#type-clusterip). A
headless service is a very simple type of service that doesn't seem to work well
when pulsar service is exposed by pulsar-proxy via a nodeport.

Addresses #497.

* Address review comments

https://github.com/apache/pulsar-helm-chart/pull/498/files#r1605762934
and https://github.com/apache/pulsar-helm-chart/pull/498/files#r1605763245

* Move doc to Values.broker.service
This commit is contained in:
Massimiliano Mirelli 2024-06-04 18:45:14 +03:00 committed by GitHub
parent 3ecc2baab8
commit cb5c44f8ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,7 @@ metadata:
annotations: annotations:
{{ toYaml .Values.broker.service.annotations | indent 4 }} {{ toYaml .Values.broker.service.annotations | indent 4 }}
spec: spec:
type: ClusterIP
ports: ports:
# prometheus needs to access /metrics endpoint # prometheus needs to access /metrics endpoint
- name: http - name: http
@ -43,7 +44,7 @@ spec:
- name: "{{ .Values.tlsPrefix }}pulsarssl" - name: "{{ .Values.tlsPrefix }}pulsarssl"
port: {{ .Values.broker.ports.pulsarssl }} port: {{ .Values.broker.ports.pulsarssl }}
{{- end }} {{- end }}
clusterIP: None clusterIP: "{{ .Values.broker.service.clusterIP }}"
selector: selector:
{{- include "pulsar.matchLabels" . | nindent 4 }} {{- include "pulsar.matchLabels" . | nindent 4 }}
component: {{ .Values.broker.component }} component: {{ .Values.broker.component }}

View File

@ -861,6 +861,12 @@ broker:
## templates/broker-service.yaml ## templates/broker-service.yaml
## ##
service: service:
# clusterIP can be one of the three, which determines the type of k8s service deployed for broker
# 1. a valid IPv4 address -> non-headless service, let you select the IPv4 address
# 2. '' -> non-headless service, k8s picks an IPv4 address
# 3. 'None' -> headless
# Ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-clusterip
clusterIP: "None"
annotations: {} annotations: {}
## Broker PodDisruptionBudget ## Broker PodDisruptionBudget
## templates/broker-pdb.yaml ## templates/broker-pdb.yaml