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

[helm chart][k8s] Connections from connections.local_production_json are ignored #565

Open
JuroOravec opened this issue Mar 25, 2024 · 1 comment

Comments

@JuroOravec
Copy link

JuroOravec commented Mar 25, 2024

Problem:

I'm not able to configure Redis connection through helm chart via connections.local_production_json. I wanted to use connections.local_production_json so I can configure multiple connections with passwords.

Context:

  1. I used the helm chart v0.6.0 to deploy Redis Commander.

  2. I set the values.yaml file based on the example like so:

    Click to toggle values.yaml
    replicaCount: 1
    
    serviceAccount:
      create: true
    
    connections:
      local_production_json:
        noSave: false
        noLogData: false
        # ui:
        #   foldingChar: "|"
        redis:
          readOnly: true
        # server:
        #   clientMaxBodySize: "500kb"
        #   httpAuth:
        #     username: "the-user"
        #     password: "is-secret"
        connections:
          - label: "redis"
            host: "redis-master.redis.svc.cluster.local"
            port: "6379"
            password: 'MY_PASSWORD'
            dbIndex: 0
  3. I confirmed that the configmap resource was successfully created

  4. I confirmed that the configmap was successfully mounted

    Screenshot 2024-03-25 at 10 31 08
  5. At this point, the UI was showing only connection local (localhost:6739:0). This is NOT the connection I defined in local_production_json.

    Screenshot 2024-03-25 at 10 39 09
  6. I verified that the connection in my values.yaml file was correct by manually adding it:

    Screenshot 2024-03-25 at 10 40 24
  7. After I manually added the connection, it was added to the local-production.json

    Screenshot 2024-03-25 at 10 48 10

    And here's example what the logs look like at the point where I manually added the connection. All the connection errors are coming from trying to conenect to localhost:6739:0, which I did NOT configure:

    Screenshot 2024-03-25 at 10 48 56
@JuroOravec
Copy link
Author

Ok, I found that the config file is loaded depending on the NODE_ENV env var, and that currently NODE_ENV env var is NOT used for anything else in this project. So I was able to fix this by explicitly setting NODE_ENV=production-docker, so that the config file generated by helm chart is used.

So my updated values.yaml file looks like so:

replicaCount: 1

serviceAccount:
  create: true

# THIS WAS ADDED!
env:
  - name: NODE_ENV
    value: "production-docker"

connections:
  local_production_json:
    noSave: false
    noLogData: false
    # ui:
    #   foldingChar: "|"
    redis:
      readOnly: true
    # server:
    #   clientMaxBodySize: "500kb"
    #   httpAuth:
    #     username: "the-user"
    #     password: "is-secret"
    connections:
      - label: "redis"
        host: "redis-master.redis.svc.cluster.local"
        port: "6379"
        password: 'MY_PASSWORD'
        dbIndex: 0

So, now that there's a solution, how can we fix this?

Could we at minimum add this information to the Helm chart README?

Or better yet, update the chart to configure the NODE_ENV env var automatically?

Let me know your thoughts and I can make the changes if it's simple changes.

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

1 participant