Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default storage class and retain policy #83

Merged
merged 7 commits into from
Nov 29, 2024
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
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