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

Memgraph platform #13

Closed
wants to merge 14 commits into from
14 changes: 7 additions & 7 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ 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.0.0
with:
version: v3.12.1
version: v3.13.3

- 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
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
Expand All @@ -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 }}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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).
Expand Down
23 changes: 23 additions & 0 deletions charts/memgraph-platform/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
22 changes: 22 additions & 0 deletions charts/memgraph-platform/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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.1
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: [email protected]
- name: tewnut
email: [email protected]
76 changes: 76 additions & 0 deletions charts/memgraph-platform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
## 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 <release-name> memgraph/memgraph-platform
```
Replace `<release-name>` 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 <resource-name> memgraph/memgraph-platform --set <flag1>=<value1>,<flag2>=<value2>,...
```
Or you can modify a `values.yaml` file and override the desired values:
```
helm install <resource-name> memgraph/memgraph-platform -f values.yaml
```

## Configuration options
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 | `{}` |

Choose a reason for hiding this comment

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

nodeSelector, tolerations and affinity doesn't seem to be used in the chart.

| `tolerations` | Tolerations for pods | `[]` |
| `affinity` | Affinity settings for pods | `{}` |



12 changes: 12 additions & 0 deletions charts/memgraph-platform/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 <your-instance-ip> --port <your-instance-port>

If you are connecting via Lab, specify your instance ip address and port in Memgraph Lab GUI.


62 changes: 62 additions & 0 deletions charts/memgraph-platform/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 }}
61 changes: 61 additions & 0 deletions charts/memgraph-platform/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 26 additions & 0 deletions charts/memgraph-platform/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
23 changes: 23 additions & 0 deletions charts/memgraph-platform/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
13 changes: 13 additions & 0 deletions charts/memgraph-platform/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading