[英]How to alias Hostnames in Kubernetes Deployment Configuration
How to alias POD Ip Address with different domain name instead of default name.如何使用不同的域名而不是默认名称为 POD Ip 地址别名。
For Example:
10.1.1.1 testxyz
My output has to be with the new entry like below.我的 output 必须与下面的新条目一起使用。 I have tried with hostAliases but the problem here is ipaddress will be dynamic when pod scales up.
我已经尝试过使用 hostAliases,但这里的问题是 ipaddress 在 pod 扩展时将是动态的。 so in that case i can't keep my ip address as static in deployment config yaml file.
所以在这种情况下,我不能在部署配置 yaml 文件中将我的 ip 地址保留为 static。 Moreover i don't have permissions to change the /etc/hosts file with non-root user.
此外,我无权使用非 root 用户更改 /etc/hosts 文件。 Kindly suggest.
请建议。
Output:
10.1.1.1 testxyz
10.1.1.1 abc.xyz.com
Use a Service with type ExternalName to register arbitrary IPs into a cluster DNS entry.使用 ExternalName 类型的服务将任意 IP 注册到集群 DNS 条目中。
So you would make a service testxyz
with the address set to 10.1.1.1
and then use the DNS name testxyz.mynamespace.svc.cluster.local
in config files.因此,您将创建一个地址设置为
10.1.1.1
的服务testxyz
,然后在配置文件中使用 DNS 名称testxyz.mynamespace.svc.cluster.local
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.