Skip to content

Commit

Permalink
Add management flag options to K8 operator
Browse files Browse the repository at this point in the history
  • Loading branch information
as51340 committed Jul 23, 2024
1 parent 089b940 commit 9159e7e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 34 deletions.
76 changes: 46 additions & 30 deletions config/samples/memgraph_v1_ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,84 +3,102 @@ kind: MemgraphHA
metadata:
name: memgraphha-sample
spec:
# Default values copied from <project_dir>/helm-charts/memgraph-high-availability/values.yaml
coordinators:
- args:
- id: "1"
boltPort: 7687
managementPort: 10000
coordinatorPort: 12000
args:
- --experimental-enabled=high-availability
- --coordinator-id=1
- --coordinator-port=12000
- --management-port=10000
- --bolt-port=7687
- --also-log-to-stderr
- --log-level=TRACE
- --coordinator-hostname=memgraph-coordinator-1.default.svc.cluster.local
- --log-file=/var/log/memgraph/memgraph.log
- --nuraft-log-file=/var/log/memgraph/memgraph.log

- id: "2"
boltPort: 7687
managementPort: 10000
coordinatorPort: 12000
id: "1"
- args:
args:
- --experimental-enabled=high-availability
- --coordinator-id=2
- --coordinator-port=12000
- --management-port=10000
- --bolt-port=7687
- --also-log-to-stderr
- --log-level=TRACE
- --coordinator-hostname=memgraph-coordinator-2.default.svc.cluster.local
- --log-file=/var/log/memgraph/memgraph.log
- --nuraft-log-file=/var/log/memgraph/memgraph.log

- id: "3"
boltPort: 7687
managementPort: 10000
coordinatorPort: 12000
id: "2"
- args:
args:
- --experimental-enabled=high-availability
- --coordinator-id=3
- --coordinator-port=12000
- --management-port=10000
- --bolt-port=7687
- --also-log-to-stderr
- --log-level=TRACE
- --coordinator-hostname=memgraph-coordinator-3.default.svc.cluster.local
boltPort: 7687
coordinatorPort: 12000
id: "3"
- --log-file=/var/log/memgraph/memgraph.log
- --nuraft-log-file=/var/log/memgraph/memgraph.log


data:
- args:
- id: "0"
boltPort: 7687
managementPort: 10000
replicationPort: 20000
args:
- --experimental-enabled=high-availability
- --management-port=10000
- --bolt-port=7687
- --also-log-to-stderr
- --log-level=TRACE
- --replication-restore-state-on-startup=true
- --log-file=/var/log/memgraph/memgraph.log

- id: "1"
boltPort: 7687
id: "0"
managementPort: 10000
replicationPort: 20000
- args:
args:
- --experimental-enabled=high-availability
- --management-port=10000
- --bolt-port=7687
- --also-log-to-stderr
- --log-level=TRACE
- --replication-restore-state-on-startup=true
boltPort: 7687
id: "1"
managementPort: 10000
replicationPort: 20000
- --log-file=/var/log/memgraph/memgraph.log

memgraph:
coordinators:
data:
volumeClaim:
logPVC: false
logPVCClassName: ""
logPVCSize: 256Mi
storagePVC: false
storagePVCClassName: ""
storagePVC: true
storagePVCSize: 1Gi
data:
logPVCClassName: ""
logPVC: true
logPVCSize: 256Mi
coordinators:
volumeClaim:
logPVC: false
logPVCClassName: ""
logPVC: false # TODO: (andi) Fix
logPVCSize: 256Mi
storagePVC: false
storagePVCClassName: ""
storagePVC: true
storagePVCSize: 1Gi

env:
MEMGRAPH_ENTERPRISE_LICENSE: ""
MEMGRAPH_ORGANIZATION_NAME: ""
MEMGRAPH_ENTERPRISE_LICENSE: "${MEMGRAPH_ENTERPRISE_LICENSE}"
MEMGRAPH_ORGANIZATION_NAME: "${MEMGRAPH_ORGANIZATION_NAME}"
image:
pullPolicy: IfNotPresent
repository: memgraph/memgraph
Expand All @@ -95,5 +113,3 @@ spec:
startup:
failureThreshold: 30
periodSeconds: 10


15 changes: 11 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@ kubectl get crds -A

## Start Memgraph High Availability Cluster

We already provide sample cluster in `config/samples/memgraph_v1_ha.yaml`. You only need to set your license information by setting
`MEMGRAPH_ORGANIZATION_NAME` and `MEMGRAPH_ENTERPRISE_LICENSE` environment variables in the sample file.
We already provide sample cluster in `config/samples/memgraph_v1_ha.yaml`. You only need to set your license information by setting
environment variables `MEMGRAPH_ORGANIZATION_NAME` and `MEMGRAPH_ENTERPRISE_LICENSE` in your local environment with:

```bash
export MEMGRAPH_ORGANIZATION_NAME="<YOUR_ORGANIZATION_NAME>"
export MEMGRAPH_ENTERPRISE_LICENSE="<MEMGRAPH_ENTERPRISE_LICENSE>"
```

Start Memgraph HA cluster with `envsubst < config/samples/memgraph_v1_ha.yaml | kubectl apply -f -`. (The `envsubst command` is a part of the gettext package.)
Instead of using `envsubst` command, you can directly set environment variables in `config/samples/memgraph_v1_ha.yaml`.

Start Memgraph HA cluster with `kubectl apply -f config/samples/memgraph_v1_ha.yaml`.

After approx. 60s, you should be able to see instances in the output of `kubectl get pods -A`:
After ~40s, you should be able to see instances in the output of `kubectl get pods -A`:


You can now find URL of any coordinator instances by running e.g `minikube service list` and connect to see the state of the cluster by running
Expand Down

0 comments on commit 9159e7e

Please sign in to comment.