Skip to content

Commit

Permalink
[#443] add persistence to example datagrid as an option
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Claerhout <[email protected]>
  • Loading branch information
Bob Claerhout committed Jan 11, 2023
1 parent 5d01696 commit d88dbc4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
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 }}
8 changes: 8 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,8 @@ spec:
name: conf
subPath: mgmt-groups.properties
readOnly: true
- name: storage
mountPath: /opt/infinispan/server/data
{{- include "hono.component.healthChecks" $args | nindent 8 }}
{{- with .Values.dataGridExample.resources }}
resources:
Expand All @@ -75,4 +77,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

0 comments on commit d88dbc4

Please sign in to comment.