Fix #152 Add Helm chart support for Istio port naming (attempt 2) (#162)

Fixes #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
This commit is contained in:
Frank Kelly 2021-09-09 20:56:16 -04:00 committed by GitHub
parent f307cc32af
commit 5b10f48f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 14 deletions

View File

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

View File

@ -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 }}

View File

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

View File

@ -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:

View File

@ -37,7 +37,7 @@ spec:
- name: http
port: {{ .Values.proxy.ports.http }}
protocol: TCP
- name: pulsar
- name: "{{ .Values.tcpPrefix }}pulsar"
port: {{ .Values.proxy.ports.pulsar }}
protocol: TCP
{{- end }}
@ -45,7 +45,7 @@ spec:
- name: https
port: {{ .Values.proxy.ports.https }}
protocol: TCP
- name: pulsarssl
- name: "{{ .Values.tlsPrefix }}pulsarssl"
port: {{ .Values.proxy.ports.pulsarssl }}
protocol: TCP
{{- end }}

View File

@ -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 }}

View File

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

View File

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