Skip to content
Merged
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
17 changes: 17 additions & 0 deletions charts/arcadedb/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ spec:
- name: arcadedb-data
mountPath: {{ .Values.arcadedb.databaseDirectory }}
{{- end }}
{{- if .Values.persistence.config.enabled }}
- name: arcadedb-config
mountPath: {{ .Values.arcadedb.configDirectory }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The mountPath is configurable via .Values.arcadedb.configDirectory, but the ArcadeDB process is not informed of this custom path in the command section. If a user overrides this value, the volume will be mounted at the new path, but the application will still look for configuration in the default /home/arcadedb/config directory. To support custom paths, the -Darcadedb.server.configurationDirectory property should be added to the container's command in templates/statefulset.yaml.

{{- end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -142,6 +146,19 @@ spec:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}
{{- if .Values.persistence.config.enabled }}
- metadata:
name: arcadedb-config
spec:
accessModes:
- {{ .Values.persistence.config.accessMode }}
{{- if .Values.persistence.config.storageClass }}
storageClassName: {{ .Values.persistence.config.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.config.size }}
{{- end }}
{{- with .Values.volumeClaimTemplates }}
{{- toYaml . | nindent 4 }}
{{- end }}
102 changes: 102 additions & 0 deletions charts/arcadedb/tests/statefulset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,105 @@ tests:
- contains:
path: spec.template.spec.containers[0].command
content: "-Darcadedb.server.defaultDatabases=Universe[admin:pwd]"

# ── config persistence ──────────────────────────────────────────────────────

- it: config persistence disabled by default — no config volumeMount or VCT
asserts:
- notContains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: arcadedb-config
mountPath: /home/arcadedb/config
- notExists:
path: spec.volumeClaimTemplates[1]

- it: config persistence enabled renders volumeMount at configDirectory
set:
persistence.config.enabled: true
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: arcadedb-config
mountPath: /home/arcadedb/config

- it: config persistence enabled renders VolumeClaimTemplate for arcadedb-config
set:
persistence.config.enabled: true
asserts:
- contains:
path: spec.volumeClaimTemplates
content:
metadata:
name: arcadedb-config
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi

- it: config persistence size override flows through
set:
persistence.config.enabled: true
persistence.config.size: 5Gi
asserts:
- equal:
path: spec.volumeClaimTemplates[1].spec.resources.requests.storage
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test assertions use hardcoded indices (e.g., spec.volumeClaimTemplates[1]) to verify the configuration PVC. This makes the tests fragile as they depend on the default state of other persistence settings (like persistence.enabled). If the default values change or if other volumes are added, these tests will fail. Consider using assertions that match by name or check the entire list for the expected object.

      - contains:
          path: spec.volumeClaimTemplates
          content:
            metadata:
              name: arcadedb-config
            spec:
              resources:
                requests:
                  storage: 5Gi

value: 5Gi

- it: config persistence storageClass override flows through
set:
persistence.config.enabled: true
persistence.config.storageClass: fast-ssd
asserts:
- equal:
path: spec.volumeClaimTemplates[1].spec.storageClassName
value: fast-ssd

- it: config persistence accessMode override flows through
set:
persistence.config.enabled: true
persistence.config.accessMode: ReadWriteMany
asserts:
- equal:
path: spec.volumeClaimTemplates[1].spec.accessModes[0]
value: ReadWriteMany

- it: arcadedb.configDirectory override flows through to config volumeMount mountPath
set:
persistence.config.enabled: true
arcadedb.configDirectory: /custom/config
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: arcadedb-config
mountPath: /custom/config

- it: config VCT is second entry after data VCT when both persistence flags enabled
set:
persistence.config.enabled: true
asserts:
- equal:
path: spec.volumeClaimTemplates[0].metadata.name
value: arcadedb-data
- equal:
path: spec.volumeClaimTemplates[1].metadata.name
value: arcadedb-config

- it: config persistence enabled with data persistence disabled still renders config VCT
set:
persistence.enabled: false
persistence.config.enabled: true
asserts:
- contains:
path: spec.volumeClaimTemplates
content:
metadata:
name: arcadedb-config
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi
15 changes: 15 additions & 0 deletions charts/arcadedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ replicaCount: 1
arcadedb:
## @param arcadedb.databaseDirectory Database storage directory inside the container
databaseDirectory: "/home/arcadedb/databases"
## @param arcadedb.configDirectory Config storage directory inside the container (users, tokens, server settings)
configDirectory: "/home/arcadedb/config"
## @param arcadedb.defaultDatabases Databases to create at startup. Empty = none.
## Example: "Universe[admin:password]"
defaultDatabases: ""
Expand Down Expand Up @@ -182,6 +184,19 @@ persistence:
## @param persistence.storageClass StorageClass name. Empty = cluster default.
storageClass: ""

## @section persistence.config
## Persist the config directory (users, tokens, server settings).
## Without this, configured users and tokens are lost on pod restart.
config:
## @param persistence.config.enabled Persist the config directory with a separate PVC.
enabled: false
## @param persistence.config.size PVC size for the config directory
size: 1Gi
## @param persistence.config.accessMode PVC access mode for config
accessMode: ReadWriteOnce
## @param persistence.config.storageClass StorageClass name for config PVC. Empty = cluster default.
storageClass: ""

## @param volumes Additional pod volumes
volumes: []
# - name: arcadedb-config
Expand Down