github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/redis/README.md (about) 1 # Overview 2 3 This image chooses OpenEBS Jiva as its persistence storage engine. 4 5 Components included in this image: 6 7 * 1 StatefulSet with 3 replicas for redis cluster which requests "50Gi" storage. 8 9 ## How to use it 10 11 Redis™ can be accessed via port 6379 on the following DNS name from within your cluster: 12 13 ``` 14 my-myredis.redis-system.svc.cluster.local for read only operations 15 ``` 16 17 For read/write operations, first access the Redis™ Sentinel cluster, which is available in port 26379 using the 18 same domain name above. 19 20 To get your password run: 21 22 ``` 23 export REDIS_PASSWORD=$(kubectl get secret --namespace redis-system my-myredis -o jsonpath="{.data.redis-password}" | base64 --decode) 24 ``` 25 26 To connect to your Redis™ server: 27 28 1. Run a Redis™ pod that you can use as a client: 29 30 ``` 31 kubectl run --namespace redis-system redis-client --restart='Never' --env REDIS_PASSWORD=$REDIS_PASSWORD --image docker.io/bitnami/redis:6.2.5-debian-10-r11 --command -- sleep infinity 32 ``` 33 34 Use the following command to attach to the pod: 35 36 ``` 37 kubectl exec --tty -i redis-client --namespace redis-system -- bash 38 ``` 39 40 2. Connect using the Redis™ CLI: 41 42 ``` 43 redis-cli -h my-myredis -p 6379 -a $REDIS_PASSWORD # Read only operations redis-cli -h my-myredis -p 26379 -a $REDIS_PASSWORD # Sentinel access 44 ``` 45 46 To connect to your database from outside the cluster execute the following commands: 47 48 ``` 49 kubectl port-forward --namespace redis-system svc/my-myredis 6379:6379 & 50 redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD 51 ``` 52 53 ## How to rebuild it use helm 54 55 Kubefile: 56 57 ```shell 58 FROM registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-jiva:2.11.0 59 # add helm repo and run helm install 60 RUN helm repo add bitnami https://charts.bitnami.com/bitnami 61 # set persistence.storageClass=openebs-jiva-csi-sc, which is provided by base image openebs-jiva:2.11.0. 62 CMD helm install my-redis --create-namespace --namespace redis-system --set master.persistence.storageClass=openebs-jiva-csi-sc --set replica.persistence.storageClass={Your Stroage Class} --set sentinel.enabled=true bitnami/redis --version 15.3.0 63 ``` 64 65 run below command to build it 66 67 ```shell 68 sealer build -t {Your Image Name} -f Kubefile -m cloud . 69 ``` 70 71 More parameters see [official document here](https://artifacthub.io/packages/helm/bitnami/redis).