csi-driver-nfs(动态存储redis集群)对接k8s(v1.20.5)
获取部署方式可以参考官网https://artifacthub.io/packages/helm/keyporttech/csi-driver-nfshttps://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/example/README.md如需翻墙可以使用我替换好的国内镜像git clone https://gitee
·
https://artifacthub.io/packages/helm/keyporttech/csi-driver-nfs
https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/example/README.md
git clone https://gitee.com/jbjb123/redis-cluster.git
kubectl apply -f rbac-csi.yaml
kubectl apply -f csi-nfs-driverinfo.yaml
kubectl apply -f csi-nfs-node.yaml
kubectl apply -f csi-nfs-controller.yaml
kubectl apply -f storageclass-nfs.yaml
[root@node97 redis-cluster]# kubectl get sc | grep nfs
nfs-csi nfs.csi.k8s.io Retain Immediate false
kubectl apply -f example/redis-sts.yml
kubectl apply -f example/redis-svc.yaml
kubectl exec -it redis-cluster-0 -- redis-cli --cluster create --cluster-replicas 1 $(kubectl get pods -l app=redis-cluster -o jsonpath='{range.items[*]}{.status.podIP}:6379 ' | awk 'NF--')
[root@node97 redis-cluster]# for x in $(seq 0 5); do echo "redis-cluster-$x"; kubectl exec redis-cluster-$x -- redis-cli role; echo; done
redis-cluster-0
master
7924
10.244.3.118
6379
7924
redis-cluster-1
master
7924
10.244.3.119
6379
7910
redis-cluster-2
master
7910
10.244.3.117
6379
7910
redis-cluster-3
slave
10.244.3.116
6379
connected
7910
redis-cluster-4
slave
10.244.3.114
6379
connected
7924
redis-cluster-5
slave
10.244.3.115
6379
connected
7924
kubectl apply -f example/deployment.yaml
更多推荐
已为社区贡献82条内容
所有评论(0)