Skip to content

Commit

Permalink
Add support for Load balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
as51340 committed Nov 25, 2024
1 parent 0cad7da commit 15a6fa8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
11 changes: 6 additions & 5 deletions charts/memgraph-high-availability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The following table lists the configurable parameters of the Memgraph chart and
| 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.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>` |
Expand All @@ -48,6 +48,11 @@ The following table lists the configurable parameters of the Memgraph chart and
| `memgraph.coordinators.volumeClaim.logPVC` | Enable log PVC for coordinators | `false` |
| `memgraph.coordinators.volumeClaim.logPVCSize` | Size of the log PVC for coordinators | `256Mi` |
| `memgraph.affinity.enabled` | Enables affinity so each instance is deployed to unique node | `true` |
| `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` |
| `data` | Configuration for data instances | See `data` section |
| `coordinators` | Configuration for coordinator instances | See `coordinators` section |

Expand All @@ -56,10 +61,6 @@ For the `data` and `coordinators` sections, each item in the list has the follow
| 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 |

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
6 changes: 4 additions & 2 deletions charts/memgraph-high-availability/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ The cluster setup requires the proper enterprise license to work since HA is an
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:
If you are using NodePort as the service type for the external access, use node IP and node port to connect. Example using mgconsole:
mgconsole --host=<NODE-IP> --port=<NODE-PORT>

mgconsole --host <your-instance-ip> --port <your-instance-port>
If you are using LoadBalancer as the service type for the external access, use IP of the load balancer and its target port to connect. Example using mgconsole:
mgconsole --host=<LOAD-BALANCER-IP> --port=<TARGET-PORT>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ kind: Service
metadata:
name: external-access
spec:
{{- if eq $.Values.memgraph.externalAccess.serviceType "NodePort"}}
type: NodePort
{{- else }}
type: LoadBalancer
{{- end }}
selector:
instance-type: coordinator
ports:
Expand Down
3 changes: 3 additions & 0 deletions charts/memgraph-high-availability/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ memgraph:
managementPort: 10000
replicationPort: 20000
coordinatorPort: 12000
externalAccess:
serviceType: "LoadBalancer"


data:
- id: "0"
Expand Down

0 comments on commit 15a6fa8

Please sign in to comment.