Friday, October 8, 2021

kubernetes + helm + redis

kubectl create ns redis

helm install redis --set global.storageClass=MY_STORAGE_CLASS bitnami/redis -n redis


export REDIS_PASSWORD=$(kubectl get secret --namespace redis redis -o jsonpath="{.data.redis-password}" | base64 --decode)


kubectl run --namespace redis redis-client --restart='Never'  --env REDIS_PASSWORD=$REDIS_PASSWORD  --image docker.io/bitnami/redis:6.2.5-debian-10-r63 --command -- sleep infinity


kubectl exec --tty -i redis-client --namespace redis -- bash

$ redis-cli -h redis-master -a $REDIS_PASSWORD

Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.

redis-master:6379> ping

PONG

redis-master:6379>