Skip to content

Commit 0918828

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 0918828

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-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

+8
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ spec:
6565
name: conf
6666
subPath: mgmt-groups.properties
6767
readOnly: true
68+
- name: storage
69+
mountPath: /opt/infinispan/server/data
6870
{{- include "hono.component.healthChecks" $args | nindent 8 }}
6971
{{- with .Values.dataGridExample.resources }}
7072
resources:
@@ -75,4 +77,10 @@ spec:
7577
- name: conf
7678
configMap:
7779
name: {{ printf "%s-%s-conf" .Release.Name $args.name }}
80+
{{- if .Values.dataGridExample.persistence.enabled }}
81+
- name: storage
82+
persistentVolumeClaim:
83+
claimName: {{ printf "%s-%s-pvc" .Release.Name $args.name | quote }}
84+
{{- end}}
85+
7886
{{- 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)