Skip to content

Conversation

@omrozowicz-splunk
Copy link
Contributor

@omrozowicz-splunk omrozowicz-splunk commented Oct 13, 2025

Description

This PR:

  1. Removes bitnami redis dependency
  2. Upgrade redis version to the newest
  3. Add redis authentication — both plain text and secret

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Dependency update
  • Refactor/improvement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

TBD

Checklist

  • My commit message is conventional
  • I have run pre-commit on all files before creating the PR
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@omrozowicz-splunk omrozowicz-splunk marked this pull request as ready for review October 14, 2025 12:57
{{- if .Values.redis.auth.enabled }}
env:
- name: REDIS_PASSWORD
{{- if or .Values.redis.auth.existingSecret }}
Copy link

@Kawron Kawron Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"or" with single value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

args:
- |
# Copy config to writable location
cp /etc/redis/redis.conf /tmp/redis.conf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do this? We shouldn't have to save the password as it is already done in the config map.

And if someone will change the config map, the /etc/redis/redis.conf file will be updated but not the /tmp/redis.conf so for changes to apply the redis container has to be restarted.

So maybe we should stick to the original file, or add to the documentation that the redis has to be restared each time someone changes the config map?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in every case when we use secrets this is the scenario that you have to recreate pods in order for them to mount a new secret (same with configmap). I think it is a good idea to add it to the documentation.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restart requirement can be avoided if in the statefulset's pod tempate we add an annotation that includes a checksum of the configmap's values with something like below:

checksum/config: {{ include (print $.Template.BasePath "templates/redis/redis-config.yaml") . | sha256sum }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @mattk42, thanks for the comment! 😄 I updated the template and tested — it works fine.
But in this case it'd be more beneficial to have such annotation for secrets. The only thing is that then we'd need to include such annotation on almost every pod (as all of them connect to the redis and have redis secret being mounted to it in order to calculate the connection string). Does it make sense? Is this how it should be done? The alternative way is to document that user has to recreate pods after changing secret's value.

Also, it would be difficult to calculate it as we can either have secret created from the /redis-redis-secret.yaml or the secret passed by the redis.auth.existingSecret

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that would be challenging and would add to the complexity of the chart as a whole. Personally I do really like automating the restarts, but it may not be worth the complexity in this case especially if it does not happen often.

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

Successfully merging this pull request may close these issues.

3 participants