@@ -212,6 +212,18 @@ spec:
212212 nohup /pulsar/bin/certs-combine-pem-infinity.sh /pulsar/certs/cacerts/ca-combined.pem {{ template "pulsar.certs.cacerts" (dict "certs" .Values.tls.bookie.cacerts.certs) }} > /pulsar/certs/cacerts/certs-combine-pem-infinity.log 2>&1 &
213213 cd /pulsar;
214214 {{- end }}
215+ {{- $indexDirs := include "pulsar.bookkeeper.indexDirectories" . -}}
216+ {{- if $indexDirs }}
217+ INDEX_DIRS={{ $indexDirs | quote }}
218+ if [ -n "$INDEX_DIRS" ]; then
219+ oldIFS=$IFS
220+ IFS=','
221+ for dir in $INDEX_DIRS; do
222+ mkdir -p "$dir"
223+ done
224+ IFS=$oldIFS
225+ fi
226+ {{- end }}
215227 bin/apply-config-from-env.py conf/bookkeeper.conf;
216228 {{- include "pulsar.bookkeeper.zookeeper.tls.settings" . | nindent 10 }}
217229 OPTS="${OPTS} -Dlog4j2.formatMsgNoLookups=true" exec bin/pulsar bookie;
@@ -227,6 +239,10 @@ spec:
227239 {{- if .Values.bookkeeper.volumes.useSingleCommonVolume }}
228240 - name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.common.name }}"
229241 mountPath : /pulsar/data/bookkeeper
242+ {{- if .Values.bookkeeper.volumes.index.enabled }}
243+ - name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
244+ mountPath : {{ .Values.bookkeeper.volumes.index.mountPath }}
245+ {{- end }}
230246 {{- else }}
231247 {{- if .Values.bookkeeper.volumes.journal.useMultiVolumes }}
232248 {{- $fullname := include "pulsar.fullname" . -}}
@@ -250,6 +266,10 @@ spec:
250266 - name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.ledgers.name }}"
251267 mountPath : /pulsar/data/bookkeeper/ledgers
252268 {{- end }}
269+ {{- if .Values.bookkeeper.volumes.index.enabled }}
270+ - name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
271+ mountPath : {{ .Values.bookkeeper.volumes.index.mountPath }}
272+ {{- end }}
253273 {{- end }}
254274 {{- if .Values.bookkeeper.extraVolumeMounts }}
255275{{ toYaml .Values.bookkeeper.extraVolumeMounts | indent 8 }}
@@ -261,6 +281,10 @@ spec:
261281 emptyDir : {}
262282 - name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.ledgers.name }}"
263283 emptyDir : {}
284+ {{- if .Values.bookkeeper.volumes.index.enabled }}
285+ - name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
286+ emptyDir : {}
287+ {{- end }}
264288 {{- end }}
265289 {{- include "pulsar.bookkeeper.certs.volumes" . | nindent 6 }}
266290 {{- if .Values.bookkeeper.extraVolumes }}
@@ -288,6 +312,26 @@ spec:
288312 selector :
289313 {{- toYaml . | nindent 10 }}
290314 {{- end }}
315+ {{- if .Values.bookkeeper.volumes.index.enabled }}
316+ - metadata :
317+ name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
318+ spec :
319+ accessModes : [ "ReadWriteOnce" ]
320+ resources :
321+ requests :
322+ storage : {{ .Values.bookkeeper.volumes.index.size }}
323+ {{- if .Values.bookkeeper.volumes.index.storageClassName }}
324+ storageClassName : " {{ .Values.bookkeeper.volumes.index.storageClassName }}"
325+ {{- else if and (not (and .Values.volumes.local_storage .Values.bookkeeper.volumes.index.local_storage)) .Values.bookkeeper.volumes.index.storageClass }}
326+ storageClassName : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
327+ {{- else if and .Values.volumes.local_storage .Values.bookkeeper.volumes.index.local_storage }}
328+ storageClassName : " local-storage"
329+ {{- end }}
330+ {{- with .Values.bookkeeper.volumes.index.selector }}
331+ selector :
332+ {{- toYaml . | nindent 10 }}
333+ {{- end }}
334+ {{- end }}
291335 {{- else }}
292336 {{- if .Values.bookkeeper.volumes.journal.useMultiVolumes }}
293337 {{- $fullname := include "pulsar.fullname" . -}}
@@ -367,6 +411,26 @@ spec:
367411 {{- toYaml . | nindent 8 }}
368412 {{- end }}
369413 {{- end }}
414+ {{- if .Values.bookkeeper.volumes.index.enabled }}
415+ - metadata :
416+ name : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
417+ spec :
418+ accessModes : [ "ReadWriteOnce" ]
419+ resources :
420+ requests :
421+ storage : {{ .Values.bookkeeper.volumes.index.size }}
422+ {{- if .Values.bookkeeper.volumes.index.storageClassName }}
423+ storageClassName : " {{ .Values.bookkeeper.volumes.index.storageClassName }}"
424+ {{- else if and (not (and .Values.volumes.local_storage .Values.bookkeeper.volumes.index.local_storage)) .Values.bookkeeper.volumes.index.storageClass }}
425+ storageClassName : " {{ template " pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.index.name }}"
426+ {{- else if and .Values.volumes.local_storage .Values.bookkeeper.volumes.index.local_storage }}
427+ storageClassName : " local-storage"
428+ {{- end }}
429+ {{- with .Values.bookkeeper.volumes.index.selector }}
430+ selector :
431+ {{- toYaml . | nindent 8 }}
432+ {{- end }}
433+ {{- end }}
370434 {{- end }}
371435{{- end }}
372436{{- end }}
0 commit comments