-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: haorenfsa <[email protected]>
- Loading branch information
Showing
74 changed files
with
6,717 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
appVersion: 2.7.4 | ||
description: Apache Pulsar Helm chart for Kubernetes | ||
home: https://pulsar.apache.org | ||
icon: http://pulsar.apache.org/img/pulsar.svg | ||
maintainers: | ||
- name: contact | ||
email: [email protected] | ||
name: pulsarv2 | ||
sources: | ||
- https://github.com/apache/pulsar | ||
version: 2.7.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{{/* | ||
Define the pulsar autorecovery service | ||
*/}} | ||
{{- define "pulsar.autorecovery.service" -}} | ||
{{ template "pulsar.fullname" . }}-{{ .Values.autorecovery.component }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the autorecovery hostname | ||
*/}} | ||
{{- define "pulsar.autorecovery.hostname" -}} | ||
${HOSTNAME}.{{ template "pulsar.autorecovery.service" . }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define autorecovery zookeeper client tls settings | ||
*/}} | ||
{{- define "pulsar.autorecovery.zookeeper.tls.settings" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} | ||
/pulsar/keytool/keytool.sh autorecovery {{ template "pulsar.autorecovery.hostname" . }} true; | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define autorecovery tls certs mounts | ||
*/}} | ||
{{- define "pulsar.autorecovery.certs.volumeMounts" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} | ||
- name: autorecovery-certs | ||
mountPath: "/pulsar/certs/autorecovery" | ||
readOnly: true | ||
- name: ca | ||
mountPath: "/pulsar/certs/ca" | ||
readOnly: true | ||
{{- if .Values.tls.zookeeper.enabled }} | ||
- name: keytool | ||
mountPath: "/pulsar/keytool/keytool.sh" | ||
subPath: keytool.sh | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define autorecovery tls certs volumes | ||
*/}} | ||
{{- define "pulsar.autorecovery.certs.volumes" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} | ||
- name: autorecovery-certs | ||
secret: | ||
secretName: "{{ .Release.Name }}-{{ .Values.tls.autorecovery.cert_name }}" | ||
items: | ||
- key: tls.crt | ||
path: tls.crt | ||
- key: tls.key | ||
path: tls.key | ||
- name: ca | ||
secret: | ||
secretName: "{{ .Release.Name }}-{{ .Values.tls.ca_suffix }}" | ||
items: | ||
- key: ca.crt | ||
path: ca.crt | ||
{{- if .Values.tls.zookeeper.enabled }} | ||
- name: keytool | ||
configMap: | ||
name: "{{ template "pulsar.fullname" . }}-keytool-configmap" | ||
defaultMode: 0755 | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define autorecovery init container : verify cluster id | ||
*/}} | ||
{{- define "pulsar.autorecovery.init.verify_cluster_id" -}} | ||
bin/apply-config-from-env.py conf/bookkeeper.conf; | ||
{{- include "pulsar.autorecovery.zookeeper.tls.settings" . -}} | ||
until bin/bookkeeper shell whatisinstanceid; do | ||
sleep 3; | ||
done; | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{{/* | ||
Define the pulsar bookkeeper service | ||
*/}} | ||
{{- define "pulsar.bookkeeper.service" -}} | ||
{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the bookkeeper hostname | ||
*/}} | ||
{{- define "pulsar.bookkeeper.hostname" -}} | ||
${HOSTNAME}.{{ template "pulsar.bookkeeper.service" . }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Define bookie zookeeper client tls settings | ||
*/}} | ||
{{- define "pulsar.bookkeeper.zookeeper.tls.settings" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} | ||
/pulsar/keytool/keytool.sh bookie {{ template "pulsar.bookkeeper.hostname" . }} true; | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define bookie tls certs mounts | ||
*/}} | ||
{{- define "pulsar.bookkeeper.certs.volumeMounts" -}} | ||
{{- if and .Values.tls.enabled (or .Values.tls.bookie.enabled .Values.tls.zookeeper.enabled) }} | ||
- name: bookie-certs | ||
mountPath: "/pulsar/certs/bookie" | ||
readOnly: true | ||
- name: ca | ||
mountPath: "/pulsar/certs/ca" | ||
readOnly: true | ||
{{- if .Values.tls.zookeeper.enabled }} | ||
- name: keytool | ||
mountPath: "/pulsar/keytool/keytool.sh" | ||
subPath: keytool.sh | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define bookie tls certs volumes | ||
*/}} | ||
{{- define "pulsar.bookkeeper.certs.volumes" -}} | ||
{{- if and .Values.tls.enabled (or .Values.tls.bookie.enabled .Values.tls.zookeeper.enabled) }} | ||
- name: bookie-certs | ||
secret: | ||
secretName: "{{ .Release.Name }}-{{ .Values.tls.bookie.cert_name }}" | ||
items: | ||
- key: tls.crt | ||
path: tls.crt | ||
- key: tls.key | ||
path: tls.key | ||
- name: ca | ||
secret: | ||
secretName: "{{ .Release.Name }}-{{ .Values.tls.ca_suffix }}" | ||
items: | ||
- key: ca.crt | ||
path: ca.crt | ||
{{- if .Values.tls.zookeeper.enabled }} | ||
- name: keytool | ||
configMap: | ||
name: "{{ template "pulsar.fullname" . }}-keytool-configmap" | ||
defaultMode: 0755 | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define bookie common config | ||
*/}} | ||
{{- define "pulsar.bookkeeper.config.common" -}} | ||
zkServers: "{{ template "pulsar.zookeeper.connect" . }}" | ||
zkLedgersRootPath: "{{ .Values.metadataPrefix }}/ledgers" | ||
# enable bookkeeper http server | ||
httpServerEnabled: "true" | ||
httpServerPort: "{{ .Values.bookkeeper.ports.http }}" | ||
# config the stats provider | ||
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider | ||
# use hostname as the bookie id | ||
useHostNameAsBookieID: "true" | ||
{{- end }} | ||
|
||
{{/* | ||
Define bookie tls config | ||
*/}} | ||
{{- define "pulsar.bookkeeper.config.tls" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.bookie.enabled }} | ||
PULSAR_PREFIX_tlsProviderFactoryClass: org.apache.bookkeeper.tls.TLSContextFactory | ||
PULSAR_PREFIX_tlsCertificatePath: /pulsar/certs/bookie/tls.crt | ||
PULSAR_PREFIX_tlsKeyStoreType: PEM | ||
PULSAR_PREFIX_tlsKeyStore: /pulsar/certs/bookie/tls.key | ||
PULSAR_PREFIX_tlsTrustStoreType: PEM | ||
PULSAR_PREFIX_tlsTrustStore: /pulsar/certs/ca/ca.crt | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define bookie init container : verify cluster id | ||
*/}} | ||
{{- define "pulsar.bookkeeper.init.verify_cluster_id" -}} | ||
{{- if not (and .Values.volumes.persistence .Values.bookkeeper.volumes.persistence) }} | ||
bin/apply-config-from-env.py conf/bookkeeper.conf; | ||
{{- include "pulsar.bookkeeper.zookeeper.tls.settings" . -}} | ||
until bin/bookkeeper shell whatisinstanceid; do | ||
sleep 3; | ||
done; | ||
bin/bookkeeper shell bookieformat -nonInteractive -force -deleteCookie || true | ||
{{- end }} | ||
{{- if and .Values.volumes.persistence .Values.bookkeeper.volumes.persistence }} | ||
set -e; | ||
bin/apply-config-from-env.py conf/bookkeeper.conf; | ||
{{- include "pulsar.bookkeeper.zookeeper.tls.settings" . -}} | ||
until bin/bookkeeper shell whatisinstanceid; do | ||
sleep 3; | ||
done; | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{{/* | ||
Define the pulsar brroker service | ||
*/}} | ||
{{- define "pulsar.broker.service" -}} | ||
{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the hostname | ||
*/}} | ||
{{- define "pulsar.broker.hostname" -}} | ||
${HOSTNAME}.{{ template "pulsar.broker.service" . }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define the broker znode | ||
*/}} | ||
{{- define "pulsar.broker.znode" -}} | ||
{{ .Values.metadataPrefix }}/loadbalance/brokers/{{ template "pulsar.broker.hostname" . }}:{{ .Values.broker.ports.http }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define broker zookeeper client tls settings | ||
*/}} | ||
{{- define "pulsar.broker.zookeeper.tls.settings" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} | ||
/pulsar/keytool/keytool.sh broker {{ template "pulsar.broker.hostname" . }} true; | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define broker tls certs mounts | ||
*/}} | ||
{{- define "pulsar.broker.certs.volumeMounts" -}} | ||
{{- if and .Values.tls.enabled (or .Values.tls.broker.enabled (or .Values.tls.bookie.enabled .Values.tls.zookeeper.enabled)) }} | ||
- name: broker-certs | ||
mountPath: "/pulsar/certs/broker" | ||
readOnly: true | ||
- name: ca | ||
mountPath: "/pulsar/certs/ca" | ||
readOnly: true | ||
{{- if .Values.tls.zookeeper.enabled }} | ||
- name: keytool | ||
mountPath: "/pulsar/keytool/keytool.sh" | ||
subPath: keytool.sh | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Define broker tls certs volumes | ||
*/}} | ||
{{- define "pulsar.broker.certs.volumes" -}} | ||
{{- if and .Values.tls.enabled (or .Values.tls.broker.enabled (or .Values.tls.bookie.enabled .Values.tls.zookeeper.enabled)) }} | ||
- name: broker-certs | ||
secret: | ||
secretName: "{{ .Release.Name }}-{{ .Values.tls.broker.cert_name }}" | ||
items: | ||
- key: tls.crt | ||
path: tls.crt | ||
- key: tls.key | ||
path: tls.key | ||
- name: ca | ||
secret: | ||
secretName: "{{ .Release.Name }}-{{ .Values.tls.ca_suffix }}" | ||
items: | ||
- key: ca.crt | ||
path: ca.crt | ||
{{- if .Values.tls.zookeeper.enabled }} | ||
- name: keytool | ||
configMap: | ||
name: "{{ template "pulsar.fullname" . }}-keytool-configmap" | ||
defaultMode: 0755 | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{/* | ||
Define configuration store endpoint | ||
*/}} | ||
{{- define "pulsar.configurationStore.service" -}} | ||
{{- if .Values.pulsar_metadata.configurationStore }} | ||
{{- .Values.pulsar_metadata.configurationStore }} | ||
{{- else -}} | ||
{{ template "pulsar.zookeeper.service" . }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define configuration store connection string | ||
*/}} | ||
{{- define "pulsar.configurationStore.connect" -}} | ||
{{- if .Values.pulsar_metadata.configurationStore }} | ||
{{- template "pulsar.configurationStore.service" . }}:{{ .Values.pulsar_metadata.configurationStorePort }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
Oops, something went wrong.