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

Chart using incorrect REDIS_HOST for HA #2365

Open
JonnyBDev opened this issue Sep 2, 2024 · 0 comments
Open

Chart using incorrect REDIS_HOST for HA #2365

JonnyBDev opened this issue Sep 2, 2024 · 0 comments

Comments

@JonnyBDev
Copy link

JonnyBDev commented Sep 2, 2024

Describe the bug

The Helm chart for Kubernetes is using a incorrect service name for a selfhosted instance because of a missing templating variable.

For selfhosted environment you need a Postgres and a Redis instance. The chart offers two deployment-options: deploy a dependency for Postgres + Redis with Infisical or adjust the values.yml for a external instance. If you want a single Infisical instance with a potential SPOF you can go with the dependency option. If you'd like the HA option, you have to spin up your own Postgres and Redis. That's fine. But I've noted, that the Redis host is not used if configured like mentioned in the Docs. For Postgres everything if working fine, but the hostname for Redis is hardcoded.

In the infisical.yaml you are including the infisical.redisConnectionString. The redisConnectionString is coming from the _helpers.tpl. In line 105 you are setting a serviceName which is getting generated in line 94. The serviceName that's been used is either coming from a fullnameOverride in the infisical.yaml or is using the infisical release name. Both option are okay for the "simple dependency" option, but not the HA option where I have or want to define my own Redis URL for an external HA instance for example like for my Postgres.

In the Self-hosted Infisical - Configurations - Data Layer you are marking the REDIS_URL as required but you are not using it. In _helpers.tpl L105 you are defining a serviceName but in _helpers.tpl L106 you are not replacing the second variable. Instead redis-master is getitng used.

Could be possible that the last is not 100% correct - not a templating master. But you are using $password in the string but not $serviceName.

To summarize things: I think the _helpers.tpl is not replacing the serviceName variable correctly and therefore is returning a incorrect infisical.redisConnectionString which is fine for a selfhosted Infisical setup with the batteries included Postgres and Redis but not for a setup where I want to provide my own (HA) Redis instance. Additionally in the definition of the redisServiceName you are only calculating your own Redis service name.

To Reproduce

Steps to reproduce the behavior:

  1. Setup your own Redis + Postgres + Infisical
  2. Use the REDIS_URL like described in kubernetes-helm / Configure environment variables / 4. Production deployment
  3. Watch logs for Infisical trying to connect to the host redis-master

Expected behavior

Use the correct REDIS_HOST

Screenshots

If applicable, add screenshots to help explain your problem.

Platform you are having the issue on:

Kubernetes with external Redis + Postgres + v0.78.0-postgres

Additional context

https://infisical-users.slack.com/archives/C04BSBMQAQ7/p1723062364163469
https://infisical-users.slack.com/archives/C04BSBMQAQ7/p1723063222026809

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