Skip to content

Mr-Li-Nanjing-Citizen/redis-cluster-k8s

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

使用

  • 生成StatefulSet:kubectl create -f redis-sts.yaml
  • 生成Service:kubectl create -f redis-svc.yaml
  • 启动redis集群: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 ')

说明

  • 需要使用StorageClass动态创建pv
  • StatefulSet中的serviceName要和Service的metadata中name保持一致

About

在k8s中的redis集群

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published