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" appVersion: "2.7.2"
description: Apache Pulsar Helm chart for Kubernetes description: Apache Pulsar Helm chart for Kubernetes
name: pulsar name: pulsar
version: 2.7.2 version: 2.7.3
home: https://pulsar.apache.org home: https://pulsar.apache.org
sources: sources:
- https://github.com/apache/pulsar - https://github.com/apache/pulsar

View File

@ -170,7 +170,7 @@ spec:
readOnlyRootFilesystem: false readOnlyRootFilesystem: false
{{- end}} {{- end}}
ports: ports:
- name: bookie - name: "{{ .Values.tcpPrefix }}bookie"
containerPort: {{ .Values.bookkeeper.ports.bookie }} containerPort: {{ .Values.bookkeeper.ports.bookie }}
- name: http - name: http
containerPort: {{ .Values.bookkeeper.ports.http }} containerPort: {{ .Values.bookkeeper.ports.http }}

View File

@ -34,13 +34,13 @@ spec:
- name: http - name: http
port: {{ .Values.broker.ports.http }} port: {{ .Values.broker.ports.http }}
{{- if or (not .Values.tls.enabled) (not .Values.tls.broker.enabled) }} {{- if or (not .Values.tls.enabled) (not .Values.tls.broker.enabled) }}
- name: pulsar - name: "{{ .Values.tcpPrefix }}pulsar"
port: {{ .Values.broker.ports.pulsar }} port: {{ .Values.broker.ports.pulsar }}
{{- end }} {{- end }}
{{- if and .Values.tls.enabled .Values.tls.broker.enabled }} {{- if and .Values.tls.enabled .Values.tls.broker.enabled }}
- name: https - name: https
port: {{ .Values.broker.ports.https }} port: {{ .Values.broker.ports.https }}
- name: pulsarssl - name: "{{ .Values.tlsPrefix }}pulsarssl"
port: {{ .Values.broker.ports.pulsarssl }} port: {{ .Values.broker.ports.pulsarssl }}
{{- end }} {{- end }}
clusterIP: None clusterIP: None

View File

@ -212,13 +212,13 @@ spec:
- name: http - name: http
containerPort: {{ .Values.broker.ports.http }} containerPort: {{ .Values.broker.ports.http }}
{{- if or (not .Values.tls.enabled) (not .Values.tls.broker.enabled) }} {{- if or (not .Values.tls.enabled) (not .Values.tls.broker.enabled) }}
- name: pulsar - name: "{{ .Values.tcpPrefix }}pulsar"
containerPort: {{ .Values.broker.ports.pulsar }} containerPort: {{ .Values.broker.ports.pulsar }}
{{- end }} {{- end }}
{{- if and .Values.tls.enabled .Values.tls.broker.enabled }} {{- if and .Values.tls.enabled .Values.tls.broker.enabled }}
- name: https - name: https
containerPort: {{ .Values.broker.ports.https }} containerPort: {{ .Values.broker.ports.https }}
- name: pulsarssl - name: "{{ .Values.tlsPrefix }}pulsarssl"
containerPort: {{ .Values.broker.ports.pulsarssl }} containerPort: {{ .Values.broker.ports.pulsarssl }}
{{- end }} {{- end }}
envFrom: envFrom:

View File

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

View File

@ -183,13 +183,13 @@ spec:
- name: http - name: http
containerPort: {{ .Values.proxy.ports.http }} containerPort: {{ .Values.proxy.ports.http }}
{{- if or (not .Values.tls.enabled) (not .Values.tls.proxy.enabled) }} {{- if or (not .Values.tls.enabled) (not .Values.tls.proxy.enabled) }}
- name: pulsar - name: "{{ .Values.tcpPrefix }}pulsar"
containerPort: {{ .Values.proxy.ports.pulsar }} containerPort: {{ .Values.proxy.ports.pulsar }}
{{- end }} {{- end }}
{{- if and (.Values.tls.enabled) (.Values.tls.proxy.enabled) }} {{- if and (.Values.tls.enabled) (.Values.tls.proxy.enabled) }}
- name: https - name: https
containerPort: {{ .Values.proxy.ports.https }} containerPort: {{ .Values.proxy.ports.https }}
- name: pulsarssl - name: "{{ .Values.tlsPrefix }}pulsarssl"
containerPort: {{ .Values.proxy.ports.pulsarssl }} containerPort: {{ .Values.proxy.ports.pulsarssl }}
{{- end }} {{- end }}
{{- if and .Values.rbac.enabled .Values.rbac.psp }} {{- if and .Values.rbac.enabled .Values.rbac.psp }}

View File

@ -34,14 +34,14 @@ spec:
# prometheus needs to access /metrics endpoint # prometheus needs to access /metrics endpoint
- name: http - name: http
port: {{ .Values.zookeeper.ports.http }} port: {{ .Values.zookeeper.ports.http }}
- name: follower - name: "{{ .Values.tcpPrefix }}follower"
port: {{ .Values.zookeeper.ports.follower }} port: {{ .Values.zookeeper.ports.follower }}
- name: leader-election - name: "{{ .Values.tcpPrefix }}leader-election"
port: {{ .Values.zookeeper.ports.leaderElection }} port: {{ .Values.zookeeper.ports.leaderElection }}
- name: client - name: "{{ .Values.tcpPrefix }}client"
port: {{ .Values.zookeeper.ports.client }} port: {{ .Values.zookeeper.ports.client }}
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} {{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
- name: client-tls - name: "{{ .Values.tlsPrefix }}client-tls"
port: {{ .Values.zookeeper.ports.clientTls }} port: {{ .Values.zookeeper.ports.clientTls }}
{{- end }} {{- end }}
clusterIP: None clusterIP: None

View File

@ -48,6 +48,15 @@ initialize: false
## be stored under the provided path ## be stored under the provided path
metadataPrefix: "" 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 ## Persistence
## ##
## If persistence is enabled, components that have state will ## If persistence is enabled, components that have state will