Skip to content

Commit

Permalink
Enable persistence for pulsar-manager (#343)
Browse files Browse the repository at this point in the history
* Enable persistence for pulsar-manager

* Upgrade to v0.4.0 version of pulsar-manager to get required fix

- contains apache/pulsar-manager#501
  in https://github.com/apache/pulsar-manager/releases/tag/v0.4.0

---------

Co-authored-by: Victor Fauth <[email protected]>
Co-authored-by: Lari Hotari <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent ad65ac9 commit 29ea17b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

{{- if or .Values.components.pulsar_manager .Values.extra.pulsar_manager }}
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.pulsar_manager.component }}
spec:
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}"
replicas: 1
selector:
matchLabels:
Expand Down Expand Up @@ -66,7 +67,7 @@ spec:
- containerPort: {{ .Values.pulsar_manager.service.targetPort }}
- containerPort: {{ .Values.pulsar_manager.adminService.targetPort }}
volumeMounts:
- name: pulsar-manager-data
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-{{ .Values.pulsar_manager.volumes.data.name }}"
mountPath: /data
envFrom:
- configMapRef:
Expand All @@ -86,9 +87,30 @@ spec:
key: DB_PASSWORD
- name: PULSAR_MANAGER_OPTS
value: "$(PULSAR_MANAGER_OPTS) -Dlog4j2.formatMsgNoLookups=true"
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- include "pulsar.imagePullSecrets" . | nindent 6 }}
volumes:
- name: pulsar-manager-data
emptyDir: {}

{{- if not (and (and .Values.persistence .Values.volumes.persistence) .Values.pulsar_manager.volumes.persistence) }}
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-{{ .Values.pulsar_manager.volumes.data.name }}"
emptyDir: {}
{{- end }}
{{- if and (and .Values.persistence .Values.volumes.persistence) .Values.pulsar_manager.volumes.persistence }}
volumeClaimTemplates:
- metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-{{ .Values.pulsar_manager.volumes.data.name }}"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ .Values.pulsar_manager.volumes.data.size }}
{{- if .Values.pulsar_manager.volumes.data.storageClassName }}
storageClassName: "{{ .Values.pulsar_manager.volumes.data.storageClassName }}"
{{- else if and .Values.volumes.local_storage .Values.pulsar_manager.volumes.data.local_storage }}
storageClassName: "local-storage"
{{- end }}
{{- with .Values.pulsar_manager.volumes.data.selector }}
selector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

{{- end }}
17 changes: 16 additions & 1 deletion charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ images:
tag:
pulsar_manager:
repository: apachepulsar/pulsar-manager
tag: v0.3.0
tag: v0.4.0
pullPolicy: IfNotPresent
hasCommand: false

Expand Down Expand Up @@ -1319,6 +1319,21 @@ pulsar_manager:
# however, feel free to overwrite them
SPRING_CONFIGURATION_FILE: "/pulsar-manager/pulsar-manager/application.properties"
PULSAR_MANAGER_OPTS: " -Dlog4j2.formatMsgNoLookups=true"
volumes:
# use a persistent volume or emptyDir
persistence: true
data:
name: data
size: 128Mi
local_storage: true
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class,
## If you want to bind static persistent volumes via selectors, e.g.:
# selector:
# matchLabels:
# app: pulsar-bookkeeper-journal
selector: {}
## Pulsar manager service
## templates/pulsar-manager-service.yaml
##
Expand Down

0 comments on commit 29ea17b

Please sign in to comment.