Skip to content

Commit dd436e8

Browse files
author
Bob Claerhout
committed
[#443] add persistence to example datagrid as an option
Signed-off-by: Bob Claerhout <bob.claerhout@aloxy.io>
1 parent 5d01696 commit dd436e8

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed

charts/hono/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ name: hono
1515
description: |
1616
Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and
1717
interacting with them in a uniform way regardless of the device communication protocol.
18-
version: 2.2.1
18+
version: 2.2.2
1919
# Version of Hono being deployed by the chart
2020
appVersion: 2.2.0
2121
keywords:

charts/hono/config/infinispan/hono-data-grid.xml

+13
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@
3838
<security>
3939
<authorization enabled="true" />
4040
</security>
41+
{{- if .Values.dataGridExample.persistence.enabled }}
42+
<persistence passivation="false">
43+
<file-store>
44+
<index path="/opt/infinispan/server/data/index" />
45+
<data path="/opt/infinispan/server/data/data" />
46+
</file-store>
47+
</persistence>
48+
{{- end }}
4149
</distributed-cache>
50+
{{- if .Values.dataGridExample.persistence.enabled }}
51+
<global-state>
52+
<persistent-location path="/opt/infinispan/server/data"/>
53+
</global-state>
54+
{{- end }}
4255
</cache-container>
4356

4457
<server xmlns="urn:infinispan:server:13.0">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.dataGridExample.persistence.enabled -}}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
{{- $args := dict "dot" . "component" "data-grid" "name" "data-grid-pvc" }}
6+
{{- include "hono.metadata" $args | nindent 2 }}
7+
spec:
8+
accessModes:
9+
- ReadWriteOnce
10+
resources:
11+
requests:
12+
storage: {{ .Values.dataGridExample.persistence.pvcSize }}
13+
{{- end }}

charts/hono/templates/example-data-grid/statefulset.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ spec:
6565
name: conf
6666
subPath: mgmt-groups.properties
6767
readOnly: true
68+
{{- if .Values.dataGridExample.persistence.enabled }}
69+
- name: storage
70+
mountPath: /opt/infinispan/server/data
71+
{{- end}}
6872
{{- include "hono.component.healthChecks" $args | nindent 8 }}
6973
{{- with .Values.dataGridExample.resources }}
7074
resources:
@@ -75,4 +79,10 @@ spec:
7579
- name: conf
7680
configMap:
7781
name: {{ printf "%s-%s-conf" .Release.Name $args.name }}
82+
{{- if .Values.dataGridExample.persistence.enabled }}
83+
- name: storage
84+
persistentVolumeClaim:
85+
claimName: {{ printf "%s-%s-pvc" .Release.Name $args.name | quote }}
86+
{{- end}}
87+
7888
{{- end }}

charts/hono/values.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,13 @@ dataGridExample:
19831983
# dataMaxSize contains the maximum size of off-heap memory used for storing data per Infinispan node
19841984
dataMaxSize: "30 MB"
19851985

1986+
# persistence contains configuration on the dataGrid persitence settings.
1987+
persistence:
1988+
# enabled defines whether or not persistence is enabled for the example dataGrid
1989+
enabled: false
1990+
# pvcSize determines the size of the pvc created to write the cache data to
1991+
pvcSize: "100M"
1992+
19861993
jaegerBackendExample:
19871994

19881995
# enabled indicates whether the example Jaeger all-in-one

0 commit comments

Comments
 (0)