Created
September 1, 2017 19:37
-
-
Save grampelberg/7c2b77a0f5c031d9d9e9cd83d7208015 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{{ $quorum := (add1 (div (int .Values.bookkeeper.replicaCount) 2)) }} | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: {{ template "fullname" . }} | |
labels: | |
{{ include "labels" . | indent 4 }} | |
annotations: | |
"helm.sh/hook": post-install | |
"helm.sh/hook-weight": "1" | |
spec: | |
template: | |
metadata: | |
name: {{ template "fullname" . }} | |
labels: | |
{{ include "labels" . | indent 8 }} | |
job: "true" | |
spec: | |
restartPolicy: Never | |
containers: | |
- name: cluster-init | |
image: {{ .Values.image.registry }}streamlio/pulsar:{{ .Values.image.tag }} | |
command: ["sh", "-c"] | |
args: | |
- > | |
set -x; bin/apply-config-from-env.py conf/client.conf && bin/pulsar-admin \ | |
properties create prop --admin-roles admin \ | |
--allowed-clusters {{ .Release.Name }} \ | |
&& bin/pulsar-admin clusters create \ | |
--broker-url ${brokerServiceUrl} \ | |
--url ${webServiceUrl} {{ .Release.Name }} \ | |
&& bin/pulsar-admin namespaces create {{ template "namespace" . }} \ | |
--bundles 16 \ | |
&& bin/pulsar-admin namespaces set-persistence {{ template "namespace" . }}\ | |
--bookkeeper-ensemble {{ .Values.bookkeeper.replicaCount }} \ | |
--bookkeeper-write-quorum {{ $quorum }} \ | |
--bookkeeper-ack-quorum {{ $quorum }} \ | |
--ml-mark-delete-max-rate 0 | |
env: | |
- name: brokerServiceUrl | |
value: pulsar://{{ template "fullname" . }}:6650/ | |
- name: webServiceUrl | |
value: http://{{ template "fullname" . }}:8080/ | |
initContainers: | |
- name: wait-for-ready | |
image: {{ .Values.image.registry }}groundnuty/k8s-wait-for:{{ .Values.wait.tag }} | |
args: | |
- pod | |
- -lapp={{ template "name" . }},release={{ .Release.Name }},job!=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment