From a310a86e04393c54cf698bcf036890cdcf26f450 Mon Sep 17 00:00:00 2001 From: Camillo Rossi Date: Tue, 28 Jan 2025 00:02:12 +1100 Subject: [PATCH] Add userStorageAccessMode for UserClaim to the standalone chart (#95) --- charts/memgraph/README.md | 133 +++++++++++---------- charts/memgraph/templates/statefulset.yaml | 2 +- charts/memgraph/values.yaml | 1 + 3 files changed, 71 insertions(+), 65 deletions(-) diff --git a/charts/memgraph/README.md b/charts/memgraph/README.md index d9bfa81..fe4946e 100644 --- a/charts/memgraph/README.md +++ b/charts/memgraph/README.md @@ -22,70 +22,75 @@ helm install memgraph/memgraph -f values.yaml The following table lists the configurable parameters of the Memgraph chart and their default values. -| Parameter | Description | Default | -| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -| `image.repository` | Memgraph Docker image repository | `memgraph/memgraph` | -| `image.tag` | Specific tag for the Memgraph Docker image. Overrides the image tag whose default is chart version. | `""` (Defaults to chart's app version) | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `useImagePullSecrets` | Override the default imagePullSecrets | `false` | -| `imagePullSecrets` | Specify image pull secrets | `- name: regcred` | -| `replicaCount` | Number of Memgraph instances to run. Note: no replication or HA support. | `1` | -| `affinity.nodeKey` | Key for node affinity (Preferred) | `""` | -| `affinity.nodeValue` | Value for node affinity (Preferred) | `""` | -| `nodeSelector` | Constrain which nodes your Memgraph pod is eligible to be scheduled on, based on the labels on the nodes. Left empty by default. | `{}` | -| `service.type` | Kubernetes service type | `ClusterIP` | -| `service.enableBolt` | Enable Bolt protocol | `true` | -| `service.boltPort` | Bolt protocol port | `7687` | -| `service.boltProtocol` | Protocol used by Bolt | `TCP` | -| `service.enableWebsocketMonitoring` | Enable WebSocket monitoring | `false` | -| `service.websocketPortMonitoring` | WebSocket monitoring port | `7444` | -| `service.websocketPortMonitoringProtocol` | Protocol used by WebSocket monitoring | `TCP` | -| `service.enableHttpMonitoring` | Enable HTTP monitoring | `false` | -| `service.httpPortMonitoring` | HTTP monitoring port | `9091` | -| `service.httpPortMonitoringProtocol` | Protocol used by HTTP monitoring | `http` | -| `service.annotations` | Annotations to add to the service | `{}` | -| `persistentVolumeClaim.createStorageClaim` | Enable creation of a Persistent Volume Claim for storage | `true` | -| `persistentVolumeClaim.storageClassName` | Storage class name for the persistent volume claim | `""` | -| `persistentVolumeClaim.storageSize` | Size of the persistent volume claim for storage | `10Gi` | -| `persistentVolumeClaim.existingClaim` | Use an existing Persistent Volume Claim | `memgraph-0` | -| `persistentVolumeClaim.storageVolumeName` | Name of an existing Volume to create a PVC for | `""` | -| `persistentVolumeClaim.createLogStorage` | Enable creation of a Persistent Volume Claim for logs | `true` | -| `persistentVolumeClaim.logStorageClassName` | Storage class name for the persistent volume claim for logs | `""` | -| `persistentVolumeClaim.logStorageSize` | Size of the persistent volume claim for logs | `1Gi` | -| `memgraphConfig` | List of strings defining Memgraph configuration settings | `["--also-log-to-stderr=true"]` | -| `secrets.enabled` | Enable the use of Kubernetes secrets for Memgraph credentials | `false` | -| `secrets.name` | The name of the Kubernetes secret containing Memgraph credentials | `memgraph-secrets` | -| `secrets.userKey` | The key in the Kubernetes secret for the Memgraph user, the value is passed to the `MEMGRAPH_USER` env | `USER` | -| `secrets.passwordKey` | The key in the Kubernetes secret for the Memgraph password, the value is passed to the `MEMGRAPH_PASSWORD` | `PASSWORD` | -| `memgraphEnterpriseLicense` | Memgraph Enterprise License | `""` | -| `memgraphOrganizationName` | Organization name for Memgraph Enterprise License | `""` | -| `statefulSetAnnotations` | Annotations to add to the stateful set | `{}` | -| `podAnnotations` | Annotations to add to the pod | `{}` | -| `resources` | CPU/Memory resource requests/limits. Left empty by default. | `{}` | -| `tolerations` | A toleration is applied to a pod and allows the pod to be scheduled on nodes with matching taints. Left empty by default. | `[]` | -| `serviceAccount.create` | Specifies whether a service account should be created | `true` | -| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | -| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated. | `""` | -| `container.terminationGracePeriodSeconds` | Grace period for pod termination | `1800` | -| `probes.liveliness.initialDelaySeconds` | Initial delay for liveliness probe | `10` | -| `probes.liveliness.periodSeconds` | Period seconds for liveliness probe | `60` | -| `probes.liveliness.failureThreshold` | Failure threshold for liveliness probe | `3` | -| `probes.readiness.initialDelaySeconds` | Initial delay for readiness probe | `10` | -| `probes.readiness.periodSeconds` | Period seconds for readiness probe | `30` | -| `probes.readiness.failureThreshold` | Failure threshold for readiness probe | `3` | -| `probes.startup.initialDelaySeconds` | Initial delay for startup probe | `10` | -| `probes.startup.periodSeconds` | Period seconds for startup probe | `10` | -| `probes.startup.failureThreshold` | Failure threshold for startup probe | `30` | -| `nodeSelectors` | Node selectors for pod. Left empty by default. | `{}` | -| `customQueryModules` | List of custom Query modules that should be mounted to Memgraph Pod | `[]` | -| `storageClass.name` | Name of the StorageClass | `"memgraph-generic-storage-class"` | -| `storageClass.provisioner` | Provisioner for the StorageClass | `""` | -| `storageClass.storageType` | Type of storage for the StorageClass | `""` | -| `storageClass.fsType` | Filesystem type for the StorageClass | `""` | -| `storageClass.reclaimPolicy` | Reclaim policy for the StorageClass | `Retain` | -| `storageClass.volumeBindingMode` | Volume binding mode for the StorageClass | `Immediate` | -| `sysctlInitContainer.enabled` | Enable the init container to set sysctl parameters | `true` | -| `sysctlInitContainer.maxMapCount` | Value for `vm.max_map_count` to be set by the init container | `262144` | +| Parameter | Description | Default | +| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | +| `image.repository` | Memgraph Docker image repository | `memgraph/memgraph` | +| `image.tag` | Specific tag for the Memgraph Docker image. Overrides the image tag whose default is chart version. | `""` (Defaults to chart's app version) | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `useImagePullSecrets` | Override the default imagePullSecrets | `false` | +| `imagePullSecrets` | Specify image pull secrets | `- name: regcred` | +| `replicaCount` | Number of Memgraph instances to run. Note: no replication or HA support. | `1` | +| `affinity.nodeKey` | Key for node affinity (Preferred) | `""` | +| `affinity.nodeValue` | Value for node affinity (Preferred) | `""` | +| `nodeSelector` | Constrain which nodes your Memgraph pod is eligible to be scheduled on, based on the labels on the nodes. Left empty by default. | `{}` | +| `service.type` | Kubernetes service type | `ClusterIP` | +| `service.enableBolt` | Enable Bolt protocol | `true` | +| `service.boltPort` | Bolt protocol port | `7687` | +| `service.boltProtocol` | Protocol used by Bolt | `TCP` | +| `service.enableWebsocketMonitoring` | Enable WebSocket monitoring | `false` | +| `service.websocketPortMonitoring` | WebSocket monitoring port | `7444` | +| `service.websocketPortMonitoringProtocol` | Protocol used by WebSocket monitoring | `TCP` | +| `service.enableHttpMonitoring` | Enable HTTP monitoring | `false` | +| `service.httpPortMonitoring` | HTTP monitoring port | `9091` | +| `service.httpPortMonitoringProtocol` | Protocol used by HTTP monitoring | `http` | +| `service.annotations` | Annotations to add to the service | `{}` | +| `persistentVolumeClaim.createStorageClaim` | Enable creation of a Persistent Volume Claim for storage | `true` | +| `persistentVolumeClaim.storageClassName` | Storage class name for the persistent volume claim | `""` | +| `persistentVolumeClaim.storageSize` | Size of the persistent volume claim for storage | `10Gi` | +| `persistentVolumeClaim.existingClaim` | Use an existing Persistent Volume Claim | `memgraph-0` | +| `persistentVolumeClaim.storageVolumeName` | Name of an existing Volume to create a PVC for | `""` | +| `persistentVolumeClaim.createLogStorage` | Enable creation of a Persistent Volume Claim for logs | `true` | +| `persistentVolumeClaim.logStorageClassName` | Storage class name for the persistent volume claim for logs | `""` | +| `persistentVolumeClaim.logStorageSize` | Size of the persistent volume claim for logs | `1Gi` | +| `persistentVolumeClaim.createUserClaim` | Create a Dynamic Persistant Volume Claim for Configs, Certificates (e.g. Bolt cert ) and rest of User related files | `false` | +| `persistentVolumeClaim.userStorageClassName` | Storage class name for the persistent volume claim for user storage | `""` | +| `persistentVolumeClaim.userStorageSize` | Size of the persistent volume claim for user storage | `1Gi` | +| `persistentVolumeClaim.userStorageAccessMode`| Storage Class Access Mode. If you need a different pod to add data into Memgraph (e.g. CSV files) set this to "ReadWriteMany" | `ReadWriteOnce` | +| `persistentVolumeClaim.userMountPath` | Where to mount the `userStorageClass` you should set this variable if you are enabling the `UserClaim` | `""` | +| `memgraphConfig` | List of strings defining Memgraph configuration settings | `["--also-log-to-stderr=true"]` | +| `secrets.enabled` | Enable the use of Kubernetes secrets for Memgraph credentials | `false` | +| `secrets.name` | The name of the Kubernetes secret containing Memgraph credentials | `memgraph-secrets` | +| `secrets.userKey` | The key in the Kubernetes secret for the Memgraph user, the value is passed to the `MEMGRAPH_USER` env | `USER` | +| `secrets.passwordKey` | The key in the Kubernetes secret for the Memgraph password, the value is passed to the `MEMGRAPH_PASSWORD` | `PASSWORD` | +| `memgraphEnterpriseLicense` | Memgraph Enterprise License | `""` | +| `memgraphOrganizationName` | Organization name for Memgraph Enterprise License | `""` | +| `statefulSetAnnotations` | Annotations to add to the stateful set | `{}` | +| `podAnnotations` | Annotations to add to the pod | `{}` | +| `resources` | CPU/Memory resource requests/limits. Left empty by default. | `{}` | +| `tolerations` | A toleration is applied to a pod and allows the pod to be scheduled on nodes with matching taints. Left empty by default. | `[]` | +| `serviceAccount.create` | Specifies whether a service account should be created | `true` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated. | `""` | +| `container.terminationGracePeriodSeconds` | Grace period for pod termination | `1800` | +| `probes.liveliness.initialDelaySeconds` | Initial delay for liveliness probe | `10` | +| `probes.liveliness.periodSeconds` | Period seconds for liveliness probe | `60` | +| `probes.liveliness.failureThreshold` | Failure threshold for liveliness probe | `3` | +| `probes.readiness.initialDelaySeconds` | Initial delay for readiness probe | `10` | +| `probes.readiness.periodSeconds` | Period seconds for readiness probe | `30` | +| `probes.readiness.failureThreshold` | Failure threshold for readiness probe | `3` | +| `probes.startup.initialDelaySeconds` | Initial delay for startup probe | `10` | +| `probes.startup.periodSeconds` | Period seconds for startup probe | `10` | +| `probes.startup.failureThreshold` | Failure threshold for startup probe | `30` | +| `nodeSelectors` | Node selectors for pod. Left empty by default. | `{}` | +| `customQueryModules` | List of custom Query modules that should be mounted to Memgraph Pod | `[]` | +| `storageClass.name` | Name of the StorageClass | `"memgraph-generic-storage-class"` | +| `storageClass.provisioner` | Provisioner for the StorageClass | `""` | +| `storageClass.storageType` | Type of storage for the StorageClass | `""` | +| `storageClass.fsType` | Filesystem type for the StorageClass | `""` | +| `storageClass.reclaimPolicy` | Reclaim policy for the StorageClass | `Retain` | +| `storageClass.volumeBindingMode` | Volume binding mode for the StorageClass | `Immediate` | +| `sysctlInitContainer.enabled` | Enable the init container to set sysctl parameters | `true` | +| `sysctlInitContainer.maxMapCount` | Value for `vm.max_map_count` to be set by the init container | `262144` | **Note:** It's often recommended not to specify default resources and leave it as a conscious choice for the user. If you want to specify resources, uncomment the following lines in your `values.yaml`, adjust them as necessary: diff --git a/charts/memgraph/templates/statefulset.yaml b/charts/memgraph/templates/statefulset.yaml index fe46c08..e5a16d0 100644 --- a/charts/memgraph/templates/statefulset.yaml +++ b/charts/memgraph/templates/statefulset.yaml @@ -268,7 +268,7 @@ spec: name: {{ include "memgraph.fullname" . }}-user-storage spec: accessModes: - - "ReadWriteOnce" + - {{ .Values.persistentVolumeClaim.userStorageAccessMode }} {{- if .Values.persistentVolumeClaim.userStorageClassName }} storageClassName: {{ .Values.persistentVolumeClaim.userStorageClassName }} {{- end }} diff --git a/charts/memgraph/values.yaml b/charts/memgraph/values.yaml index 805a37b..4577797 100644 --- a/charts/memgraph/values.yaml +++ b/charts/memgraph/values.yaml @@ -76,6 +76,7 @@ persistentVolumeClaim: createUserClaim: false userStorageClassName: "" userStorageSize: 1Gi + userStorageAccessMode: "ReadWriteOnce" userMountPath: "" # Default Storage Class for data and logs, defaults are for Minikube, make sure to change it for production deployments