diff --git a/helm-chart-sources/pulsar/templates/_helpers.tpl b/helm-chart-sources/pulsar/templates/_helpers.tpl index 88a66ba..87f3ac7 100644 --- a/helm-chart-sources/pulsar/templates/_helpers.tpl +++ b/helm-chart-sources/pulsar/templates/_helpers.tpl @@ -39,6 +39,8 @@ Create chart name and version as used by the chart label. {{- define "pulsar.zkConnectString" -}} {{- $global := . -}} {{- range $i, $e := until (.Values.zookeeper.replicaCount | int) -}}{{ if ne $i 0 }},{{ end }}{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}-{{ printf "%d" $i }}.{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}{{ end }} +{{- $global := . -}} +{{- range $i, $e := until (.Values.zookeepernp.replicaCount | int) -}},{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}-{{ printf "%d" $i }}.{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}{{ end }} {{- end -}} {{- define "pulsar.bkConnectString" -}} @@ -60,6 +62,9 @@ Create chart name and version as used by the chart label. {{- $global := . -}} {{- $port := "2281" -}} {{- range $i, $e := until (.Values.zookeeper.replicaCount | int) -}}{{ if ne $i 0 }},{{ end }}{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}-{{ printf "%d" $i }}.{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}:{{ $port }}{{ end }} +{{- $global := . -}} +{{- $port := "2281" -}} +{{- range $i, $e := until (.Values.zookeepernp.replicaCount | int) -}},{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}-{{ printf "%d" $i }}.{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}:{{ $port }}{{ end }} {{- end -}} {{- define "pulsar.zkConnectStringTlsONe" -}} @@ -71,4 +76,13 @@ Create chart name and version as used by the chart label. {{- define "pulsar.zkServers" -}} {{- $global := . }} {{- range $i, $e := until (.Values.zookeeper.replicaCount | int) -}}{{ if ne $i 0 }},{{ end }}{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}-{{ printf "%d" $i }}{{ end }} +{{- $global := . }} +{{- range $i, $e := until (.Values.zookeepernp.replicaCount | int) -}},{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}-{{ printf "%d" $i }}{{ end }} {{- end -}} + +{{- define "pulsar.zkDomains" -}} +{{- $global := . -}} +{{- range $i, $e := until (.Values.zookeeper.replicaCount | int) -}}{{ if ne $i 0 }},{{ end }}{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}-{{ printf "%d" $i }}.{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeeper.component }}{{ end }} +{{- $global := . -}} +{{- range $i, $e := until (.Values.zookeepernp.replicaCount | int) -}},{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}-{{ printf "%d" $i }}.{{ template "pulsar.fullname" $global }}-{{ $global.Values.zookeepernp.component }}{{ end }} +{{- end -}} \ No newline at end of file diff --git a/helm-chart-sources/pulsar/templates/autorecovery-configmap.yaml b/helm-chart-sources/pulsar/templates/autorecovery-configmap.yaml index 2451541..86cee58 100644 --- a/helm-chart-sources/pulsar/templates/autorecovery-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/autorecovery-configmap.yaml @@ -33,9 +33,17 @@ metadata: data: zkServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} - {{ include "pulsar.zkConnectStringTls" . }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} {{- else }} - {{ include "pulsar.zkConnectString" . }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 + {{- else }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 + {{- end }} {{- end }} {{ toYaml .Values.autoRecovery.configData | indent 2 }} {{- end }} diff --git a/helm-chart-sources/pulsar/templates/bookkeeper-configmap.yaml b/helm-chart-sources/pulsar/templates/bookkeeper-configmap.yaml index ead0e99..b1b607e 100644 --- a/helm-chart-sources/pulsar/templates/bookkeeper-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/bookkeeper-configmap.yaml @@ -32,14 +32,24 @@ metadata: data: zkServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} + {{- else }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 {{- end }} + {{- end }} # disable auto recovery on bookies since we will start AutoRecovery in separated pods autoRecoveryDaemonEnabled: "false" # In k8s always want to use hostname as bookie ID since IP addresses are ephemeral useHostNameAsBookieID: "true" + # HTTP server used by health check + httpServerEnabled: "true" {{- if .Values.function.enableStateStorage }} {{- if not (or .Values.extra.stateStorage .Values.function.stateStorageUrlOverride) }} # Enable function state storage diff --git a/helm-chart-sources/pulsar/templates/bookkeeper-statefulset.yaml b/helm-chart-sources/pulsar/templates/bookkeeper-statefulset.yaml index 1c17931..6b84be4 100644 --- a/helm-chart-sources/pulsar/templates/bookkeeper-statefulset.yaml +++ b/helm-chart-sources/pulsar/templates/bookkeeper-statefulset.yaml @@ -148,8 +148,15 @@ spec: imagePullPolicy: {{ .Values.image.bookkeeper.pullPolicy }} {{- if .Values.bookkeeper.probe.enabled }} readinessProbe: - tcpSocket: - port: {{ .Values.bookkeeper.probe.port }} + httpGet: + path: /api/v1/bookie/is_ready + port: 8000 + initialDelaySeconds: {{ .Values.bookkeeper.probe.initial }} + periodSeconds: {{ .Values.bookkeeper.probe.period }} + livenessProbe: + httpGet: + path: /api/v1/bookie/is_ready + port: 8000 initialDelaySeconds: {{ .Values.bookkeeper.probe.initial }} periodSeconds: {{ .Values.bookkeeper.probe.period }} {{- end }} diff --git a/helm-chart-sources/pulsar/templates/broker-deployment/broker-configmap.yaml b/helm-chart-sources/pulsar/templates/broker-deployment/broker-configmap.yaml index b948180..69b968e 100644 --- a/helm-chart-sources/pulsar/templates/broker-deployment/broker-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/broker-deployment/broker-configmap.yaml @@ -32,16 +32,32 @@ metadata: data: zookeeperServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} {{- else }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 + {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 + {{- end }} {{- end }} configurationStoreServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} + {{- else }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 {{- end }} + {{- end }} clusterName: {{ template "pulsar.fullname" . }} {{- if .Values.broker.functionsWorkerEnabled }} functionsWorkerEnabled: "true" diff --git a/helm-chart-sources/pulsar/templates/broker-deployment/broker-deployment.yaml b/helm-chart-sources/pulsar/templates/broker-deployment/broker-deployment.yaml index 8043fff..c0b0749 100644 --- a/helm-chart-sources/pulsar/templates/broker-deployment/broker-deployment.yaml +++ b/helm-chart-sources/pulsar/templates/broker-deployment/broker-deployment.yaml @@ -175,6 +175,7 @@ spec: emptyDir: {} {{- end }} initContainers: + {{- if .Values.enableWaitContainers }} # This init container will wait for bookkeeper to be ready before # deploying the broker - name: wait-bookkeeper-ready @@ -186,6 +187,7 @@ spec: until nslookup {{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ add (.Values.bookkeeper.replicaCount | int) -1 }}.{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}.{{ .Release.Namespace }}; do sleep 3; done; + {{- end }} {{- if .Values.broker.initContainer }} - name: add-libs image: "{{ .Values.broker.initContainer.repository }}:{{ .Values.broker.initContainer.tag }}" diff --git a/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-configmap.yaml b/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-configmap.yaml index d86afe3..6419e03 100644 --- a/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-configmap.yaml @@ -32,16 +32,32 @@ metadata: data: zookeeperServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} + {{- if .Values.extra.zookeepernp }} + { template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} + {{- else }} + {{- if .Values.extra.zookeepernp }} + { template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 {{- end }} + {{- end }} configurationStoreServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} + {{- else }} + {{- if .Values.extra.zookeepernp }} + { template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 {{- else }} {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 {{- end }} + {{- end }} clusterName: {{ template "pulsar.fullname" . }} {{- if .Values.brokerSts.functionsWorkerEnabled }} functionsWorkerEnabled: "true" diff --git a/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-statefulset.yaml b/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-statefulset.yaml index 43562a6..c7b9587 100644 --- a/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-statefulset.yaml +++ b/helm-chart-sources/pulsar/templates/broker-sts/broker-sts-statefulset.yaml @@ -172,6 +172,7 @@ spec: emptyDir: {} {{- end }} initContainers: + {{- if .Values.enableWaitContainers }} # This init container will wait for bookkeeper to be ready before # deploying the broker - name: wait-bookkeeper-ready @@ -183,6 +184,7 @@ spec: until nslookup {{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ add (.Values.bookkeeper.replicaCount | int) -1 }}.{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}.{{ .Release.Namespace }}; do sleep 3; done; + {{- end }} {{- if .Values.brokerSts.initContainer }} - name: add-libs image: "{{ .Values.brokerSts.initContainer.repository }}:{{ .Values.brokerSts.initContainer.tag }}" diff --git a/helm-chart-sources/pulsar/templates/function-configmap.yaml b/helm-chart-sources/pulsar/templates/function-configmap.yaml index 539178c..0cc0d14 100644 --- a/helm-chart-sources/pulsar/templates/function-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/function-configmap.yaml @@ -32,14 +32,30 @@ metadata: data: functions_worker.yml: |- {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} - configurationStoreServers: {{ include "pulsar.zkConnectStringTls" . }} + {{- if .Values.extra.zookeepernp }} + configurationStoreServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} + configurationStoreServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} {{- else }} - configurationStoreServers: {{ include "pulsar.zkConnectString" . }} + {{- if .Values.extra.zookeepernp }} + configurationStoreServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 + {{- else }} + configurationStoreServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 + {{- end }} {{- end }} {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} - zookeeperServers: {{ include "pulsar.zkConnectStringTls" . }} + {{- if .Values.extra.zookeepernp }} + zookeeperServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 + {{- else }} + zookeeperServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} {{- else }} - zookeeperServers: {{ include "pulsar.zkConnectString" . }} + {{- if .Values.extra.zookeepernp }} + zookeeperServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 + {{- else }} + zookeeperServers: {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 + {{- end }} {{- end }} zooKeeperSessionTimeoutMillis: 30000 pulsarFunctionsCluster: "{{ template "pulsar.fullname" . }}" @@ -100,7 +116,7 @@ data: properties: tokenPublicKey: "file:///pulsar/token-public-key/{{ .Values.tokenPublicKeyFile }}" clientAuthenticationPlugin: "org.apache.pulsar.client.impl.auth.AuthenticationToken" - clientAuthenticationParameters: "file:///pulsar/token-superuser/superuser.jwt" + clientAuthenticationParameters: "file:///pulsar/token-superuser/superuser.jwt" superUserRoles: {{- range splitList "," .Values.superUserRoles }} - {{ . | quote }} @@ -118,13 +134,14 @@ data: extraFunctionDependenciesDir: {{- end }} {{- if eq .Values.function.runtime "kubernetes" }} + secretsProviderConfiguratorClassName: org.apache.pulsar.functions.secretsproviderconfigurator.KubernetesSecretsProviderConfigurator kubernetesContainerFactory: # uri to kubernetes cluster, leave it to empty and it will use the kubernetes settings in function worker k8Uri: # the kubernetes namespace to run the function instances. it is `default`, if this setting is left to be empty jobNamespace: {{ .Release.Namespace }} # the docker image to run function instance. by default it is `apachepulsar/pulsar` - pulsarDockerImageName: apachepulsar/pulsar + pulsarDockerImageName: {{ .Values.image.function.repository }}:{{ .Values.image.function.tag }} # the root directory of pulsar home directory in `pulsarDockerImageName`. by default it is `/pulsar`. # if you are using your own built image in `pulsarDockerImageName`, you need to set this setting accordingly pulsarRootDir: /pulsar @@ -145,5 +162,10 @@ data: #extraFunctionDependenciesDir: # Additional memory padding added on top of the memory requested by the function per on a per instance basis percentMemoryPadding: 10 + # runtimeCustomizerClassName: "org.apache.pulsar.functions.runtime.kubernetes.BasicKubernetesManifestCustomizer" + functionInstanceMinResources: + cpu: {{ .Values.function.k8sMinResources.cpu }} + ram: {{ .Values.function.k8sMinResources.ram }} + disk: {{ .Values.function.k8sMinResources.disk }} {{- end }} {{- end }} diff --git a/helm-chart-sources/pulsar/templates/proxy-configmap.yaml b/helm-chart-sources/pulsar/templates/proxy-configmap.yaml index b974bc5..5e6ab38 100644 --- a/helm-chart-sources/pulsar/templates/proxy-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/proxy-configmap.yaml @@ -44,17 +44,33 @@ data: brokerWebServiceURLTLS: "https://{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}:8443" {{- end }} {{- end }} - zookeeperServers: + zookeeperServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} - "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281" + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 {{- else }} - "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181" + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} + {{- else }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 + {{- else }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 + {{- end }} {{- end }} configurationStoreServers: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} - "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281" + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2281 {{- else }} - "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181" + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2281 + {{- end }} + {{- else }} + {{- if .Values.extra.zookeepernp }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181,{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca:2181 + {{- else }} + {{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-ca:2181 + {{- end }} {{- end }} {{- if .Values.extra.function }} functionWorkerWebServiceURL: "http://{{ template "pulsar.fullname" . }}-{{ .Values.function.component }}-ca:6750" diff --git a/helm-chart-sources/pulsar/templates/proxy-deployment.yaml b/helm-chart-sources/pulsar/templates/proxy-deployment.yaml index b2500f4..49c747b 100644 --- a/helm-chart-sources/pulsar/templates/proxy-deployment.yaml +++ b/helm-chart-sources/pulsar/templates/proxy-deployment.yaml @@ -178,6 +178,7 @@ spec: emptyDir: {} {{- end }} initContainers: + {{- if .Values.enableWaitContainers }} # This init container will wait for bookkeeper to be ready before # deploying the booproxykies - name: wait-bookkeeper-ready @@ -189,6 +190,7 @@ spec: until nslookup {{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ add (.Values.bookkeeper.replicaCount | int) -1 }}.{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}.{{ .Release.Namespace }}; do sleep 3; done; + {{- end }} {{- if .Values.proxy.initContainer }} - name: add-libs image: "{{ .Values.proxy.initContainer.repository }}:{{ .Values.proxy.initContainer.tag }}" diff --git a/helm-chart-sources/pulsar/templates/proxy-service.yaml b/helm-chart-sources/pulsar/templates/proxy-service.yaml index 8264247..0cb354d 100644 --- a/helm-chart-sources/pulsar/templates/proxy-service.yaml +++ b/helm-chart-sources/pulsar/templates/proxy-service.yaml @@ -45,4 +45,34 @@ spec: app: {{ template "pulsar.name" . }} release: {{ .Release.Name }} component: {{ .Values.proxy.component }} +--- +{{- if .Values.proxy.extraService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}-extra" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.proxy.component }} + cluster: {{ template "pulsar.fullname" . }} + annotations: +{{- if .Values.proxy.extraService.annotations }} +{{ toYaml .Values.proxy.extraService.annotations | indent 4 }} +{{- end }} +{{- if .Values.extra.dnsOnProxy }} + external-dns.alpha.kubernetes.io/hostname: {{ .Values.dnsName }} +{{- end }} +spec: + type: {{ .Values.proxy.extraService.type }} + ports: +{{ toYaml .Values.proxy.extraService.ports | indent 2 }} + selector: + app: {{ template "pulsar.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.proxy.component }} +{{- end }} {{- end }} diff --git a/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeeper-config-script.yaml b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeeper-config-script.yaml new file mode 100644 index 0000000..aec95c2 --- /dev/null +++ b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeeper-config-script.yaml @@ -0,0 +1,48 @@ +{{- if .Values.extra.zookeepernp }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ template "pulsar.fullname" . }}-zookeeper-config" + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: "zookeeper-config" + cluster: {{ template "pulsar.fullname" . }} +data: + generate-zookeeper-config-mixed.sh: | + #! /bin/bash + CONF_FILE=$1 + + if [ $? != 0 ]; then + echo "Error: Failed to apply changes to config file" + exit 1 + fi + + # Generate list of servers and detect the current server ID, + # based on the hostname + IDX=1 + for SERVER in $(echo $ZOOKEEPER_SERVERS | tr "," "\n") + do + echo "server.$IDX=$SERVER:2888:3888" >> $CONF_FILE + + if [[ "$SERVER" == ${HOSTNAME}* ]]; then + MY_ID=$IDX + echo "Current server id $MY_ID" + fi + + ((IDX++)) + done + + # For ZooKeeper container we need to initialize the ZK id + if [ ! -z "$MY_ID" ]; then + # Get ZK data dir + DATA_DIR=`grep '^dataDir=' $CONF_FILE | awk -F= '{print $2}'` + if [ ! -e $DATA_DIR/myid ]; then + echo "Creating $DATA_DIR/myid with id = $MY_ID" + mkdir -p $DATA_DIR + echo $MY_ID > $DATA_DIR/myid + fi + fi +{{- end }} \ No newline at end of file diff --git a/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-configmap.yaml b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-configmap.yaml new file mode 100644 index 0000000..dcc2d89 --- /dev/null +++ b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-configmap.yaml @@ -0,0 +1,24 @@ +{{- if .Values.extra.zookeepernp }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.zookeepernp.component }} + cluster: {{ template "pulsar.fullname" . }} +data: + {{- if and .Values.enableTls .Values.tls.zookeeper.enabled}} + PULSAR_PREFIX_serverCnxnFactory: org.apache.zookeeper.server.NettyServerCnxnFactory + serverCnxnFactory: org.apache.zookeeper.server.NettyServerCnxnFactory + secureClientPort: "2281" + PULSAR_PREFIX_secureClientPort: "2281" + sslQuorum: "true" + PULSAR_PREFIX_sslQuorum: "true" + {{- end }} +{{ toYaml .Values.zookeepernp.configData | indent 2 }} +{{- end }} diff --git a/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-pdb.yaml b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-pdb.yaml new file mode 100644 index 0000000..7bf2701 --- /dev/null +++ b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-pdb.yaml @@ -0,0 +1,23 @@ +{{- if .Values.extra.zookeepernp }} +{{- if .Values.zookeepernp.pdb.usePolicy }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.zookeepernp.component }} + cluster: {{ template "pulsar.fullname" . }} +spec: + selector: + matchLabels: + app: {{ template "pulsar.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.zookeepernp.component }} + maxUnavailable: {{ .Values.zookeepernp.pdb.maxUnavailable }} +{{- end }} +{{- end }} diff --git a/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-service.yaml b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-service.yaml new file mode 100644 index 0000000..c85e5db --- /dev/null +++ b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-service.yaml @@ -0,0 +1,61 @@ +{{- if .Values.extra.zookeepernp }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.zookeepernp.component }} + cluster: {{ template "pulsar.fullname" . }} + annotations: + publishNotReadyAddresses: "true" + service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" + {{- if .Values.zookeepernp.service.annotations }} +{{ toYaml .Values.zookeepernp.service.annotations | indent 4 }} + {{- end }} +spec: + ports: + {{- if and .Values.tlsEnabled .Values.tls.zookeeper.enabled }} + - name: client-tls + port: 2281 + {{- end }} +{{ toYaml .Values.zookeepernp.service.ports | indent 2 }} + clusterIP: None + selector: + app: {{ template "pulsar.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.zookeepernp.component }} + +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-ca" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.zookeepernp.component }} + cluster: {{ template "pulsar.fullname" . }} + annotations: + {{- if .Values.zookeepernp.service.annotations }} +{{ toYaml .Values.zookeepernp.service.annotations | indent 4 }} + {{- end }} +spec: + ports: + {{- if and .Values.tlsEnabled .Values.tls.zookeeper.enabled }} + - name: client-tls + port: 2281 + {{- end }} +{{ toYaml .Values.zookeepernp.service.ports | indent 2 }} + selector: + app: {{ template "pulsar.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.zookeepernp.component }} +{{- end }} diff --git a/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-statefulset.yaml b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-statefulset.yaml new file mode 100644 index 0000000..2abd0df --- /dev/null +++ b/helm-chart-sources/pulsar/templates/zookeeper-nonpersist/zookeepernp-statefulset.yaml @@ -0,0 +1,174 @@ +{{- if .Values.extra.zookeepernp }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "pulsar.name" . }} + chart: {{ template "pulsar.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.zookeepernp.component }} + cluster: {{ template "pulsar.fullname" . }} +spec: + serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + replicas: {{ .Values.zookeepernp.replicaCount }} + selector: + matchLabels: + app: {{ template "pulsar.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.zookeepernp.component }} + updateStrategy: +{{ toYaml .Values.zookeepernp.updateStrategy | indent 4 }} + podManagementPolicy: {{ .Values.zookeepernp.podManagementPolicy }} + template: + metadata: + labels: + app: {{ template "pulsar.name" . }} + release: {{ .Release.Name }} + component: {{ .Values.zookeepernp.component }} + cluster: {{ template "pulsar.fullname" . }} + annotations: + {{- if .Values.restartOnConfigMapChange.enabled }} + checksum/config: {{ include (print $.Template.BasePath "/zookeeper-configmap.yaml") . | sha256sum }} + {{- end }} +{{ toYaml .Values.zookeepernp.annotations | indent 8 }} + spec: + {{- if .Values.priorityClass.enabled }} + priorityClassName: pulsar-priority + {{- end }} + {{- if and (.Values.nodeSelector) (not .Values.zookeepernp.nodeSelector) }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.zookeepernp.nodeSelector }} + nodeSelector: +{{ toYaml .Values.zookeepernp.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.zookeepernp.tolerations }} + tolerations: +{{ toYaml .Values.zookeepernp.tolerations | indent 8 }} + {{- end }} + affinity: + {{- if .Values.zookeepernp.nodeAffinity }} + nodeAffinity: +{{ toYaml .Values.zookeepernp.nodeAffinity | indent 10 }} + {{- end }} + {{- if .Values.enableAntiAffinity }} + podAntiAffinity: + {{- if .Values.antiAffinity.host.enabled }} + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "{{ template "pulsar.name" . }}" + - key: "release" + operator: In + values: + - {{ .Release.Name }} + - key: "component" + operator: In + values: + - {{ .Values.zookeeper.component }} + topologyKey: "kubernetes.io/hostname" + {{- end }} + {{- if .Values.antiAffinity.zone.enabled }} + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + topologyKey: failure-domain.beta.kubernetes.io/zone + labelSelector: + matchExpressions: + - key: "app" + operator: In + values: + - "{{ template "pulsar.name" . }}" + - key: "release" + operator: In + values: + - {{ .Release.Name }} + - key: "component" + operator: In + values: + - {{ .Values.zookeeper.component }} + {{- end }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.zookeepernp.gracePeriod }} + containers: + - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + image: "{{ .Values.image.zookeeper.repository }}:{{ .Values.image.zookeeper.tag }}" + imagePullPolicy: {{ .Values.image.zookeeper.pullPolicy }} + {{- if .Values.zookeepernp.resources }} + resources: +{{ toYaml .Values.zookeepernp.resources | indent 10 }} + {{- end }} + command: ["sh", "-c"] + args: + - > + bin/apply-config-from-env.py conf/zookeeper.conf && + bin/apply-config-from-env.py conf/pulsar_env.sh && + {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} + /pulsar/tools/certconverter.sh && + {{- end }} + /pulsar/zookeeper-config/generate-zookeeper-config-mixed.sh conf/zookeeper.conf && + exec bin/pulsar zookeeper + ports: + - name: client + containerPort: 2181 + - name: server + containerPort: 2888 + - name: leader-election + containerPort: 3888 + env: + - name: ZOOKEEPER_SERVERS + value: + {{ include "pulsar.zkConnectString" . }} + envFrom: + - configMapRef: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}" + {{- if .Values.zookeepernp.probe.enabled }} + readinessProbe: + exec: + command: + - "bin/pulsar-zookeeper-ruok.sh" + initialDelaySeconds: {{ .Values.zookeepernp.probe.initial }} + timeoutSeconds: {{ .Values.zookeepernp.probe.period }} + livenessProbe: + exec: + command: + - "bin/pulsar-zookeeper-ruok.sh" + initialDelaySeconds: {{ .Values.zookeepernp.probe.initial }} + timeoutSeconds: {{ .Values.zookeepernp.probe.period }} + {{- end }} + volumeMounts: + {{- if and .Values.enableTls .Values.tls.zookeeper.enabled}} + - name: certs + readOnly: true + mountPath: /pulsar/certs + - name: certconverter + mountPath: /pulsar/tools + {{- end }} + - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-{{ .Values.zookeepernp.volumes.data.name }}" + mountPath: /pulsar/data + - name: zookeeper-config + mountPath: /pulsar/zookeeper-config + volumes: + {{- if and .Values.enableTls .Values.tls.zookeeper.enabled}} + - name: certs + secret: + secretName: "{{ .Values.tlsSecretName }}" + - name: certconverter + configMap: + name: "{{ template "pulsar.fullname" . }}-certconverter-configmap" + defaultMode: 0755 + {{- end }} + - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeepernp.component }}-{{ .Values.zookeepernp.volumes.data.name }}" + emptyDir: {} + - name: zookeeper-config + configMap: + name: "{{ template "pulsar.fullname" . }}-zookeeper-config" + defaultMode: 0755 +{{- end }} \ No newline at end of file diff --git a/helm-chart-sources/pulsar/templates/zookeeper-configmap.yaml b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-configmap.yaml similarity index 97% rename from helm-chart-sources/pulsar/templates/zookeeper-configmap.yaml rename to helm-chart-sources/pulsar/templates/zookeeper/zookeeper-configmap.yaml index 3493022..8be6812 100644 --- a/helm-chart-sources/pulsar/templates/zookeeper-configmap.yaml +++ b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-configmap.yaml @@ -38,4 +38,5 @@ data: sslQuorum: "true" PULSAR_PREFIX_sslQuorum: "true" {{- end }} + PULSAR_PREFIX_quorumListenOnAllIPs: "true" {{ toYaml .Values.zookeeper.configData | indent 2 }} diff --git a/helm-chart-sources/pulsar/templates/zookeeper-metadata.yaml b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-metadata.yaml similarity index 100% rename from helm-chart-sources/pulsar/templates/zookeeper-metadata.yaml rename to helm-chart-sources/pulsar/templates/zookeeper/zookeeper-metadata.yaml diff --git a/helm-chart-sources/pulsar/templates/zookeeper-pdb.yaml b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-pdb.yaml similarity index 100% rename from helm-chart-sources/pulsar/templates/zookeeper-pdb.yaml rename to helm-chart-sources/pulsar/templates/zookeeper/zookeeper-pdb.yaml diff --git a/helm-chart-sources/pulsar/templates/zookeeper-service.yaml b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-service.yaml similarity index 100% rename from helm-chart-sources/pulsar/templates/zookeeper-service.yaml rename to helm-chart-sources/pulsar/templates/zookeeper/zookeeper-service.yaml diff --git a/helm-chart-sources/pulsar/templates/zookeeper-statefulset.yaml b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-statefulset.yaml similarity index 92% rename from helm-chart-sources/pulsar/templates/zookeeper-statefulset.yaml rename to helm-chart-sources/pulsar/templates/zookeeper/zookeeper-statefulset.yaml index 0ac54e1..3ccd08e 100644 --- a/helm-chart-sources/pulsar/templates/zookeeper-statefulset.yaml +++ b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-statefulset.yaml @@ -131,7 +131,11 @@ spec: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled }} /pulsar/tools/certconverter.sh && {{- end }} + {{- if .Values.extra.zookeepernp }} + /pulsar/zookeeper-config/generate-zookeeper-config-mixed.sh conf/zookeeper.conf && + {{- else }} bin/generate-zookeeper-config.sh conf/zookeeper.conf && + {{- end }} exec bin/pulsar zookeeper ports: - name: client @@ -143,7 +147,11 @@ spec: env: - name: ZOOKEEPER_SERVERS value: + {{- if .Values.extra.zookeepernp }} + {{ include "pulsar.zkConnectString" . }} + {{- else }} {{ include "pulsar.zkServers" . }} + {{- end }} envFrom: - configMapRef: name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}" @@ -171,6 +179,10 @@ spec: {{- end }} - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.data.name }}" mountPath: /pulsar/data + {{- if .Values.extra.zookeepernp }} + - name: zookeeper-config + mountPath: /pulsar/zookeeper-config + {{- end }} volumes: {{- if and .Values.enableTls .Values.tls.zookeeper.enabled}} - name: certs @@ -185,6 +197,12 @@ spec: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.volumes.data.name }}" emptyDir: {} {{- end }} + {{- if .Values.extra.zookeepernp }} + - name: zookeeper-config + configMap: + name: "{{ template "pulsar.fullname" . }}-zookeeper-config" + defaultMode: 0755 + {{- end }} {{- if .Values.persistence }} volumeClaimTemplates: - metadata: diff --git a/helm-chart-sources/pulsar/templates/zookeeper-storageclass.yaml b/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-storageclass.yaml similarity index 100% rename from helm-chart-sources/pulsar/templates/zookeeper-storageclass.yaml rename to helm-chart-sources/pulsar/templates/zookeeper/zookeeper-storageclass.yaml diff --git a/helm-chart-sources/pulsar/templates/zoonavigator-deployment.yaml b/helm-chart-sources/pulsar/templates/zoonavigator/zoonavigator-deployment.yaml similarity index 100% rename from helm-chart-sources/pulsar/templates/zoonavigator-deployment.yaml rename to helm-chart-sources/pulsar/templates/zoonavigator/zoonavigator-deployment.yaml diff --git a/helm-chart-sources/pulsar/templates/zoonavigator-service.yaml b/helm-chart-sources/pulsar/templates/zoonavigator/zoonavigator-service.yaml similarity index 100% rename from helm-chart-sources/pulsar/templates/zoonavigator-service.yaml rename to helm-chart-sources/pulsar/templates/zoonavigator/zoonavigator-service.yaml diff --git a/helm-chart-sources/pulsar/values.yaml b/helm-chart-sources/pulsar/values.yaml index 58ed523..1f59559 100644 --- a/helm-chart-sources/pulsar/values.yaml +++ b/helm-chart-sources/pulsar/values.yaml @@ -37,6 +37,12 @@ prometheus_persistence: yes prometheus_rbac: yes +# Enable initContainers that wait for dependent components to +# be enabled. Provides a graceful initial install. However, it some +# failure scenarios it can prevent containers from starting +# even though they could operate. +enableWaitContainers: yes + # If default_storage is set, that storage class is the default for all # persistent volmes created by the chart. # @@ -220,6 +226,14 @@ extra: # When enabling the standalone function worker, the proxy will be configured # to forward function API calls. # + # ZooKeeper with non-persistent storage + # + # These are extra ZooKeepers that can be used to achieve quorum that + # are not locked to an AZ or host by a PVC requirement + # They can "float" between AZs for quorum in complete AZ failure scenarios + zookeepernp: no + # Standalone function worker + # function: no # Standalone state storage # Note that standalone state storage is experimental and requires a custom @@ -437,6 +451,9 @@ zookeeper: requests: memory: 1Gi cpu: 0.3 + # limits: + # memory: 1Gi + # cpu: 0.3 volumes: data: name: data @@ -464,8 +481,8 @@ zookeeper: ## templates/zookeeper-configmap.yaml ## configData: - PULSAR_MEM: "\"-Xms1g -Xmx1g -Dcom.sun.management.jmxremote -Djute.maxbuffer=10485760 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:+DisableExplicitGC -XX:+PerfDisableSharedMem -Dzookeeper.forceSync=no\"" - PULSAR_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\"" + PULSAR_MEM: "\"-Xms1g -Xmx1g -Dcom.sun.management.jmxremote -Djute.maxbuffer=10485760\"" + PULSAR_GC: "\"-XX:+UseG1GC\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -488,6 +505,76 @@ zookeeper: usePolicy: yes maxUnavailable: 1 +## Pulsar: Zookeeper cluster non persistent storage +## Used as floating Zookeeper to maintain quorum in AZ failures +## templates/zookeepernp-statefulset.yaml +## +zookeepernp: + component: zookeepernp + # Keep count at 0 unless you are using the non-persistent zookeeper + replicaCount: 0 + updateStrategy: + type: RollingUpdate + podManagementPolicy: OrderedReady + # nodeSelector: + # cloud.google.com/gke-nodepool: default-pool + # nodeAffinity: + # preferredDuringSchedulingIgnoredDuringExecution: + # - weight: 1 + # preference: + # matchExpressions: + # - key: failure-domain.beta.kubernetes.io/region + # operator: In + # values: + # - region1 + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" + tolerations: [] + gracePeriod: 60 + probe: + enabled: yes + initial: 10 + period: 30 + resources: + requests: + memory: 1Gi + cpu: 0.3 + # limits: + # memory: 1Gi + # cpu: 0.3 + # Volume is emptyDir + volumes: + data: + name: data + ## Zookeeper configmap + ## templates/zookeepernp-configmap.yaml + ## + configData: + PULSAR_MEM: "\"-Xms1g -Xmx1g -Dcom.sun.management.jmxremote -Djute.maxbuffer=10485760\"" + PULSAR_GC: "\"-XX:+UseG1GC\"" + PULSAR_LOG_LEVEL: "info" + PULSAR_LOG_ROOT_LEVEL: "info" + PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" + ## Zookeeper service + ## templates/zookeepernp-service.yaml + ## + service: + annotations: + ports: + - name: server + port: 2888 + - name: leader-election + port: 3888 + - name: client + port: 2181 + ## Zookeeper PodDisruptionBudget + ## templates/zookeepernp-pdb.yaml + ## + pdb: + usePolicy: yes + maxUnavailable: 1 + ## Pulsar Zookeeper metadata. The metadata will be deployed as ## soon as the las zookeeper node is reachable. The deployment ## of other components that depends on zookeeper, such as the @@ -531,6 +618,9 @@ bookkeeper: requests: memory: 2Gi cpu: 1 + # limits: + # memory: 2Gi + # cpu: 1 volumes: journal: name: journal @@ -607,8 +697,8 @@ bookkeeper: ## templates/bookkeeper-configmap.yaml ## configData: - BOOKIE_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -verbosegc -XX:G1LogLevel=finest\"" - BOOKIE_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\"" + BOOKIE_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ExitOnOutOfMemoryError\"" + BOOKIE_GC: "\"-XX:+UseG1GC\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -669,6 +759,9 @@ broker: requests: memory: 2Gi cpu: 1 + # limits: + # memory: 2Gi + # cpu: 1 # Init container to add files to image initContainer: {} # initContainer: @@ -682,8 +775,8 @@ broker: ## templates/broker-configmap.yaml ## configData: - PULSAR_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem\"" - PULSAR_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\"" + PULSAR_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ExitOnOutOfMemoryError\"" + PULSAR_GC: "\"-XX:+UseG1GC\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -763,6 +856,9 @@ brokerSts: requests: memory: 2Gi cpu: 1 + # limits: + # memory: 2Gi + # cpu: 1 # Init container to add files to image initContainer: {} # initContainer: @@ -776,8 +872,8 @@ brokerSts: ## templates/broker-configmap.yaml ## configData: - PULSAR_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem\"" - PULSAR_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\"" + PULSAR_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ExitOnOutOfMemoryError\"" + PULSAR_GC: "\"-XX:+UseG1GC\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -836,6 +932,10 @@ function: period: 30 # Only the process runtime has been tested with this chart runtime: "process" + k8sMinResources: + cpu: "0.1" + ram: "307200000" + disk: "10737418240" # If state storage is enabled state storage will be enabled on Bookkeeper and the # function workers will connect to BookKeeper by default. # If you enable standalone state storage (extra.stateStorage), the function workers will @@ -862,6 +962,9 @@ function: requests: memory: 4Gi cpu: 1 + # limits: + # memory: 4Gi + # cpu: 1 volumes: data: name: logs @@ -899,8 +1002,8 @@ function: ## templates/function-configmap.yaml ## configData: - PULSAR_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem\"" - PULSAR_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\"" + PULSAR_MEM: "\"-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -XX:+ExitOnOutOfMemoryError\"" + PULSAR_GC: "\"-XX:+UseG1GC\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -1023,6 +1126,9 @@ stateStorage: requests: memory: 1Gi cpu: 0.5 + # limits: + # memory: 1Gi + # cpu: 0.5 volumes: data: name: data @@ -1106,11 +1212,17 @@ proxy: requests: memory: 1Gi cpu: 1 + # limits: + # memory: 1Gi + # cpu: 1 # Resources for the websocket proxy wsResources: requests: memory: 1Gi cpu: 1 + # limits: + # memory: 1Gi + # cpu: 1 # Init container to add files to image initContainer: {} # initContainer: @@ -1186,6 +1298,22 @@ proxy: port: 8000 protocol: TCP + # For creating and extra service pointing to the proxy + extraService: + enabled: no + annotations: {} + type: ClusterIP + ports: + - name: http + port: 8080 + protocol: TCP + - name: pulsar + port: 6650 + protocol: TCP + - name: ws + port: 8000 + protocol: TCP + ingress: enabled: no host: admin.host.com @@ -1243,11 +1371,14 @@ autoRecovery: requests: memory: 512Mi cpu: 0.3 + # limits: + # memory: 512Mi + # cpu: 0.3 ## Bookkeeper auto-recovery configmap ## templates/autorecovery-configmap.yaml ## configData: - BOOKIE_MEM: "\" -Xms512m -Xmx512m \"" + BOOKIE_MEM: "\" -Xms512m -Xmx512m -XX:+ExitOnOutOfMemoryError\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -1307,6 +1438,9 @@ pulsarexpress: requests: memory: 250Mi cpu: 0.1 + # limits: + # memory: 250Mi + # cpu: 0.1 configData: {} ## Pulsar Express service ## templates/pulsarexpress-service.yaml @@ -1398,7 +1532,7 @@ bastion: ## templates/bastion-configmap.yaml ## configData: - PULSAR_MEM: "\"-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m\"" + PULSAR_MEM: "\"-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m -XX:+ExitOnOutOfMemoryError\"" PULSAR_LOG_LEVEL: "info" PULSAR_LOG_ROOT_LEVEL: "info" PULSAR_EXTRA_OPTS: "-Dpulsar.log.root.level=info" @@ -1415,6 +1549,9 @@ pulsarBeam: requests: memory: 256Mi cpu: 0.5 + # limits: + # memory: 256Mi + # cpu: 0.5 annotations: {} tolerations: [] gracePeriod: 60 diff --git a/helm-chart-sources/teleport/templates/priorityclass.yaml b/helm-chart-sources/teleport/templates/priorityclass.yaml index 79acdbd..06442ac 100644 --- a/helm-chart-sources/teleport/templates/priorityclass.yaml +++ b/helm-chart-sources/teleport/templates/priorityclass.yaml @@ -1,3 +1,4 @@ +{{- if .Values.rbac.create -}} {{- if .Values.highPriority.enabled }} apiVersion: scheduling.k8s.io/v1beta1 kind: PriorityClass @@ -7,3 +8,4 @@ value: 1000000 globalDefault: false description: "This priority class should be used for Teleport pods only." {{- end }} +{{- end }}