From 62ef4b729efa79bc4b09b96733b98b3db737966f Mon Sep 17 00:00:00 2001 From: tewnut Date: Sun, 21 Jan 2024 07:02:19 +0700 Subject: [PATCH 01/14] upgrade AppVersion to 2.13.0 --- charts/memgraph/Chart.yaml | 18 +++++++++--------- charts/memgraph/values.yaml | 25 ++++++++++++------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/charts/memgraph/Chart.yaml b/charts/memgraph/Chart.yaml index f157e11..6307691 100644 --- a/charts/memgraph/Chart.yaml +++ b/charts/memgraph/Chart.yaml @@ -2,17 +2,17 @@ apiVersion: v2 name: memgraph home: https://memgraph.com/ type: application -version: 0.1.1 -appVersion: "2.10.0" +version: 0.1.2 +appVersion: 2.13.0 description: MemgraphDB Helm Chart keywords: - - graph - - database - - cypher - - analytics +- graph +- database +- cypher +- analytics icon: https://public-assets.memgraph.com/memgraph-logo/logo-large.png sources: - - https://github.com/memgraph/memgraph +- https://github.com/memgraph/memgraph maintainers: - - name: Memgraph - email: tech@memgraph.com +- name: Memgraph + email: tech@memgraph.com diff --git a/charts/memgraph/values.yaml b/charts/memgraph/values.yaml index 8dbca91..638c1df 100644 --- a/charts/memgraph/values.yaml +++ b/charts/memgraph/values.yaml @@ -20,25 +20,24 @@ persistentVolumeClaim: logPVCSize: 256Mi memgraphConfig: - - "--also-log-to-stderr=true" +- "--also-log-to-stderr=true" # Annotations to add to the statefulSet statefulSetAnnotations: {} # Annotations to add to the Pod podAnnotations: {} -resources: - {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi +resources: {} +# We usually recommend not to specify default resources and to leave this as a conscious +# choice for the user. This also increases chances charts run on environments with little +# resources, such as Minikube. If you do want to specify resources, uncomment the following +# lines, adjust them as necessary, and remove the curly braces after 'resources:'. +# limits: +# cpu: 100m +# memory: 128Mi +# requests: +# cpu: 100m +# memory: 128Mi serviceAccount: # Specifies whether a service account should be created From cb0961b2ee66e6cd7d31137340837d61f3ba6285 Mon Sep 17 00:00:00 2001 From: tewnut Date: Sun, 21 Jan 2024 07:05:00 +0700 Subject: [PATCH 02/14] make appVersion string --- charts/memgraph/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/memgraph/Chart.yaml b/charts/memgraph/Chart.yaml index 6307691..2286685 100644 --- a/charts/memgraph/Chart.yaml +++ b/charts/memgraph/Chart.yaml @@ -3,7 +3,7 @@ name: memgraph home: https://memgraph.com/ type: application version: 0.1.2 -appVersion: 2.13.0 +appVersion: "2.13.0" description: MemgraphDB Helm Chart keywords: - graph From 78a3689cee4280beba7b15fff8d8c7a889d44f95 Mon Sep 17 00:00:00 2001 From: tewnut Date: Tue, 23 Jan 2024 19:26:20 +0700 Subject: [PATCH 03/14] add memgraph-platform chart --- charts/memgraph-platform/.helmignore | 23 ++++ charts/memgraph-platform/Chart.yaml | 20 +++ charts/memgraph-platform/templates/NOTES.txt | 12 ++ .../memgraph-platform/templates/_helpers.tpl | 62 ++++++++++ .../memgraph-platform/templates/ingress.yaml | 61 ++++++++++ .../templates/persistentvolumeclaim.yaml | 26 ++++ .../memgraph-platform/templates/service.yaml | 23 ++++ .../templates/serviceaccount.yaml | 13 ++ .../templates/statefulset.yaml | 71 +++++++++++ .../templates/tests/test-connection.yaml | 15 +++ charts/memgraph-platform/values.yaml | 115 ++++++++++++++++++ 11 files changed, 441 insertions(+) create mode 100644 charts/memgraph-platform/.helmignore create mode 100644 charts/memgraph-platform/Chart.yaml create mode 100644 charts/memgraph-platform/templates/NOTES.txt create mode 100644 charts/memgraph-platform/templates/_helpers.tpl create mode 100644 charts/memgraph-platform/templates/ingress.yaml create mode 100644 charts/memgraph-platform/templates/persistentvolumeclaim.yaml create mode 100644 charts/memgraph-platform/templates/service.yaml create mode 100644 charts/memgraph-platform/templates/serviceaccount.yaml create mode 100644 charts/memgraph-platform/templates/statefulset.yaml create mode 100644 charts/memgraph-platform/templates/tests/test-connection.yaml create mode 100644 charts/memgraph-platform/values.yaml diff --git a/charts/memgraph-platform/.helmignore b/charts/memgraph-platform/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/memgraph-platform/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/memgraph-platform/Chart.yaml b/charts/memgraph-platform/Chart.yaml new file mode 100644 index 0000000..de8853e --- /dev/null +++ b/charts/memgraph-platform/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +name: memgraph-platform +home: https://memgraph.com/ +type: application +description: Memgraph Platform is a single docker image containing Memgraph, query modules from Memgraph Mage and Memgraph Lab. + +version: 0.1.0 +appVersion: "latest" + +keywords: +- graph +- database +- cypher +- analytics +icon: https://public-assets.memgraph.com/memgraph-logo/logo-large.png +sources: +- https://github.com/memgraph/memgraph-platform +maintainers: +- name: Memgraph + email: tech@memgraph.com diff --git a/charts/memgraph-platform/templates/NOTES.txt b/charts/memgraph-platform/templates/NOTES.txt new file mode 100644 index 0000000..85d45e2 --- /dev/null +++ b/charts/memgraph-platform/templates/NOTES.txt @@ -0,0 +1,12 @@ +Thank you for installing Memgraph! 🎉 + +Connect to Memgraph via Lab, mgconsole, or any other client to your Memgraph instance. By default Memgraph listens on port 7687 for a bolt connection inside the cluster. +Make sure your are connecting to the correct ip address of your instance. For details check the configuration on your cloud provider(aws, gcp, azure, etc.) + +If you are connecting via mgconsole, you can use the following command: + +mgconsole --host --port + +If you are connecting via Lab, specify your instance ip address and port in Memgraph Lab GUI. + + diff --git a/charts/memgraph-platform/templates/_helpers.tpl b/charts/memgraph-platform/templates/_helpers.tpl new file mode 100644 index 0000000..44dc908 --- /dev/null +++ b/charts/memgraph-platform/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "memgraph-platform.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "memgraph-platform.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "memgraph-platform.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "memgraph-platform.labels" -}} +helm.sh/chart: {{ include "memgraph-platform.chart" . }} +{{ include "memgraph-platform.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "memgraph-platform.selectorLabels" -}} +app.kubernetes.io/name: {{ include "memgraph-platform.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "memgraph-platform.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "memgraph-platform.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/memgraph-platform/templates/ingress.yaml b/charts/memgraph-platform/templates/ingress.yaml new file mode 100644 index 0000000..adceb58 --- /dev/null +++ b/charts/memgraph-platform/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "memgraph-platform.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "memgraph-platform.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/memgraph-platform/templates/persistentvolumeclaim.yaml b/charts/memgraph-platform/templates/persistentvolumeclaim.yaml new file mode 100644 index 0000000..be85a3b --- /dev/null +++ b/charts/memgraph-platform/templates/persistentvolumeclaim.yaml @@ -0,0 +1,26 @@ + +{{ if .Values.persistentVolumeClaim.storagePVC }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "memgraph-platform.fullname" . }}-lib-storage +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.persistentVolumeClaim.storagePVCSize }} +{{ end }} +--- +{{ if .Values.persistentVolumeClaim.logPVC }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "memgraph-platform.fullname" . }}-log-storage +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.persistentVolumeClaim.logPVCSize }} +{{ end }} diff --git a/charts/memgraph-platform/templates/service.yaml b/charts/memgraph-platform/templates/service.yaml new file mode 100644 index 0000000..df941ab --- /dev/null +++ b/charts/memgraph-platform/templates/service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "memgraph-platform.fullname" . }} + labels: + {{- include "memgraph-platform.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.portBolt }} + targetPort: 7687 + protocol: TCP + name: bolt + - port: {{ .Values.service.portLab }} + targetPort: 3000 + protocol: TCP + name: lab + - port: {{ .Values.service.portLog }} + targetPort: 7444 + protocol: TCP + name: log + selector: + {{- include "memgraph-platform.selectorLabels" . | nindent 4 }} diff --git a/charts/memgraph-platform/templates/serviceaccount.yaml b/charts/memgraph-platform/templates/serviceaccount.yaml new file mode 100644 index 0000000..35c342a --- /dev/null +++ b/charts/memgraph-platform/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "memgraph-platform.serviceAccountName" . }} + labels: + {{- include "memgraph-platform.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/memgraph-platform/templates/statefulset.yaml b/charts/memgraph-platform/templates/statefulset.yaml new file mode 100644 index 0000000..e3cfb04 --- /dev/null +++ b/charts/memgraph-platform/templates/statefulset.yaml @@ -0,0 +1,71 @@ +# templates/statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "memgraph-platform.fullname" . }} + labels: + {{- include "memgraph-platform.labels" . | nindent 4 }} + {{- with .Values.statefulSetAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + serviceName: {{ include "memgraph-platform.fullname" . }} + selector: + matchLabels: + {{- include "memgraph-platform.selectorLabels" . | nindent 6 }} + podManagementPolicy: OrderedReady + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + {{- include "memgraph-platform.labels" . | nindent 8 }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + spec: + securityContext: + volumes: + {{- if .Values.persistentVolumeClaim.storagePVC }} + - name: memgraph-lib-storage + persistentVolumeClaim: + claimName: {{ include "memgraph-platform.fullname" . }}-lib-storage + {{- end }} + {{- if .Values.persistentVolumeClaim.logPVC }} + - name: memgraph-log-storage + persistentVolumeClaim: + claimName: {{ include "memgraph-platform.fullname" . }}-log-storage + {{- end }} + containers: + - name: memgraph-platform + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + args: + {{- range .Values.memgraphConfig }} + - {{ . | quote }} + {{- end }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + securityContext: + runAsUser: 0 + ports: + - containerPort: {{ .Values.service.portBolt }} + name: bolt + - containerPort: {{ .Values.service.portLab }} + name: lab + - containerPort: {{ .Values.service.portLog }} + name: log + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + {{- if .Values.persistentVolumeClaim.storagePVC }} + - name: memgraph-lib-storage + mountPath: /var/lib/memgraph + {{- end }} + {{- if .Values.persistentVolumeClaim.logPVC }} + - name: memgraph-log-storage + mountPath: /var/log/memgraph + {{- end }} diff --git a/charts/memgraph-platform/templates/tests/test-connection.yaml b/charts/memgraph-platform/templates/tests/test-connection.yaml new file mode 100644 index 0000000..d1a5cd2 --- /dev/null +++ b/charts/memgraph-platform/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "memgraph-platform.fullname" . }}-test-connection" + labels: + {{- include "memgraph-platform.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "memgraph-platform.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/memgraph-platform/values.yaml b/charts/memgraph-platform/values.yaml new file mode 100644 index 0000000..3c220bd --- /dev/null +++ b/charts/memgraph-platform/values.yaml @@ -0,0 +1,115 @@ +# Default values for memgraph-platform. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: memgraph/memgraph-platform + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} +# fsGroup: 2000 + +securityContext: {} +# capabilities: +# drop: +# - ALL +# readOnlyRootFilesystem: true +# runAsNonRoot: true +# runAsUser: 1000 + +service: + type: ClusterIP + portBolt: 7687 + portLab: 3000 + portLog: 7444 + +persistentVolumeClaim: + storagePVC: true + storagePVCSize: 1Gi + logPVC: true + logPVCSize: 256Mi + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} +# We usually recommend not to specify default resources and to leave this as a conscious +# choice for the user. This also increases chances charts run on environments with little +# resources, such as Minikube. If you do want to specify resources, uncomment the following +# lines, adjust them as necessary, and remove the curly braces after 'resources:'. +# limits: +# cpu: 100m +# memory: 128Mi +# requests: +# cpu: 100m +# memory: 128Mi + +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} From a544401949c49e9aece988c17e46fbb23ee0b6de Mon Sep 17 00:00:00 2001 From: tewnut Date: Tue, 23 Jan 2024 19:29:37 +0700 Subject: [PATCH 04/14] add maintainer for memgraph-platform chart --- index.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.yaml b/index.yaml index 23cf930..1206c62 100644 --- a/index.yaml +++ b/index.yaml @@ -16,6 +16,8 @@ entries: maintainers: - email: tech@memgraph.com name: Memgraph + - email: tewnut@gmail.com + name: tewnut name: memgraph sources: - https://github.com/memgraph/memgraph From 3bb9cf6ed8516fe2042e30defcb4fc3347bb830b Mon Sep 17 00:00:00 2001 From: tewnut Date: Wed, 24 Jan 2024 07:48:19 +0700 Subject: [PATCH 05/14] feat: add ENV to statefullset --- README.md | 12 ++++++ charts/memgraph-platform/README.md | 38 +++++++++++++++++++ .../templates/statefulset.yaml | 5 +++ charts/memgraph-platform/values.yaml | 4 ++ 4 files changed, 59 insertions(+) create mode 100644 charts/memgraph-platform/README.md diff --git a/README.md b/README.md index 17be522..d2a61ed 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Welcome to the Memgraph Helm Charts repository. This repository provides Helm ch ## Available charts - [**Memgraph standalone**](#memgraph-standalone) +- [**Memgraph Platform**](#memgraph-platform) ## Prerequisites Helm version 3 or above installed. @@ -26,6 +27,17 @@ Make sure to update the repository to fetch the latest Helm charts available: helm repo update ``` +## Memgraph Platform +Deploys Memgraph Platform. +For detailed information and usage instructions, please refer to the [chart's individual README file](./charts/memgraph-platform/README.md). + +To install Memgraph Platform, run the following command: + +``` +helm install my-release memgraph/memgraph-platform +``` +Replace `my-release` with a name of your choice for the release. + ## Memgraph standalone Deploys standalone Memgraph. For detailed information and usage instructions, please refer to the [chart's individual README file](./charts/memgraph/README.md). diff --git a/charts/memgraph-platform/README.md b/charts/memgraph-platform/README.md new file mode 100644 index 0000000..9080548 --- /dev/null +++ b/charts/memgraph-platform/README.md @@ -0,0 +1,38 @@ +## Memgraph Platform Kubernetes Helm Chart +A Helm Chart for deploying Memgraph platform (including the database, lab and mage) on Kubernetes. + +## Installing the Memgraph Platform Helm Chart +To install the Memgraph Platform Helm Chart, follow the steps below: +``` +helm install memgraph/memgraph-platform +``` +Replace `` with a name of your choice for the release. + +## Changing the default chart values +To change the default chart values, run the command with the specified set of flags: +``` +helm install memgraph/memgraph-platform --set =,=,... +``` +Or you can modify a `values.yaml` file and override the desired values: +``` +helm install memgraph/memgraph-platform -f values.yaml +``` + +## Configuration options +The following table lists the configurable parameters of the Memgraph chart and their default values. + +| parameter | description | default | +| --------------------------------------- | ----------------------------------------------- | ------------------------------- | +| `image` | Memgraph Docker image repository | `memgraph` | +| `persistentVolumeClaim.storagePVC` | Enable persistent volume claim for storage | `true` | +| `persistanceVolumeClaim.storagePVCSize` | Size of the persistent volume claim for storage | `1Gi` | +| `persistentVolumeClaim.logPVC` | Enable persistent volume claim for logs | `true` | +| `persistanceVolumeClaim.logPVCSize` | Size of the persistent volume claim for logs | `256Mi` | +| `service.type` | Kubernetes service type | `NodePort` | +| `service.port` | Kubernetes service port | `7687` | +| `service.targetPort` | Kubernetes service target port | `7687` | +| `memgraphConfig` | Memgraph configuration settings | `["--also-log-to-stderr=true"]` | + + + +For all available database settings, refer to the [Configuration settings reference guide](https://memgraph.com/docs/memgraph/reference-guide/configuration). diff --git a/charts/memgraph-platform/templates/statefulset.yaml b/charts/memgraph-platform/templates/statefulset.yaml index e3cfb04..1a818e0 100644 --- a/charts/memgraph-platform/templates/statefulset.yaml +++ b/charts/memgraph-platform/templates/statefulset.yaml @@ -46,6 +46,11 @@ spec: {{- range .Values.memgraphConfig }} - {{ . | quote }} {{- end }} + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: runAsUser: 0 diff --git a/charts/memgraph-platform/values.yaml b/charts/memgraph-platform/values.yaml index 3c220bd..db95f33 100644 --- a/charts/memgraph-platform/values.yaml +++ b/charts/memgraph-platform/values.yaml @@ -45,6 +45,10 @@ service: portLab: 3000 portLog: 7444 + +env: + MEMGRAPH: "--bolt-server-name-for-init=Neo4j/" + persistentVolumeClaim: storagePVC: true storagePVCSize: 1Gi From e11a9fea4be8c20e78bbe87a6386bb1e33c1b679 Mon Sep 17 00:00:00 2001 From: tewnut Date: Wed, 24 Jan 2024 07:56:38 +0700 Subject: [PATCH 06/14] update README.md --- charts/memgraph-platform/README.md | 64 ++++++++++++++++++++++------ charts/memgraph-platform/values.yaml | 4 +- 2 files changed, 53 insertions(+), 15 deletions(-) diff --git a/charts/memgraph-platform/README.md b/charts/memgraph-platform/README.md index 9080548..6599568 100644 --- a/charts/memgraph-platform/README.md +++ b/charts/memgraph-platform/README.md @@ -19,20 +19,58 @@ helm install memgraph/memgraph-platform -f values.yaml ``` ## Configuration options -The following table lists the configurable parameters of the Memgraph chart and their default values. - -| parameter | description | default | -| --------------------------------------- | ----------------------------------------------- | ------------------------------- | -| `image` | Memgraph Docker image repository | `memgraph` | -| `persistentVolumeClaim.storagePVC` | Enable persistent volume claim for storage | `true` | -| `persistanceVolumeClaim.storagePVCSize` | Size of the persistent volume claim for storage | `1Gi` | -| `persistentVolumeClaim.logPVC` | Enable persistent volume claim for logs | `true` | -| `persistanceVolumeClaim.logPVCSize` | Size of the persistent volume claim for logs | `256Mi` | -| `service.type` | Kubernetes service type | `NodePort` | -| `service.port` | Kubernetes service port | `7687` | -| `service.targetPort` | Kubernetes service target port | `7687` | -| `memgraphConfig` | Memgraph configuration settings | `["--also-log-to-stderr=true"]` | +When working with Memgraph Platform Docker image, you should pass configuration flags inside of environment variables. +For example, you can start the memgraph Docker image with docker run memgraph/memgraph --bolt-port=7687 --log-level=TRACE, but you should start memgraph-platform Docker image with docker run -p 7687:7687 -p 7444:7444 -p 3000:3000 -e MEMGRAPH="--bolt-port=7687 --log-level=TRACE" memgraph/memgraph-platform. +Each configuration setting is in the form: --setting-name=value. For all available database settings, refer to the [Configuration settings reference guide](https://memgraph.com/docs/memgraph/reference-guide/configuration). + +The following table lists the configurable parameters of the Memgraph Platform chart and their default values. + +| Parameter | Description | Default | +| -------------------------------------------- | ----------------------------------------------------------- | --------------------------- | +| `replicaCount` | Number of replicas | `1` | +| `image.repository` | Memgraph Platform Docker image repository | `memgraph-platform` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.tag` | Image tag (overrides chart appVersion) | `""` | +| `imagePullSecrets` | Image pull secrets | `[]` | +| `nameOverride` | Override chart name | `""` | +| `fullnameOverride` | Override full chart name | `""` | +| `serviceAccount.create` | Create service account | `true` | +| `serviceAccount.automount` | Automatically mount service account API credentials | `true` | +| `serviceAccount.annotations` | Service account annotations | `{}` | +| `serviceAccount.name` | Service account name | (auto-generated if not set) | +| `podAnnotations` | Annotations to add to the pods | `{}` | +| `podLabels` | Labels to add to the pods | `{}` | +| `podSecurityContext` | Pod-level security context | `{}` | +| `securityContext` | Container security context | `{}` | +| `service.type` | Kubernetes service type | `ClusterIP` | +| `service.portBolt` | Service port for Bolt protocol | `7687` | +| `service.portLab` | Service port for Lab UI | `3000` | +| `service.portLog` | Service port for logs | `7444` | +| `env.MEMGRAPH` | Memgraph environment variable | `{}` | +| `persistentVolumeClaim.storagePVC` | Enable persistent volume claim for storage | `true` | +| `persistentVolumeClaim.storagePVCSize` | Size of the persistent volume claim for storage | `1Gi` | +| `persistentVolumeClaim.logPVC` | Enable persistent volume claim for logs | `true` | +| `persistentVolumeClaim.logPVCSize` | Size of the persistent volume claim for logs | `256Mi` | +| `ingress.enabled` | Enable Ingress | `false` | +| `ingress.className` | Ingress class name | `""` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.hosts` | Ingress hosts | `[]` | +| `resources` | Resource requests and limits | `{}` | +| `livenessProbe` | Liveness probe settings | `{}` | +| `readinessProbe` | Readiness probe settings | `{}` | +| `autoscaling.enabled` | Enable Horizontal Pod Autoscaler | `false` | +| `autoscaling.minReplicas` | Minimum number of replicas for autoscaling | `1` | +| `autoscaling.maxReplicas` | Maximum number of replicas for autoscaling | `100` | +| `autoscaling.targetCPUUtilizationPercentage` | Target CPU utilization percentage for autoscaling | `80` | +| `volumes` | Additional volumes on the output Deployment definition | `[]` | +| `volumeMounts` | Additional volumeMounts on the output Deployment definition | `[]` | +| `nodeSelector` | Node selector for pods | `{}` | +| `tolerations` | Tolerations for pods | `[]` | +| `affinity` | Affinity settings for pods | `{}` | + + + diff --git a/charts/memgraph-platform/values.yaml b/charts/memgraph-platform/values.yaml index db95f33..5afc423 100644 --- a/charts/memgraph-platform/values.yaml +++ b/charts/memgraph-platform/values.yaml @@ -46,8 +46,8 @@ service: portLog: 7444 -env: - MEMGRAPH: "--bolt-server-name-for-init=Neo4j/" +env: {} +# MEMGRAPH: "--bolt-server-name-for-init=Neo4j/" persistentVolumeClaim: storagePVC: true From 6b53a31e0abb5a900d111124af48bce580efac4b Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:09:35 +0700 Subject: [PATCH 07/14] upgrade actions for node20 --- .github/workflows/lint-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index e87fbee..d3c5588 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -13,18 +13,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4 with: - version: v3.12.1 + version: v4.0.0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' check-latest: true - name: Set up chart-testing @@ -48,4 +48,4 @@ jobs: - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + run: ct install --target-branch ${{ github.event.repository.default_branch }} \ No newline at end of file From 55afefeed9569cb4ea008b0d202d7c7a69825d45 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:10:36 +0700 Subject: [PATCH 08/14] implement nodeSelector, tolerations and affinity --- charts/memgraph-platform/templates/statefulset.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/charts/memgraph-platform/templates/statefulset.yaml b/charts/memgraph-platform/templates/statefulset.yaml index 1a818e0..af6aafb 100644 --- a/charts/memgraph-platform/templates/statefulset.yaml +++ b/charts/memgraph-platform/templates/statefulset.yaml @@ -74,3 +74,15 @@ spec: - name: memgraph-log-storage mountPath: /var/log/memgraph {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 4 }} + {{- end }} \ No newline at end of file From 0f0fd02b2e7c78f47798df428d2aba9af205ca04 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:11:25 +0700 Subject: [PATCH 09/14] add maintainer for memgraph-platform chart --- charts/memgraph-platform/Chart.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/memgraph-platform/Chart.yaml b/charts/memgraph-platform/Chart.yaml index de8853e..dd38665 100644 --- a/charts/memgraph-platform/Chart.yaml +++ b/charts/memgraph-platform/Chart.yaml @@ -18,3 +18,5 @@ sources: maintainers: - name: Memgraph email: tech@memgraph.com +- name: tewnut + email: tewnut@gmail.com From a3ae08921ba182154e42ec4f8e4bacc724383129 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:24:51 +0700 Subject: [PATCH 10/14] use helm v3.13.3 --- .github/workflows/lint-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index d3c5588..3f24a8c 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v4 with: - version: v4.0.0 + version: v3.13.3 - uses: actions/setup-python@v5 with: From 245f18333b3872353b61402f48d421d7e28645cc Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:30:10 +0700 Subject: [PATCH 11/14] specify full version --- .github/workflows/lint-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 3f24a8c..3cac57a 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v4 + uses: azure/setup-helm@v4.0.0 with: version: v3.13.3 From 783430b6037bc587b424d183e80e5df9d26049c0 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:35:54 +0700 Subject: [PATCH 12/14] upgrade chart-testing-actions to fix cosign issue --- .github/workflows/lint-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 3cac57a..f25c91a 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -28,7 +28,7 @@ jobs: check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.4.0 + uses: helm/chart-testing-action@v2.6.1 - name: Run chart-testing (list-changed) id: list-changed From a2d66a79e33b2aad1430b6e53cc8febc0acca55f Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:38:00 +0700 Subject: [PATCH 13/14] bump chart version --- charts/memgraph-platform/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/memgraph-platform/Chart.yaml b/charts/memgraph-platform/Chart.yaml index dd38665..90f2baf 100644 --- a/charts/memgraph-platform/Chart.yaml +++ b/charts/memgraph-platform/Chart.yaml @@ -4,7 +4,7 @@ home: https://memgraph.com/ type: application description: Memgraph Platform is a single docker image containing Memgraph, query modules from Memgraph Mage and Memgraph Lab. -version: 0.1.0 +version: 0.1.1 appVersion: "latest" keywords: From 5f1ab603ed5c04335cf79ed85a4dd91f134ecbe9 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Wed, 14 Feb 2024 12:39:58 +0700 Subject: [PATCH 14/14] lint: trailing space --- charts/memgraph-platform/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/memgraph-platform/Chart.yaml b/charts/memgraph-platform/Chart.yaml index 90f2baf..29b5ec5 100644 --- a/charts/memgraph-platform/Chart.yaml +++ b/charts/memgraph-platform/Chart.yaml @@ -19,4 +19,4 @@ maintainers: - name: Memgraph email: tech@memgraph.com - name: tewnut - email: tewnut@gmail.com + email: tewnut@gmail.com