Docker 库伯内特斯的Redis sentinel集群,sentinel无法到达Redis master

Docker 库伯内特斯的Redis sentinel集群,sentinel无法到达Redis master,docker,kubernetes,redis,redis-sentinel,Docker,Kubernetes,Redis,Redis Sentinel,我正在使用以下工具创建Redis sentinel群集: 它在给定的图像上运行得非常好,但是当我们使用Redis官方图像时,哨兵无法在第一个pod中连接到Redis 它显示以下错误: 无法在-p:6379连接到redis 如何使用Redis的官方映像创建群集?要将google repository中的映像替换为public docker hub映像,此示例需要修改以下部署文件: examples/staging/storage/redis/redis-master.yaml examples/

我正在使用以下工具创建Redis sentinel群集:

它在给定的图像上运行得非常好,但是当我们使用Redis官方图像时,哨兵无法在第一个pod中连接到Redis

它显示以下错误:

无法在-p:6379连接到redis


如何使用Redis的官方映像创建群集?

要将google repository中的映像替换为public docker hub映像,此示例需要修改以下部署文件:

examples/staging/storage/redis/redis-master.yaml
examples/staging/storage/redis/redis-sentinel-service.yaml
examples/staging/storage/redis/redis-controller.yaml
在这些文件中,您可以找到如下图像配置:

spec:
      containers:
      - name: sentinel
        image: k8s.gcr.io/redis:v1
spec:
      containers:
      - name: sentinel
        image: redis:stable
将所有
image:k8s.gcr.io/redis:v1
替换为
image:redis:stable
image:redis:latest

修改后,这些映像配置应如下所示:

spec:
      containers:
      - name: sentinel
        image: k8s.gcr.io/redis:v1
spec:
      containers:
      - name: sentinel
        image: redis:stable
您提到的dockerfile中的alpine映像用于运行脚本以删除尾部空白


更新:

经过进一步调查,该示例似乎使用了GCR存储库中的特定redis,用官方redis映像替换它将不起作用

如果您想在kubernetes中部署redis,我建议使用github项目。有关在kubernetes上安装它的更多信息,请参见


官方的github页面和redis没有提到在kubernetes上部署redis的任何内容。

Hi,官方镜像指的是redis的官方docker?你是如何用官方镜像创建集群的?Hi piotr,是的,我使用的是redis的docker官方图片。我只是按照上面的git url使用redis图片,而不是alpine。你是在你的pod中用--sentinel启动sentinel容器的吗?您是否也在使用sentinel.conf文件来告诉它谁是主人?(监控主机)我已经尝试了上面提到的,我遇到的问题是sentinel无法连接6379端口。