前提条件
1.检查helm是否部署
helm version
Client: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"dirty"}
Server: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"dirty"}
2.检查是否有default storageclass
kubectl get storageclass
NAME PROVISIONER AGE
glusterfs-storage (default) kubernetes.io/glusterfs 21d
helm部署redis-ha
tar -xvf redis-ha-3.9.0.tgz
vim redis-ha/values.yaml
image:
repository: wf/redis
tag: 5.0.7-debian
pullPolicy: IfNotPresent
haproxy:
enabled: true
image:
repository: wf/haproxy
tag: 2.0.10
pullPolicy: IfNotPresent
安装
helm install -n redis-ha-test ./redis-ha --namespace name
卸载
helm del --purge redis-ha-test
kubectl get all -n database
NAME READY STATUS RESTARTS AGE
pod/redis-ha-test-haproxy-cb75574f6-g6l4w 1/1 Running 0 30m
pod/redis-ha-test-server-0 2/2 Running 0 31m
pod/redis-ha-test-server-1 2/2 Running 0 28m
pod/redis-ha-test-server-2 2/2 Running 0 45m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/glusterfs-dynamic-0aa0e486-6a84-11ea-a62c-00bf00001d1c ClusterIP 10.104.139.239
service/glusterfs-dynamic-2d58fa4d-6a84-11ea-a62c-00bf00001d1c ClusterIP 10.96.75.179
service/glusterfs-dynamic-463cd6b8-6a84-11ea-a62c-00bf00001d1c ClusterIP 10.106.133.11
service/redis-ha-test ClusterIP None
service/redis-ha-test-announce-0 ClusterIP 10.96.34.204
service/redis-ha-test-announce-1 ClusterIP 10.105.184.201
service/redis-ha-test-announce-2 ClusterIP 10.106.69.30
service/redis-ha-test-haproxy LoadBalancer 10.102.226.216 192.11.130.95 6379:32528/TCP 46m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/redis-ha-test-haproxy 1/1 1 1 46m
NAME DESIRED CURRENT READY AGE
replicaset.apps/redis-ha-test-haproxy-cb75574f6 1 1 1 46m
NAME READY AGE
statefulset.apps/redis-ha-test-server 3/3 46m