Skip to content

Commit

Permalink
Merge branch 'main' into add-node-selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
antejavor authored Nov 28, 2024
2 parents 905ef22 + bb43336 commit a24e68f
Show file tree
Hide file tree
Showing 18 changed files with 181 additions and 158 deletions.
4 changes: 2 additions & 2 deletions charts/memgraph-high-availability/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: memgraph-high-availability
description: A Helm chart for Kubernetes with Memgraph High availabiliy capabilites

version: 0.1.3
appVersion: "2.18.1"
version: 0.1.4
appVersion: "2.22.0"

type: application

Expand Down
87 changes: 51 additions & 36 deletions charts/memgraph-high-availability/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## Helm chart for Memgraph high availability cluster (Enterprise)
A Helm Chart for deploying Memgraph in [high availability setup](https://memgraph.com/docs/clustering/high-availability). This helm chart requires an enterprise version of Memgraph.
# Helm chart for Memgraph high availability (HA) cluster (Enterprise)
A Helm Chart for deploying Memgraph in [high availability setup](https://memgraph.com/docs/clustering/high-availability). This Helm Chart requires an [Enterprise version of Memgraph](https://memgraph.com/docs/database-management/enabling-memgraph-enterprise).

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.
Memgraph HA cluster includes 3 coordinators, 2 data instances by default. The cluster setup is performed via the cluster-setup job.

## Installing the Memgraph HA Helm Chart
To install the Memgraph HA Helm Chart, follow the steps below:
Expand All @@ -21,53 +20,69 @@ Or you can modify a `values.yaml` file and override the desired values:
helm install <release-name> memgraph/memgraph-high-availability -f values.yaml
```

## Running the Memgraph HA Helm Chart locally

To run Memgraph HA Helm Chart locally, affinity needs to be disabled because the cluster will be running on a single node.

To disable the affinity, run the following command with the specified set of flags:

```
helm install <release-name> memgraph/memgraph-high-availability --set memgraph.env.MEMGRAPH_ENTERPRISE_LICENSE=<your-license>,memgraph.env.MEMGRAPH_ORGANIZATION_NAME=<your-organization-name>,memgraph.affinity.enabled=false
```

The affinity is disabled either by running the command above, or by modifying the `values.yaml` file.


## 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` |
| 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.22.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` |
| `memgraph.externalAccess.serviceType` | NodePort or LoadBalancer. Use LoadBalancer for Cloud production deployment and NodePort for local testing | `LoadBalancer` |
| `memgraph.ports.boltPort` | Bolt port used on coordinator and data instances. | `7687` |
| `memgraph.ports.managementPort` | Management port used on coordinator and data instances. | `10000` |
| `memgraph.ports.replicationPort` | Replication port used on data instances. | `20000` |
| `memgraph.ports.coordinatorPort` | Coordinator port used on coordinators. | `12000` |
| `memgraph.affinity.enabled` | Enables affinity so each instance is deployed to unique node | `true` |
| `memgraph.affinity.unique` | Schedule pods on different nodes in the cluster | `false` |
| `memgraph.affinity.parity` | Schedule pods on the same node with maximum one coordinator and one data node | `false` |
| `memgraph.affinity.nodeSelection` | Schedule pods on nodes with specific labels | `false` |
| `memgraph.affinity.roleLabelKey` | Label key for node selection | `role` |
| `memgraph.affinity.dataNodeLabelValue` | Label value for data nodes | `data-node` |
| `memgraph.affinity.coordinatorNodeLabelValue` | Label value for coordinator nodes | `coordinator-node` |
| `data` | Configuration for data instances | See `data` section |
| `coordinators` | Configuration for coordinator instances | See `coordinators` section |

| `data` | Configuration for data instances | See `data` section |
| `coordinators` | Configuration for coordinator instances | See `coordinators` section |
| `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` |

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` | 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 |
| Parameter | Description | Default |
|---------------------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------|
| `id` | ID of the instance | `0` for data, `1` for coordinators |
| `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:

Expand Down
5 changes: 3 additions & 2 deletions charts/memgraph-high-availability/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ eksctl create cluster -f cluster.yaml`
```

should be sufficient. Make sure to change the path to the public SSH key if you want to have SSH access to EC2 instances. After creating the cluster, `kubectl` should pick up
the AWS context and you can verify this by running `kubectl context current-context`. My is pointing to `[email protected]`.
the AWS context and you can verify this by running `kubectl config current-context`. My is pointing to `[email protected]`.

## Add Helm Charts repository

Expand Down Expand Up @@ -57,7 +57,8 @@ aws eks describe-nodegroup --cluster-name test-cluster-ha --nodegroup-name stand
and then provide full access to it:

```
aws iam list-attached-role-policies --role-name eksctl-test-cluster-ha-nodegroup-s-NodeInstanceRole-<ROLE_ID_FROM_PREVIOUS_OUTPUT>
aws iam attach-role-policy --role-name eksctl-test-cluster-ha-nodegroup-s-NodeInstanceRole-<ROLE-ID> --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess
aws iam list-attached-role-policies --role-name eksctl-test-cluster-ha-nodegroup-s-NodeInstanceRole-<ROLE-ID>
```

It is also important to create Inbound Rule in the Security Group attached to the eksctl cluster which will allow TCP traffic
Expand Down
4 changes: 2 additions & 2 deletions charts/memgraph-high-availability/aws/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ managedNodeGroups:
instanceSelector: {}
instanceType: t3.small
labels:
alpha.eksctl.io/cluster-name: test-cluster-ha
alpha.eksctl.io/cluster-name: mg-ha
alpha.eksctl.io/nodegroup-name: standard-workers
maxSize: 5
minSize: 5
Expand All @@ -58,7 +58,7 @@ managedNodeGroups:
volumeThroughput: 125
volumeType: gp3
metadata:
name: test-cluster-ha
name: mg-ha
region: eu-west-1
version: "1.30"
privateCluster:
Expand Down
Loading

0 comments on commit a24e68f

Please sign in to comment.