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 configMap for configuration #1

Open
foodiq-pk opened this issue Aug 3, 2023 · 1 comment
Open

Memgraph configMap for configuration #1

foodiq-pk opened this issue Aug 3, 2023 · 1 comment
Assignees

Comments

@foodiq-pk
Copy link

Hi,

I would like to discuss a way of configuring memgraph using a configMap or possibly combining current approach with startup args with the configuration in values.yaml

What I currently use:

# values.yaml excerpt
config:  
  options:
    storage-properties-on-edges: true
    log-level: WARNING
    also-log-to-stderr: true
    data-directory: /var/lib/memgraph/
    log-file: /var/log/memgraph/memgraph.log
    memory-limit: 4096
    memory-warning-threshold: 1024
    storage-snapshot-on-exit: true
    storage-recover-on-startup: true
    storage-snapshot-interval-sec: 300
    storage-gc-cycle-sec: 30
    storage-snapshot-retention-count: 3
    storage-wal-enabled: true
    storage-wal-file-flush-every-n-tx: 100000
    storage-wal-file-size-kib: 20480
    query-plan-cache-ttl: 31536000
    query-max-plans: 1000

Then configMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: memgraph-config
data:
  {{- $options := .Values.config.options }}
  memgraph.conf: |
  {{- range $key, $value := $options }}
    --{{ $key }}={{ $value }}
  {{- end }}

The above function translate the key: vaule pairs into the memgraph.conf format options --key=value

and finally volume mount for the StatefulSet.yaml

    spec:
      ...
      containers:
        - name: memgraph
          ...
          volumeMounts:
            ....
            - name: memgraph-etc-config
              mountPath: /etc/memgraph/memgraph.conf
              subPath: memgraph.conf
      volumes:
        ...
        - name: memgraph-etc-config
          configMap:
            name: memgraph-config

IMHO the approach where you specify the key: value in yaml values is a bit more approachable than the --key=value format.

There might be issue where if you dont specify all the options memgraph seems to grab hardcoded default values instead of values of the default memgraph.conf as specified in the docs

It might be better approach combining using the added args to the launch arguments as is in the current state

e.g.

config:
  log-level: WARNING
  also-log-to-stderr:true

into args line

--log-level=WARNING --also-log-to-stderr=true

and pass that to args for startup

@antejavor antejavor self-assigned this Aug 7, 2023
@antejavor
Copy link
Collaborator

Hi @foodiq-pk, this is a great suggestion and a much better solution. 🙌 I spent a few hours looking into this when we pushed the initial chart, but we decided to do that for the next iteration.

We will add this/or something like this in the upcoming weeks, thanks for the recommendation.

@antejavor antejavor added this to the v0.1.2 milestone Aug 25, 2023
@antejavor antejavor modified the milestones: v0.1.2, v0.1.3. Apr 25, 2024
@antejavor antejavor modified the milestones: v0.1.3., v0.1.4 May 16, 2024
@antejavor antejavor modified the milestones: v0.1.4, Memgraph-0.1.4 Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants