且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将Kubernetes DNS用于Pod?

更新时间:2022-04-12 10:35:50

更新

根据文档,格式现在为:

According to the docs, the format is now:

_my-port-name._my-port-protocol.my-svc.my-namespace.svc.cluster.local

在此处查看相关文档: https://kubernetes.io/docs/concepts/services-联网/dns-pod-service/#pods

See the related doc here: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pods

原始答案:

到目前为止,这实际上是不可能的……但是Kubernetes团队正在对此进行研究.

as of this date, this is actually not possible... but it is being looked at by the Kubernetes team.

查看此问题: https://github.com/kubernetes/kubernetes/issues/13552

更新:

从2015年9月开始,DNS可用于Pod 参见PR: https://github.com/kubernetes/kubernetes/pull/13759

DNS is available for Pods since 09/2015 See PR:https://github.com/kubernetes/kubernetes/pull/13759

简而言之:

这将以以下形式提供Pod dns: <podIP>.<namespace>.pod.<clusterSuffix>当前可以被禁用,但是 对于所有广告连播都处于启用状态,也可能处于关闭状态.

This will give pods dns in the form of <podIP>.<namespace>.pod.<clusterSuffix> Currently can be disabled, but is either on for all pods or off.