![](/img/trans.png)
[英]How do I get individual pod hostnames in a Deployment registered and looked up in Kubernetes?
[英]How to alias Hostnames in Kubernetes Deployment Configuration
如何使用不同的域名而不是默认名称为 POD Ip 地址别名。
For Example:
10.1.1.1 testxyz
我的 output 必须与下面的新条目一起使用。 我已经尝试过使用 hostAliases,但这里的问题是 ipaddress 在 pod 扩展时将是动态的。 所以在这种情况下,我不能在部署配置 yaml 文件中将我的 ip 地址保留为 static。 此外,我无权使用非 root 用户更改 /etc/hosts 文件。 请建议。
Output:
10.1.1.1 testxyz
10.1.1.1 abc.xyz.com
使用 ExternalName 类型的服务将任意 IP 注册到集群 DNS 条目中。
因此,您将创建一个地址设置为10.1.1.1
的服务testxyz
,然后在配置文件中使用 DNS 名称testxyz.mynamespace.svc.cluster.local
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.