【发布时间】:2020-05-06 16:51:40
【问题描述】:
我有一个包含 2 个 pod 的应用程序,其中一个 pod 正在摄取数据,而另一个想要使用它。 我正在尝试使用单节点 Kubernetes 设置。 现在:
`in pod1`
- name: ingest_cfg
value: zmq_tcp,0.0.0.0:9000 [where pod1 is publishing on port 9000, even this I want to be dynamically configurable]
`in pod2`
- name: ingest_cfg
value: "zmq_tcp,IPadd:pv" [where IPadd should be Ip address where pod 1 is publishing and pv is port number where pod1 has published]
现在,我需要知道如何在代码中进行配置。我不想硬编码 IP 地址和端口。任何指针都会非常有帮助。 我尝试使用服务名称,但它指向集群 IP 地址。
【问题讨论】:
标签: kubernetes service dns