[英]ActiveMQ Broker url on Kubernetes
I have deployed my ActiveMQ on Kubernetes, but how to configure the broker to connect queue using port 61616?我已经在 Kubernetes 上部署了我的 ActiveMQ,但是如何配置代理以使用端口 61616 连接队列? If I use the POD IP then it will not be static IP and every time pod recreate will create new IP.
如果我使用 POD IP 那么它不会是 static IP 并且每次重新创建 pod 都会创建新的 static Is there anyway to get static IP or using ingress can we setup broker on port 61616?
无论如何要获得 static IP 或使用入口我们可以在端口 61616 上设置代理吗?
This is a Community Wiki answer so feel free to edit it and add any additional details you consider important.这是一个社区 Wiki 答案,因此请随时对其进行编辑并添加您认为重要的任何其他详细信息。
For exposing any of your microservices in kubernetes either externally or internally you have a Service为了在外部或内部公开 kubernetes 中的任何微服务,您有一个服务
As David Maze already stated in his comment:正如David Maze在他的评论中所说:
There should be a matching Service, which will have a known DNS name;
应该有一个匹配的服务,它将有一个已知的 DNS 名称; use that.
用那个。 – David Maze yesterday
– 大卫迷宫昨天
You don't need to worry about static IP.您无需担心 static IP。
Services
have also dynamic IPs assigned but they provide a reliable way to access your backend Pods
via stable DNS name. Services
也分配了动态 IP,但它们提供了一种通过稳定的Pods
名称访问后端 Pod 的可靠方式。 Take a look also at this section in the official docks.还可以查看官方码头中的此部分。
In your case its enough to create a simple ClusterIP
Service
(which is the default Service
type).在您的情况下,它足以创建一个简单的
ClusterIP
Service
(这是默认Service
类型)。 It may look as follows:它可能如下所示:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 61616
targetPort: 61616
provided your app is listening on TCP port 61616
and you want your Service
to expose the same port ( port
) as your Pods
( targetPort
).前提是您的应用正在侦听 TCP 端口
61616
并且您希望您的Service
公开与您的targetPort
Pods
相同的端口 ( port
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.