<p>need some recommendations. I have the redis servers deployed in K8s and they are without the password/authentication. I need to work on adding the passwords to the redis servers and at the same time make sure that to the clients/services using that redis servers also get it. Has anyone come across this use case? #redis</p>

Batman 21
<p>Hey for this purpose you should use a <strong>Kubernetes Secret</strong> that you mount into your redis container. It can be also mounted into different containers.</p>
<p>This would be my approach:</p>
<p>First, you'll need to enable authentication on your Redis servers. This can be done by modifying the <strong>redis.conf</strong>. you can provide a password in the configuration file using the <strong>requirepass</strong> directive.</p>
<p>Once you've configured Redis to use authentication, you'll need to update the Kubernetes deployment to use the new configuration. You can use a <strong>Configmap</strong> containing the <strong>redis.conf</strong> file, including the <strong>requirepass</strong> directive with the password you choose. Then Modify the Redis deployment YAML to mount the ConfigMap containing the updated redis.conf into the Redis Pod.</p>
<p>Next step is to store the Redis authentication password as a Kubernetes Secret and <strong>inject it into the client containers as environment variables or volume mounts</strong>. This way, the Redis clients can access the password securely and use it to authenticate. <em>You can define the secret with kubectl or helm.</em></p>
<p>As last step perform an update of your clients and server Deployments and test out the solution.</p>
<p><em>Please comment and I can provide you more detailed code examples. This is just a bit of how I would approach it.</em></p>
