静态配置yaml配置镜像中的 Hosts 文件1234567#-------------------------------------------hostAliases: - hostnames: - "sss" - "aaa" ip: 127.0.0.1#------------------------------------------- 动态配置通过写入环境变量,然后在command里拼接到/etc/hosts文件中12345678910# 写入环境benvFrom: - configMapRef: name: sopei-biz-configmap# 读取的环境变量拼接到host文件中command: ["/bin/sh","-c"]args: - | echo gateway-orange-sopei.sopei-biz.svc.cluster.local $web_domain >> /etc/hosts node app.js