how to deploy redis cluster on kubernetes1.19

  1. apply statefulset.yaml and create cluster

    curl -LO https://chenshi.net/redis-sts.yaml
    vi redis-sts.yaml
    kubectl apply -f redis-sts.yaml
    kubectl get pods -l app=redis-cluster -o jsonpath='{range.items[*]}{.status.podIP}:6379 '
    kubectl exec -it redis-cluster-0 -- redis-cli --cluster create --cluster-replicas 1 ips:ports
    
  2. references:

    https://rancher.com/blog/2019/deploying-redis-cluster

    https://stackoverflow.com/questions/58528831/is-it-possible-to-create-a-redis-cluster-within-kubernetes-using-a-istio-search

    https://redis-py-cluster.readthedocs.io/en/stable/