72

Running Redis TLS with Docker-compose

 2 years ago
source link: https://tienbm90.medium.com/running-redis-tls-with-docker-compose-b89811fb01d3
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Responses (1)

There are currently no responses for this story.

Be the first to respond.

Running Redis TLS with Docker-compose

As you know, SSL/TLS is supported by Redis starting with version 6 as an optional feature (https://redis.io/topics/encryption).

In this tutorial, i will rewrite my setup to run test TLS with Redis 6.

Full version of code here

Build custom image to use custom configuration file

Dockerfile:

FROM redis:6.2.0
CMD [ “redis-server”, “/usr/local/etc/redis/redis.conf”]

Build new image:

docker build -t redis-tls-test:6.2.0 .

Build custom image to use custom configuration file

bash gen-test-certs.sh

Create configuration file for each redis instance (example node-0)

Create compose file:

Create clusters

cd ./tests/tls
redis-cli --cluster create 127.0.0.1:7379 127.0.0.1:7380 127.0.0.1:7381 127.0.0.1:7382 127.0.0.1:7383 127.0.0.1:7384 --cluster-replicas 1 --tls -a redisTLSTest2021@@ --cert redis.crt --key redis.key --cacert ca.crt

Check status of new cluster:

redis-cli -p 7379 -a redisTLSTest2021@@ --cert redis.crt --key redis.key --cacert ca.crt --tls cluster nodes

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK