Skip to content

Commit

Permalink
Fix datastax#152 Add Helm chart support for Istio port naming (attemp…
Browse files Browse the repository at this point in the history
…t 2) (datastax#162)

Fixes datastax#152 

### Motivation

Support prefix in front of port names to abide by Istio protocol rules
https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/#explicit-protocol-selection

### Modifications

Support adding a prefix
- pulsar -> tcp-pulsar
- pulsarssl --> tls-pulsarssl etc
  • Loading branch information
frankjkelly committed Sep 10, 2021
1 parent f307cc3 commit 5b10f48
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/pulsar/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apiVersion: v1
appVersion: "2.7.2"
description: Apache Pulsar Helm chart for Kubernetes
name: pulsar
version: 2.7.2
version: 2.7.3
home: https://pulsar.apache.org
sources:
- https://github.com/apache/pulsar
Expand Down
2 changes: 1 addition & 1 deletion charts/pulsar/templates/bookkeeper-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ spec:
readOnlyRootFilesystem: false
{{- end}}
ports:
- name: bookie
- name: "{{ .Values.tcpPrefix }}bookie"
containerPort: {{ .Values.bookkeeper.ports.bookie }}
- name: http
containerPort: {{ .Values.bookkeeper.ports.http }}
Expand Down
4 changes: 2 additions & 2 deletions charts/pulsar/templates/broker-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ spec:
- name: http
port: {{ .Values.broker.ports.http }}
{{- if or (not .Values.tls.enabled) (not .Values.tls.broker.enabled) }}
- name: pulsar
- name: "{{ .Values.tcpPrefix }}pulsar"
port: {{ .Values.broker.ports.pulsar }}
{{- end }}
{{- if and .Values.tls.enabled .Values.tls.broker.enabled }}
- name: https
port: {{ .Values.broker.ports.https }}
- name: pulsarssl
- name: "{{ .Values.tlsPrefix }}pulsarssl"
port: {{ .Values.broker.ports.pulsarssl }}
{{- end }}
clusterIP: None
Expand Down
4 changes: 2 additions & 2 deletions charts/pulsar/templates/broker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ spec:
- name: http
containerPort: {{ .Values.broker.ports.http }}
{{- if or (not .Values.tls.enabled) (not .Values.tls.broker.enabled) }}
- name: pulsar
- name: "{{ .Values.tcpPrefix }}pulsar"
containerPort: {{ .Values.broker.ports.pulsar }}
{{- end }}
{{- if and .Values.tls.enabled .Values.tls.broker.enabled }}
- name: https
containerPort: {{ .Values.broker.ports.https }}
- name: pulsarssl
- name: "{{ .Values.tlsPrefix }}pulsarssl"
containerPort: {{ .Values.broker.ports.pulsarssl }}
{{- end }}
envFrom:
Expand Down
4 changes: 2 additions & 2 deletions charts/pulsar/templates/proxy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ spec:
- name: http
port: {{ .Values.proxy.ports.http }}
protocol: TCP
- name: pulsar
- name: "{{ .Values.tcpPrefix }}pulsar"
port: {{ .Values.proxy.ports.pulsar }}
protocol: TCP
{{- end }}
{{- if and .Values.tls.enabled .Values.tls.proxy.enabled }}
- name: https
port: {{ .Values.proxy.ports.https }}
protocol: TCP
- name: pulsarssl
- name: "{{ .Values.tlsPrefix }}pulsarssl"
port: {{ .Values.proxy.ports.pulsarssl }}
protocol: TCP
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/pulsar/templates/proxy-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ spec:
- name: http
containerPort: {{ .Values.proxy.ports.http }}
{{- if or (not .Values.tls.enabled) (not .Values.tls.proxy.enabled) }}
- name: pulsar
- name: "{{ .Values.tcpPrefix }}pulsar"
containerPort: {{ .Values.proxy.ports.pulsar }}
{{- end }}
{{- if and (.Values.tls.enabled) (.Values.tls.proxy.enabled) }}
- name: https
containerPort: {{ .Values.proxy.ports.https }}
- name: pulsarssl
- name: "{{ .Values.tlsPrefix }}pulsarssl"
containerPort: {{ .Values.proxy.ports.pulsarssl }}
{{- end }}
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
Expand Down
8 changes: 4 additions & 4 deletions charts/pulsar/templates/zookeeper-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ spec:
# prometheus needs to access /metrics endpoint
- name: http
port: {{ .Values.zookeeper.ports.http }}
- name: follower
- name: "{{ .Values.tcpPrefix }}follower"
port: {{ .Values.zookeeper.ports.follower }}
- name: leader-election
- name: "{{ .Values.tcpPrefix }}leader-election"
port: {{ .Values.zookeeper.ports.leaderElection }}
- name: client
- name: "{{ .Values.tcpPrefix }}client"
port: {{ .Values.zookeeper.ports.client }}
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
- name: client-tls
- name: "{{ .Values.tlsPrefix }}client-tls"
port: {{ .Values.zookeeper.ports.clientTls }}
{{- end }}
clusterIP: None
Expand Down
9 changes: 9 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ initialize: false
## be stored under the provided path
metadataPrefix: ""

## Port name prefix
##
## Used for Istio support which depends on a standard naming of ports
## See https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/#explicit-protocol-selection
## Prefixes are disabled by default

tcpPrefix: "" # For Istio this will be "tcp-"
tlsPrefix: "" # For Istio this will be "tls-"

## Persistence
##
## If persistence is enabled, components that have state will
Expand Down

0 comments on commit 5b10f48

Please sign in to comment.