草庐IT

HostAliases

全部标签

k8s设置 域名自定义映射ip,hosts 解析HostAliases

前言:我们知道k8s访问内部域名可以使用pod名.namespace.svc.cluster.local,但有时需要往pod增加自定义的host解析。有一个参数可以支持,在deployment.spec.spec中添加配置spec:hostAliases:-hostnames:-xxx.xxx.comip:xxx.xxx.xxx.201或是:spec:hostAliases:-ip:10.107.156.113hostnames:-"k8s.test.com"示例:修改deploymentyaml文件(或是在线编辑edit)template:metadata:labels:app:${NAME

php - 为 PHP-FPM 使用 HOSTALIASES

有一种方法可以让每个进程覆盖名称解析process-localoverrideofnameresolution?使用HOSTALIASES。你认为它也适用于PHP-FPMworkers吗?我在/etc/php-fpm.d/www.conf中有这一行:env[HOSTALIASES]=/etc/hosts.php-fpm当我检查$_SERVER时,我看到了HOSTALIASES,但hosts.php-fpm(127.0.0.1example.com)中的实际覆盖无效,它是从名称服务器返回的。您对如何使(类似的解决方案)起作用有什么建议吗? 最佳答案