Skip to content

Commit

Permalink
Add default storage class and retain policy (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
antejavor authored Nov 29, 2024
1 parent 7bf185a commit ae58a8b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
7 changes: 7 additions & 0 deletions charts/memgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ The following table lists the configurable parameters of the Memgraph chart and
| `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:

```yaml
Expand Down
10 changes: 10 additions & 0 deletions charts/memgraph/templates/storageclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageClass.name }}
provisioner: {{ .Values.storageClass.provisioner }}
parameters:
type: {{ .Values.storageClass.storageType | }}
fsType: {{ .Values.storageClass.fsType }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageClass.volumeBindingMode }}
17 changes: 15 additions & 2 deletions charts/memgraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ persistentVolumeClaim:
## createStoragePVC `true` will create for each statefulset server a Persistant Volume Claim
## `false` will let you choose an existing Persistant Volume Claim or will create one with an existing volume
createStorageClaim: true
## Using a Storage Class Name with policy `retain` will keep the Persistant Volume Claim and the Volume
## Using a Storage Class Name with policy `retain` will keep the Persistant Volume Claim and the Volume until you manually delete it
## If you use a Storage Class Name with policy `delete` the Persistant Volume Claim and Volume will be deleted when the helm release is deleted
storageClassName: ""
## Storage Size must me at minimum 4x the maximum size of your Dataset for Snapshots
Expand All @@ -66,7 +66,7 @@ persistentVolumeClaim:
## If you want to create a Persistant Volume Claim for an existing Volume
storageVolumeName: ""

## Create a Dynamic Persistant Volume Claim for Logs
## Create a Persistant Volume Claim for Logs, if you use a Storage Class Name with policy `retain` the logs will be kept until you manually delete them
# `false` will only write logs to stdout / stderr
createLogStorage: true
logStorageClassName: ""
Expand All @@ -78,6 +78,18 @@ persistentVolumeClaim:
userStorageSize: 1Gi
userMountPath: ""

# Default Storage Class for data and logs, defaults are for Minikube, make sure to change it for production deployments
# Examples provisioner: Minikube(k8s.io/minikube-hostpath) AWS (ebs.csi.aws.com), GCP (pd.csi.storage.gke.io), Azure (disk.csi.azure.com)
# Examples storageType: Minikube(hostPath) AWS (gp2), GCP (pd-standard), Azure (StandardSSD_LRS)

storageClass:
name: memgraph-generic-storage-class
provisioner: "k8s.io/minikube-hostpath"
storageType: "hostPath"
fsType: ext4
reclaimPolicy: Retain
volumeBindingMode: Immediate

memgraphConfig:
- "--also-log-to-stderr=true"

Expand Down Expand Up @@ -141,6 +153,7 @@ container:
# These will be loaded automatically, on startup.
# Each module must be exposed by a ConfigMap under a specific file name.
customQueryModules: []

# Must be an existing ConfigMap
# - volume: ""
# Must be present in the ConfigMap referenced with `volume`
Expand Down

0 comments on commit ae58a8b

Please sign in to comment.