-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from memgraph/release-0.1.3
Release 0.1.3
- Loading branch information
Showing
30 changed files
with
1,259 additions
and
4 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @antejavor @katarinasupe | ||
* @antejavor @katarinasupe @as51340 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v2 | ||
name: memgraph-high-availability | ||
description: A Helm chart for Kubernetes with Memgraph High availabiliy capabilites | ||
|
||
version: 0.1.0 | ||
appVersion: "2.17.0" | ||
|
||
type: application | ||
|
||
keywords: | ||
- memgraph | ||
- graph | ||
- database | ||
- cypher | ||
- analytics | ||
- high-availability | ||
|
||
icon: https://public-assets.memgraph.com/memgraph-logo/logo-large.png | ||
|
||
home: https://memgraph.com/ | ||
|
||
sources: | ||
- "https://github.com/memgraph/memgraph" | ||
- "https://github.com/memgraph/helm-charts" | ||
|
||
|
||
maintainers: | ||
- name: Memgraph | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
## Helm chart for Memgraph high availability cluster | ||
A Helm Chart for deploying Memgraph in [high availability setup](https://memgraph.com/docs/clustering/high-availability). | ||
|
||
Memgraph HA cluster includes 3 coordinators, 2 data instances by default. The cluster setup is performed via the cluster-setup job. The HA cluster is still work in progress and started with "--experimental-enabled=high-availability". | ||
The cluster is started in the configuration without the node selector, which means that in the current configuration, it is not highly available if the node fails. | ||
|
||
## Installing the Memgraph HA Helm Chart | ||
To install the Memgraph HA Helm Chart, follow the steps below: | ||
``` | ||
helm install <release-name> memgraph/memgraph-high-availability --set memgraph.env.MEMGRAPH_ENTERPRISE_LICENSE=<your-license>,memgraph.env.MEMGRAPH_ORGANIZATION_NAME=<your-organization-name> | ||
``` | ||
Replace `<release-name>` with a name of your choice for the release and set the enterprise license. | ||
|
||
## 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-high-availability --set <flag1>=<value1>,<flag2>=<value2>,... | ||
``` | ||
Or you can modify a `values.yaml` file and override the desired values: | ||
``` | ||
helm install <resource-name> memgraph/memgraph-high-availability-f values.yaml | ||
``` | ||
|
||
|
||
## Configuration Options | ||
|
||
The following table lists the configurable parameters of the Memgraph chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
|---------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------| | ||
| `memgraph.image.repository` | Memgraph Docker image repository | `memgraph/memgraph` | | ||
| `memgraph.image.tag` | Specific tag for the Memgraph Docker image. Overrides the image tag whose default is chart version. | `2.17.0` | | ||
| `memgraph.image.pullPolicy` | Image pull policy | `IfNotPresent` | | ||
| `memgraph.env.MEMGRAPH_ENTERPRISE_LICENSE` | Memgraph enterprise license | `<your-license>` | | ||
| `memgraph.env.MEMGRAPH_ORGANIZATION_NAME` | Organization name | `<your-organization-name>` | | ||
| `memgraph.probes.startup.failureThreshold` | Startup probe failure threshold | `30` | | ||
| `memgraph.probes.startup.periodSeconds` | Startup probe period in seconds | `10` | | ||
| `memgraph.probes.readiness.initialDelaySeconds` | Readiness probe initial delay in seconds | `5` | | ||
| `memgraph.probes.readiness.periodSeconds` | Readiness probe period in seconds | `5` | | ||
| `memgraph.probes.liveness.initialDelaySeconds` | Liveness probe initial delay in seconds | `30` | | ||
| `memgraph.probes.liveness.periodSeconds` | Liveness probe period in seconds | `10` | | ||
| `memgraph.data.volumeClaim.storagePVC` | Enable storage PVC | `true` | | ||
| `memgraph.data.volumeClaim.storagePVCSize` | Size of the storage PVC | `1Gi` | | ||
| `memgraph.data.volumeClaim.logPVC` | Enable log PVC | `false` | | ||
| `memgraph.data.volumeClaim.logPVCSize` | Size of the log PVC | `256Mi` | | ||
| `memgraph.coordinators.volumeClaim.storagePVC` | Enable storage PVC for coordinators | `true` | | ||
| `memgraph.coordinators.volumeClaim.storagePVCSize` | Size of the storage PVC for coordinators | `1Gi` | | ||
| `memgraph.coordinators.volumeClaim.logPVC` | Enable log PVC for coordinators | `false` | | ||
| `memgraph.coordinators.volumeClaim.logPVCSize` | Size of the log PVC for coordinators | `256Mi` | | ||
| `data` | Configuration for data instances | See `data` section | | ||
| `coordinators` | Configuration for coordinator instances | See `coordinators` section | | ||
|
||
For the `data` and `coordinators` sections, each item in the list has the following parameters: | ||
|
||
| Parameter | Description | Default | | ||
|---------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------| | ||
| `id` | ID of the instance | `0` for data, `1` for coordinators | | ||
| `boltPort` | Bolt port of the instance | `7687` | | ||
| `managementPort` (data only) | Management port of the data instance | `10000` | | ||
| `replicationPort` (data only) | Replication port of the data instance | `20000` | | ||
| `coordinatorPort` (coordinators only) | Coordinator port of the coordinator instance | `12000` | | ||
| `args` | List of arguments for the instance | See `args` section | | ||
|
||
The `args` section contains a list of arguments for the instance. The default values are the same for all instances: | ||
|
||
```markdown | ||
- "--also-log-to-stderr" | ||
- "--log-level=TRACE" | ||
- "--replication-restore-state-on-startup=true" | ||
``` | ||
|
||
For all available database settings, refer to the [Configuration settings reference guide](https://memgraph.com/docs/memgraph/reference-guide/configuration). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Thank you for installing the Memgraph High-availability cluster! 🎉 | ||
|
||
Memgraph HA cluster includes 3 coordinators, 2 data instances by default. The cluster setup is performed via the cluster-setup job. The HA cluster is still work in progress and started with "--experimental-enabled=high-availability". | ||
The cluster is started in the configuration without the node selector, which means that in the current configuration, it is not highly available if the node fails. | ||
|
||
The cluster setup requires the proper enterprise license to work since HA is an enterprise feature. | ||
|
||
You can connect to Memgraph instances via Lab, mgconsole, or any other client. By default, all Memgraph instances (coordinators and data instances) listen on port 7687 for a bolt connection. | ||
Make sure your are connecting to the correct ip address and port. 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
{{/* Full name of the application */}} | ||
{{- define "memgraph.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
|
||
|
||
{{/* Define the chart version and app version */}} | ||
{{- define "memgraph.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end -}} | ||
|
||
|
||
{{/* Define the name of the application */}} | ||
{{- define "memgraph.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end -}} | ||
|
||
|
||
{{/* Common labels */}} | ||
{{- define "memgraph.labels" -}} | ||
app.kubernetes.io/name: {{ include "memgraph.name" . }} | ||
helm.sh/chart: {{ include "memgraph.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "memgraph.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "memgraph.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
51 changes: 51 additions & 0 deletions
51
charts/memgraph-high-availability/templates/cluster-setup.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: memgraph-setup | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: memgraph-setup | ||
image: memgraph/memgraph:2.17.0 | ||
command: ["/bin/bash", "-c"] | ||
args: | ||
- | | ||
# Install netcat | ||
echo "Installing netcat..." | ||
apt-get update && apt-get install -y netcat-openbsd | ||
# Wait until the pods are available | ||
echo "Waiting for pods to become available for Bolt connection..." | ||
until nc -z memgraph-coordinator-1.default.svc.cluster.local 7687; do sleep 1; done | ||
until nc -z memgraph-coordinator-2.default.svc.cluster.local 7687; do sleep 1; done | ||
until nc -z memgraph-coordinator-3.default.svc.cluster.local 7687; do sleep 1; done | ||
until nc -z memgraph-data-0.default.svc.cluster.local 7687; do sleep 1; done | ||
until nc -z memgraph-data-1.default.svc.cluster.local 7687; do sleep 1; done | ||
echo "Pods are available for Bolt connection!" | ||
sleep 5 | ||
# Run the mgconsole commands | ||
echo "Running mgconsole commands..." | ||
echo 'ADD COORDINATOR 2 WITH CONFIG {"bolt_server": "memgraph-coordinator-2.default.svc.cluster.local:7687", "coordinator_server": "memgraph-coordinator-2.default.svc.cluster.local:12000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 | ||
echo 'ADD COORDINATOR 3 WITH CONFIG {"bolt_server": "memgraph-coordinator-3.default.svc.cluster.local:7687", "coordinator_server": "memgraph-coordinator-3.default.svc.cluster.local:12000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 | ||
echo 'REGISTER INSTANCE instance_1 WITH CONFIG {"bolt_server": "memgraph-data-0.default.svc.cluster.local:7687", "management_server": "memgraph-data-0.default.svc.cluster.local:10000", "replication_server": "memgraph-data-0.default.svc.cluster.local:20000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 | ||
echo 'REGISTER INSTANCE instance_2 WITH CONFIG {"bolt_server": "memgraph-data-1.default.svc.cluster.local:7687", "management_server": "memgraph-data-1.default.svc.cluster.local:10000", "replication_server": "memgraph-data-1.default.svc.cluster.local:20000"};' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 | ||
echo 'SET INSTANCE instance_1 TO MAIN;' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 | ||
sleep 3 | ||
echo "SHOW INSTANCES on coord1" | ||
echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-1.default.svc.cluster.local --port 7687 | ||
echo "SHOW INSTANCES on coord2" | ||
echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-2.default.svc.cluster.local --port 7687 | ||
echo "SHOW INSTANCES on coord3" | ||
echo 'SHOW INSTANCES;' | mgconsole --host memgraph-coordinator-3.default.svc.cluster.local --port 7687 | ||
echo "RETURN 0 on 1st data instance" | ||
echo 'RETURN 0;' | mgconsole --host memgraph-data-0.default.svc.cluster.local --port 7687 | ||
echo "RETURN 0 on 2nd data instance" | ||
echo 'RETURN 0;' | mgconsole --host memgraph-data-1.default.svc.cluster.local --port 7687 | ||
securityContext: | ||
runAsUser: 0 | ||
|
||
restartPolicy: Never | ||
backoffLimit: 4 |
Oops, something went wrong.