forked from Vitals9367/Redis-Sentinel-Kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartCluster.sh
More file actions
24 lines (18 loc) · 676 Bytes
/
startCluster.sh
File metadata and controls
24 lines (18 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FILE_PATH="${1:-"./resources"}"
NAMESPACE="redis-sentinel"
# Namespace
kubectl create ns $NAMESPACE
# Config files
kubectl apply -f "$FILE_PATH/redis-config.yml" -n $NAMESPACE
kubectl apply -f "$FILE_PATH/redis-scripts-config.yml" -n $NAMESPACE
kubectl apply -f "$FILE_PATH/redis-secret.yml" -n $NAMESPACE
# Services
kubectl apply -f "$FILE_PATH/redis-services.yml" -n $NAMESPACE
# Redis
kubectl apply -f "$FILE_PATH/redis-stateful.yml" -n $NAMESPACE
kubectl wait --namespace=$NAMESPACE \
--for=condition=ready pod \
--selector=app=redis \
--timeout=280s
# Sentinel
kubectl apply -f "$FILE_PATH/sentinel-stateful.yml" -n $NAMESPACE