neo4j / helm-charts

Apache License 2.0
59 stars 52 forks source link

[Bug]: Configmaps are not properly injected into the pods #151

Closed mslagle closed 1 year ago

mslagle commented 1 year ago

Contact Details

mslagle777@gmail.com

What happened?

The configmaps are not being properly injected. When I browse to the /config/ directory, the path neo4j.conf is NOT a file, instead it is a directory with the properties as files.

Due to this, any properties added via .Values.config will not be present because the user supplied configuration values cannot be read. I have used both 5.2.0 and 5.5.0 helm charts and both show the same issue.

Chart Name

Standalone

Chart Version

5.5.0

Environment

Google Cloud Platform

Relevant log output

cd /config
ls
neo4j.conf server-logs.xml user-logs.xml

cat neo4j.conf
cat: neo4j.conf: Is a directory

cd neo4j.conf
ls
db.tx_log.rotation.retention_policy   server.bolt.connection_keep_alive   server.config.strict_validation.enabled server.http.enabled  server.logs.user.config     server.metrics.prometheus.endpoint
dbms.ssl.policy.bolt.client_auth   server.bolt.connection_keep_alive_for_requests   server.default_listen_address    server.https.enabled  server.metrics.graphite.enabled  server.panic.shutdown_on_panic
dbms.ssl.policy.https.client_auth   server.bolt.connection_keep_alive_streaming_scheduling_interval server.directories.import    server.jvm.additional server.metrics.jmx.enabled     server.windows_service_name
internal.dbms.ssl.system.ignore_dot_files server.bolt.enabled   server.directories.logs    server.logs.config   server.metrics.prometheus.enabled

cat server.metrics.prometheus.enabled
true

Code of Conduct

mslagle commented 1 year ago

Until this is fixed, I am unable to enable prometheus metrics. Am I able to override the prometheus setting by overriding an environment variable? Should this work?

env:
  NEO4J_server_metrics_prometheus_enabled: true
harshitsinghvi22 commented 1 year ago
neo4j:
  name: prometheus
  acceptLicenseAgreement: "yes"
  edition: enterprise
  password: my-password
config:
  server.metrics.prometheus.enabled: "true"

@mslagle the above seems to be working just fine for me with 5.5.0 helm charts

When the above config is provide the admin cluster ip will have the 2004 port opened as well

Also i can see the configs getting populated and can be verified in the browser

Screenshot 2023-03-03 at 09 41 04

Screenshot 2023-03-03 at 09 42 13

mslagle commented 1 year ago

@harshitsinghvi22 can you still also check the /config folder on the actual containers? I will check my local configuration as well, but I dont think the properties for the extended config should be files.

mslagle commented 1 year ago

@harshitsinghvi22 I am still having the issue. The prometheus config is not coming into neo4j. Yes the admin service endpoint is created, however the config never is loaded into neo4j. This causes the admin endpoint not to work since the core application is not exposing metrics.

As you can see, the configmap does have the property there, but because the the volumemounts do not properly load in the configmap data, the extended configs are never loaded.

image001 image002

harshitsinghvi22 commented 1 year ago

As I shared the screenshot earlier it's loading perfectly well...not sure if there is some issue with your setup.

I can try and upload a video for you which demonstrate installing the helm charts with Prometheus config in 5.5.0

harshitsinghvi22 commented 1 year ago

closing this issue as it is not reproducible and the configs are loading fine

janesenaj42 commented 7 months ago

Contact Details

mslagle777@gmail.com

What happened?

The configmaps are not being properly injected. When I browse to the /config/ directory, the path neo4j.conf is NOT a file, instead it is a directory with the properties as files.

Due to this, any properties added via .Values.config will not be present because the user supplied configuration values cannot be read. I have used both 5.2.0 and 5.5.0 helm charts and both show the same issue.

Chart Name

Standalone

Chart Version

5.5.0

Environment

Google Cloud Platform

Relevant log output

cd /config
ls
neo4j.conf server-logs.xml user-logs.xml

cat neo4j.conf
cat: neo4j.conf: Is a directory

cd neo4j.conf
ls
db.tx_log.rotation.retention_policy   server.bolt.connection_keep_alive   server.config.strict_validation.enabled server.http.enabled  server.logs.user.config     server.metrics.prometheus.endpoint
dbms.ssl.policy.bolt.client_auth   server.bolt.connection_keep_alive_for_requests   server.default_listen_address    server.https.enabled  server.metrics.graphite.enabled  server.panic.shutdown_on_panic
dbms.ssl.policy.https.client_auth   server.bolt.connection_keep_alive_streaming_scheduling_interval server.directories.import    server.jvm.additional server.metrics.jmx.enabled     server.windows_service_name
internal.dbms.ssl.system.ignore_dot_files server.bolt.enabled   server.directories.logs    server.logs.config   server.metrics.prometheus.enabled

cat server.metrics.prometheus.enabled
true

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

I observed the same thing when trying to install the GDS plugin. Below is a snippet of my configuration:

# neo4j-values.yaml
config:
  dbms.security.procedures.unrestricted: "gds.*"
  dbms.security.procedures.allowlist: "gds.*"

volumes:
  data:
    # your data volume configuration
    ...
  plugins:
    mode: "share"
    share:
      name: "data"

Followed the steps in this guide and the jar does persist in/plugins after pod restarts, but the dbms.security.procedures.unrestricted and dbms.security.procedures.allowlist settings are not found in /var/lib/neo4j/conf/neo4j.conf. The setting is found in /config as separate files instead of a single neo4j.conf.

server.directories.plugins=/plugins is present in var/lib/neo4j/conf/neo4j.conf but even after restarting the pod with the jars in /plugins folder, the plugin is not loaded.

Unfortunately the setup has no internet access. As such, the following solution (simplest method imo) does not work:

env:
  NEO4J_PLUGINS: '["graph-data-science"]'

For those looking for a solution, I gave up and just build the plugin jars into the docker image as specified in this guide (not my first choice as a new container needs to be built every time the plugin updates).

janesenaj42 commented 7 months ago

I think what happened is that neo4j is reading the config from /config, butserver.directories.plugins`. Hence a quick fix is to simply add the config.

# neo4j-values.yaml
config:
  dbms.security.procedures.unrestricted: "gds.*"
  dbms.security.procedures.allowlist: "gds.*"
  server.directories.plugins: "/plugins" # <- need this line!

volumes:
  data:
    # your data volume configuration
    ...
  plugins:
    mode: "share"
    share:
      name: "data"