neo4j / helm-charts

Apache License 2.0
59 stars 53 forks source link

[Bug]: Neo4j Helm config settings not applied from values.yaml #203

Closed ruempel closed 1 year ago

ruempel commented 1 year ago

Contact Details

ruempel@gmail.com

What happened?

I am using the neo4j/neo4j Helm chart in version 5.9.0 (this version was not available in the select box of the issue report). Consider the following values.yaml:

neo4j:
  name: neo4j
  resources:
    cpu: "2.0"
    memory: "3Gi"

config.server.memory.heap.initial_size: "1300m"
config.server.memory.heap.max_size: "1300m"
config.server.memory.pagecache.size: "512m"
config.db.temporal.timezone: "Europe/Berlin"

jvm.additionalJvmArguments:
  - "-XX:+ExitOnOutOfMemoryError"

volumes:
  data:
    mode: defaultStorageClass

When I apply these values to my neo4j Helm release with helm upgrade, none of the config settings (memory, timezone and JVM arguments) are applied. I tested it with this kind of CYPHER queries:

SHOW SETTINGS
YIELD name, value
WHERE name CONTAINS 'memory'
RETURN name, value
ORDER BY name

It shows "No Value" for the memory settings and Z as the default time zone.

I expected the config settings from values.yaml to be applied after helm upgrade. I took the config keys from https://neo4j.com/docs/operations-manual/current/kubernetes/configuration/#_config. Am I using the wrong keys or is it a bug?

Chart Name

Standalone

Chart Version

5.5.0

Environment

My environment is not listed

Relevant log output

No response

Code of Conduct

harshitsinghvi22 commented 1 year ago

@ruempel

I just tried the below config and it seems to be working absolutely fine for me.

neo4j:
  name: neo4j
  edition: "enterprise"
  acceptLicenseAgreement: "yes"
  resources:
    cpu: "2.0"
    memory: "3Gi"

config:
  server.memory.heap.initial_size: "800m"
  server.memory.heap.max_size: "800m"
  server.memory.pagecache.size: "512m"
  db.temporal.timezone: "Europe/Berlin"

jvm:
   additionalJvmArguments:
  - "-XX:+ExitOnOutOfMemoryError"

volumes:
  data:
    mode: defaultStorageClass

You can also use the below cypher query to get the results.

CALL dbms.listConfig('server.memory') YIELD name,value;
CALL dbms.listConfig('db.temporal') YIELD name,value;
Screenshot 2023-07-27 at 17 31 01
ruempel commented 1 year ago

Thank you! It turned out that this works:

config:
  server.memory.heap.initial_size: "1300m"
  server.memory.heap.max_size: "1300m"
  server.memory.pagecache.size: "512m"
  db.temporal.timezone: "Europe/Berlin"

and this does not work:

config.server.memory.heap.initial_size: "1300m"
config.server.memory.heap.max_size: "1300m"
config.server.memory.pagecache.size: "512m"
config.db.temporal.timezone: "Europe/Berlin"

So it depends on how you use the YAML feature of combining equal prefixes of the keys. Maybe you could add a hint in the documentation on this issue?

Can you verify that this setting also works for you? It does not work for me currently, when I test it with CALL dbms.listConfig('server.jvm.additional') YIELD name,value;:

jvm.additionalJvmArguments:
  - "-XX:+ExitOnOutOfMemoryError"
harshitsinghvi22 commented 1 year ago

@ruempel

Did you see anywhere in the documentation the config being referred to as the below ?

config.server.memory.heap.initial_size: "1300m"
config.server.memory.heap.max_size: "1300m"
config.server.memory.pagecache.size: "512m"
config.db.temporal.timezone: "Europe/Berlin"

If yes, please let me know and we can get it fixed. If not , please follow the recommended way. I have checked the link provided by you and its referring to the recommended way.

Recommended way:

config:
  server.memory.heap.initial_size: "800m"
  server.memory.heap.max_size: "800m"
  server.memory.pagecache.size: "512m"
  db.temporal.timezone: "Europe/Berlin"

jvm:
  additionalJvmArguments:
  - "-XX:+ExitOnOutOfMemoryError"

I am not sure the approach of combining maps keys in yaml files will work however i tried this and it worked through the command line but its complicated and I would discourage the below usage. Use yaml files with the described syntax and it should work appropriately

 helm upgrade standalone neo4j/neo4j --set config."server\.memory\.heap\.initial_size"="1300m" -f neo4j.yaml

Also the jvm is failing for you because of incorrect syntax in the yaml file. Try this and it should work

jvm:
  additionalJvmArguments:
  - "-XX:+ExitOnOutOfMemoryError"
Screenshot 2023-07-28 at 10 12 41
ruempel commented 1 year ago

You are right, adjusting the config to the suggested key syntax made it work. Thank you.