Redis Chart

Install redis chart

helm install stable/redis
NAME:   bulging-eel
LAST DEPLOYED: Wed Jan  2 17:56:09 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1beta2/StatefulSet
NAME                      DESIRED  CURRENT  AGE
bulging-eel-redis-master  1        1        1s

==> v1/Pod(related)
NAME                                      READY  STATUS             RESTARTS  AGE
bulging-eel-redis-slave-65f5b4cd77-glzx7  0/1    ContainerCreating  0         1s
bulging-eel-redis-master-0                0/1    Pending            0         1s

==> v1/Secret
NAME               TYPE    DATA  AGE
bulging-eel-redis  Opaque  1     1s

==> v1/ConfigMap
NAME                      DATA  AGE
bulging-eel-redis         3     1s
bulging-eel-redis-health  3     1s

==> v1/Service
NAME                      TYPE       CLUSTER-IP    EXTERNAL-IP  PORT(S)   AGE
bulging-eel-redis-master  ClusterIP  10.7.255.212  <none>       6379/TCP  1s
bulging-eel-redis-slave   ClusterIP  10.7.247.55   <none>       6379/TCP  1s

==> v1beta1/Deployment
NAME                     DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
bulging-eel-redis-slave  1        1        1           0          1s


NOTES:
** Please be patient while the chart is being deployed **
Redis can be accessed via port 6379 on the following DNS names from within your cluster:

bulging-eel-redis-master.default.svc.cluster.local for read/write operations
bulging-eel-redis-slave.default.svc.cluster.local for read-only operations


To get your password run:

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

To connect to your Redis server:

1. Run a Redis pod that you can use as a client:

   kubectl run --namespace default bulging-eel-redis-client --rm --tty -i --restart='Never' \
    --env REDIS_PASSWORD=$REDIS_PASSWORD \
   --image docker.io/bitnami/redis:4.0.12 -- bash

2. Connect using the Redis CLI:
   redis-cli -h bulging-eel-redis-master -a $REDIS_PASSWORD
   redis-cli -h bulging-eel-redis-slave -a $REDIS_PASSWORD

To connect to your database from outside the cluster execute the following commands:

    kubectl port-forward --namespace default svc/bulging-eel-redis 6379:6379 &
    redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD
kubectl get pods -o wide
NAME                                       READY   STATUS    RESTARTS   AGE   IP          NODE
bulging-eel-redis-master-0                 1/1     Running   0          3m    10.4.0.7    gke-admatic-cluster-default-pool-fa54777d-81w0
bulging-eel-redis-slave-65f5b4cd77-glzx7   1/1     Running   0          3m    10.4.1.10   gke-admatic-cluster-default-pool-fa54777d-0cv4

Test Redis

To get your password

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

To connect to your Redis server

Run a Redis pod that you can use as a client:

kubectl run --namespace default bulging-eel-redis-client --rm --tty -i --restart='Never' \
  --env REDIS_PASSWORD=$REDIS_PASSWORD \
  --image docker.io/bitnami/redis:4.0.12 -- bash
If you don't see a command prompt, try pressing enter.
I have no name!@bulging-eel-redis-client:/$

Connect to master using the Redis CLI

redis-cli -h bulging-eel-redis-master -a x9SDJOmEtv
Warning: Using a password with '-a' option on the command line interface may not be safe.
bulging-eel-redis-master:6379>

Set foo in master

set foo bar
OK
exit

Connect to slave using the Redis CLI

redis-cli -h bulging-eel-redis-slave -a x9SDJOmEtv
Warning: Using a password with '-a' option on the command line interface may not be safe.
bulging-eel-redis-slave:6379>

Get foo in slave

get foo
"bar"
exit
exit
pod "bulging-eel-redis-client" deleted

results matching ""

    No results matching ""