Adding helm chart & documentation for redis-cluster related study ticket
[ric-plt/ric-dep.git] / helm / redis-cluster / templates / NOTES.txt
1 1.  Important: You must wait to ensure that all {{ .Values.rediscluster.replicaCount }} instances of redis are in "Running" state. You can use below command to watch if all the required instances are ready
2
3 watch "kubectl -n {{ .Release.Namespace }} get po -l app.kubernetes.io/instance={{ .Release.Name }}"
4
5 2. Run below command to create redis-cluster.
6
7 kubectl -n {{ .Release.Namespace }} exec -it {{ .Values.rediscluster.name }}-0  -- sh -c "echo yes | redis-cli --cluster create --cluster-replicas 2 \
8 $(kubectl -n {{ .Release.Namespace }} get po \
9 {{ .Values.rediscluster.name }}-0 \
10 {{ .Values.rediscluster.name }}-1 \
11 {{ .Values.rediscluster.name }}-6 \ 
12 {{ .Values.rediscluster.name }}-3 \
13 {{ .Values.rediscluster.name }}-2 \
14 {{ .Values.rediscluster.name }}-4 \ 
15 {{ .Values.rediscluster.name }}-7 \ 
16 {{ .Values.rediscluster.name }}-8 \ 
17 {{ .Values.rediscluster.name }}-5 \
18 -o=jsonpath='{range .items[*]}{.status.podIP}{":6379 "}{end}')"
19
20 3. Once cluster is created, you can use below utility to see the related redis nodes (master and slaves) sets,
21    along with the k8 worknode details where each is placed.  
22
23    PLACENODE_POD=$(kubectl get --no-headers  po -l app={{ .Values.assigner.label }}  -o=jsonpath='{.items[0].metadata.name}')
24    kubectl exec -it ${PLACENODE_POD} -- sh /conf/relatenode.sh
25
26 4. If previous step shows the undesired state for pod-antiaffinity use below perl program to make it as per desired state. 
27    It will NOT take any action when the set-up is with desired pod-antiaffinity
28    kubectl exec -it ${PLACENODE_POD} -- perl /conf/placenode.pl
29
30
31 5. Run below commands to delete the helm release and the PVC
32    a. helm delete --purge {{ .Release.Name }}
33    b. kubectl delete pvc -l app.kubernetes.io/instance={{ .Release.Name }} -n {{ .Release.Namespace }}
34
35
36