我正在使用下面的命令创建一个由3名主、3名奴隶和3名哨兵组成的集群。
helm install --set replicas.master=3 --set replicas.slave=3 stable/redis-ha但我看到只有一个大师被创造出来了。Helm --版本0.2.3gitrepo:https://github.com/kubernetes/charts/tree/master/stable/redis-ha
下面是舵机的日志。
=> NAME DESIRED CURRENT AGE
=> eloping-fox-redis-ha-master 3 1 9s我是遗漏了什么还是有什么问题?我已经尝试过这多个项目,每次只有一个主被创建。
我正在使用VM/Minikube/Docker在windows机器上尝试这一点。
PS C:\Users\rootus> helm install --set replicas.master=3 --set replicas.slave=3 stable/redis-ha
NAME: eloping-fox
LAST DEPLOYED: Wed Nov 1 16:34:58 2017
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
eloping-fox-redis-ha 3 3 3 0 9s
eloping-fox-redis-ha-sentinel 3 3 3 0 9s
==> v1beta1/StatefulSet
NAME DESIRED CURRENT AGE
eloping-fox-redis-ha-master 3 1 9s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
eloping-fox-redis-ha-167683871-2rhn8 0/1 ContainerCreating 0 9s
eloping-fox-redis-ha-167683871-cmjjk 0/1 ContainerCreating 0 9s
eloping-fox-redis-ha-167683871-jf4sn 0/1 ContainerCreating 0 9s
eloping-fox-redis-ha-sentinel-2596454939-9qq06 0/1 ContainerCreating 0 9s
eloping-fox-redis-ha-sentinel-2596454939-ngwcf 0/1 ContainerCreating 0 9s
eloping-fox-redis-ha-sentinel-2596454939-pwkbx 0/1 ContainerCreating 0 9s
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
redis-sentinel ClusterIP 10.0.0.122 <none> 26379/TCP 9s
eloping-fox-redis-ha ClusterIP 10.0.0.149 <none> 6379/TCP 9s
NOTES:
Redis cluster can be accessed via port 6379 on the following DNS name from within your cluster:
eloping-fox-redis-ha.default.svc.cluster.local
To connect to your Redis server:
1. Run a Redis pod that you can use as a client:
kubectl exec -it eloping-fox-redis-ha-master-0 bash
2. Connect using the Redis CLI:
redis-cli -h eloping-fox-redis-ha.default.svc.cluster.local=================================================
发布于 2017-11-04 20:13:09
使用stable/redis-ha头盔图表,一切都如预期的那样工作。
这似乎是您的minikube环境的一个问题。
默认情况下,minikube使用2 CPU和2048M RAM启动VM。
stable/redis-ha头盔图中的默认CPU和内存资源如下:
resources:
master:
requests:
memory: 200Mi
cpu: 100m
limits:
memory: 700Mi
slave:
requests:
memory: 200Mi
cpu: 100m
limits:
memory: 200Mi
sentinel:
requests:
memory: 200Mi
cpu: 100m
limits:
memory: 200Mi当您使用stable/redis-ha和3 slaves部署3 masters舵机图表时,它只会创建1 master,这是因为在您的VM上缺少使用minikube的资源:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
melting-armadillo-redis-ha-2438719374-8ghdn 1/1 Running 0 2m
melting-armadillo-redis-ha-2438719374-rlq24 1/1 Running 0 2m
melting-armadillo-redis-ha-2438719374-zlg4p 1/1 Running 0 2m
melting-armadillo-redis-ha-master-0 2/2 Running 0 2m
melting-armadillo-redis-ha-master-1 0/2 Pending 0 4s
melting-armadillo-redis-ha-sentinel-1377673986-004m8 1/1 Running 0 2m
melting-armadillo-redis-ha-sentinel-1377673986-gcpj2 1/1 Running 0 2m
melting-armadillo-redis-ha-sentinel-1377673986-jh73w 1/1 Running 0 2m由于以下原因,第二个红宝石的Pod具有Pending状态:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
16s 1s 6 default-scheduler Warning FailedScheduling No nodes are available that match all of the following predicates:: Insufficient memory (1).因此,您有两种解决问题的方法:
minikube创建4096M RAM环境。stable/redis-ha和3 slaves配置内存资源减少的helm图表。的第一条路是:
用minikube启动4096M RAM
$ minikube start --memory 4096
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.用stable/redis-ha和3 slaves部署3 masters舵图
$ helm install --set replicas.master=3 --set replicas.slave=3 stable/redis-ha 最后,我们得到:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
maudlin-ladybug-redis-ha-1801622981-brmqp 1/1 Running 0 3m
maudlin-ladybug-redis-ha-1801622981-klhr1 1/1 Running 0 3m
maudlin-ladybug-redis-ha-1801622981-mpf3j 1/1 Running 0 3m
maudlin-ladybug-redis-ha-master-0 2/2 Running 0 3m
maudlin-ladybug-redis-ha-master-1 2/2 Running 0 1m
maudlin-ladybug-redis-ha-master-2 2/2 Running 0 1m
maudlin-ladybug-redis-ha-sentinel-3633913943-f8x2c 1/1 Running 0 3m
maudlin-ladybug-redis-ha-sentinel-3633913943-ltvk4 1/1 Running 0 3m
maudlin-ladybug-redis-ha-sentinel-3633913943-xwclg 1/1 Running 0 3m第二条路是:
使用stable/redis-ha和3 slaves部署3 masters舵机图表,并减少内存资源:
helm install --set replicas.master=3 --set replicas.slave=3 --set resources.master.requests.memory=100Mi --set resources.slave.requests.memory=100Mi --set resources.sentinel.requests.memory=100Mi stable/redis-ha最后,我们得到:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
exacerbated-jellyfish-redis-ha-3444643229-085f4 1/1 Running 0 43s
exacerbated-jellyfish-redis-ha-3444643229-bl221 1/1 Running 0 43s
exacerbated-jellyfish-redis-ha-3444643229-qx62b 1/1 Running 0 43s
exacerbated-jellyfish-redis-ha-master-0 2/2 Running 0 43s
exacerbated-jellyfish-redis-ha-master-1 2/2 Running 0 36s
exacerbated-jellyfish-redis-ha-master-2 2/2 Running 0 29s
exacerbated-jellyfish-redis-ha-sentinel-1441222589-czsvx 1/1 Running 0 43s
exacerbated-jellyfish-redis-ha-sentinel-1441222589-ql6n6 1/1 Running 0 43s
exacerbated-jellyfish-redis-ha-sentinel-1441222589-qql1f 1/1 Running 0 43shttps://stackoverflow.com/questions/47069977
复制相似问题