Skip to content

[#443] add persistence to example datagrid as an option #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/hono/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: hono
description: |
Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and
interacting with them in a uniform way regardless of the device communication protocol.
version: 2.2.1
version: 2.2.2
# Version of Hono being deployed by the chart
appVersion: 2.2.0
keywords:
Expand Down
13 changes: 13 additions & 0 deletions charts/hono/config/infinispan/hono-data-grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,20 @@
<security>
<authorization enabled="true" />
</security>
{{- if .Values.dataGridExample.persistence.enabled }}
<persistence passivation="false">
<file-store>
<index path="/opt/infinispan/server/data/index" />
<data path="/opt/infinispan/server/data/data" />
</file-store>
</persistence>
{{- end }}
</distributed-cache>
{{- if .Values.dataGridExample.persistence.enabled }}
<global-state>
<persistent-location path="/opt/infinispan/server/data"/>
</global-state>
{{- end }}
</cache-container>

<server xmlns="urn:infinispan:server:13.0">
Expand Down
13 changes: 13 additions & 0 deletions charts/hono/templates/example-data-grid/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.dataGridExample.persistence.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
{{- $args := dict "dot" . "component" "data-grid" "name" "data-grid-pvc" }}
{{- include "hono.metadata" $args | nindent 2 }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.dataGridExample.persistence.pvcSize }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/hono/templates/example-data-grid/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
name: conf
subPath: mgmt-groups.properties
readOnly: true
{{- if .Values.dataGridExample.persistence.enabled }}
- name: storage
mountPath: /opt/infinispan/server/data
{{- end}}
{{- include "hono.component.healthChecks" $args | nindent 8 }}
{{- with .Values.dataGridExample.resources }}
resources:
Expand All @@ -75,4 +79,10 @@ spec:
- name: conf
configMap:
name: {{ printf "%s-%s-conf" .Release.Name $args.name }}
{{- if .Values.dataGridExample.persistence.enabled }}
- name: storage
persistentVolumeClaim:
claimName: {{ printf "%s-%s-pvc" .Release.Name $args.name | quote }}
{{- end}}

{{- end }}
7 changes: 7 additions & 0 deletions charts/hono/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,13 @@ dataGridExample:
# dataMaxSize contains the maximum size of off-heap memory used for storing data per Infinispan node
dataMaxSize: "30 MB"

# persistence contains configuration on the dataGrid persitence settings.
persistence:
# enabled defines whether or not persistence is enabled for the example dataGrid
enabled: false
# pvcSize determines the size of the pvc created to write the cache data to
pvcSize: "100M"

jaegerBackendExample:

# enabled indicates whether the example Jaeger all-in-one
Expand Down