找到你要的答案

Q:How to use kubernetes replication controllers to replicate message-based services

Q:如何使用Kubernetes复制控制器复制基于消息的服务

We usually use message passing to send messages to decoupled services. This makes service discovery a non-issue, because (with AMQP in RabbitMQ for instance) you can use the broker's routing capability to dispatch messages to the right queues that feed the correct services. Load balancing is also handled by the message broker.

Enter kubernetes.

The use case that is usually laid out when talking about service replication and re-spawning failing services, is when your clients use some active protocol like http to contact a service, even if this service handles requests asynchronously. In this context, it is a natural fit to have replication controllers, that manage a group of services and a single entry point to load balance between them.

I like kubernetes' intuitive concepts, like rolling deployments, but how to you control this beasts that don't have an http interface ?

UPDATE: I am not trying to set up a cluster of message brokers. I am looking at message consumers as services. Service clients don't connect directly to the services, they send messages to the message broker. The message broker acts as a load balancer in a way, and dispatches the messages to the subscribed queue consumers. These consumers implement the service.

My question gravitates around the fact that most usage patterns in demos handle services that are called via http, and kubernetes does a good job here to create a service proxy for these services, and a replication controller. Is it possible to create replication controllers for my kind of service, which does not have a http interface per se, and have all the benefits of rolling updates, and minimum instances?

我们通常使用消息传递来发送消息到去耦服务。这使得服务发现一个问题,因为(在RabbitMQ例如AMQP)可以使用代理的路由功能的消息发送到队列的权利给正确的服务。负载平衡也由消息代理处理。

进入Kubernetes。

用例通常是放在服务复制和重新产卵失败的服务,就是当你的客户使用一些积极的协议像HTTP联系服务,即使这个服务请求异步处理。在这种情况下,它是一个自然的适合有复制控制器,管理一组服务和一个单一的入口点,以负载它们之间的平衡。

我喜欢Kubernetes“直觉的概念,像滚动的部署,但你如何控制这野兽,没有一个HTTP接口?

UPDATE: I am not trying to set up a cluster of message brokers. I am looking at message consumers as services. Service clients don't connect directly to the services, they send messages to the message broker. The message broker acts as a load balancer in a way, and dispatches the messages to the subscribed queue consumers. These consumers implement the service.

我的问题会在事实上在演示最使用模式处理称为通过HTTP服务,和Kubernetes做好这里创建这些服务的服务代理,和复制控制。可能是对我的一种服务创建复制控制,没有一个HTTP接口本身,并有滚动更新的所有好处,和最小的情况吗?

answer1: 回答1:

I'm not sure I entirely understand the question. Are you asking how to use RabbitMQ with Kubernetes? Or how to set up a RabbitMQ cluster: https://www.rabbitmq.com/clustering.html? Or how rolling updates interact with RabbitMQ? Or something else?

I think you should be able to create one service and one replication controller per server, and then use the service DNS names in the cluster configuration file. This is the current approach used to run Zookeeper, also. We have a long-standing TODO to make this less verbose (https://github.com/GoogleCloudPlatform/kubernetes/issues/260), but the current approach should be straightforward. You do lose the ability to use a single kubectl rolling-update command to update the cluster, but it's also straightforward to update the instances individually.

我不确定我完全理解这个问题。你是问如何使用RabbitMQ Kubernetes吗?如何建立一个https://www.rabbitmq.com/clustering.html RabbitMQ集群:?或如何滚动更新与RabbitMQ?或者别的什么?

我想你应该能够创建一个服务,每台服务器一个复制的控制器,然后使用DNS名称在群集配置文件。这是用来运行管理员目前的做法,也。我们要让这个不啰嗦长期待办事项(https:/ / GitHub。COM / googlecloudplatform / Kubernetes /问题/ 260),但目前的方法应该是简单的。你失去了使用一个单一的kubectl滚动更新命令来更新簇的能力,但它也直接更新的情况下单独。

rabbitmq  kubernetes  microservices