如何在ECS Fargate任务定义中配置主机名 [英] How to configure hostname in ECS Fargate task definition

查看:144
本文介绍了如何在ECS Fargate任务定义中配置主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从ECS迁移到Fargate.在ECS中,我们可以在任务定义中设置主机名,如下所示:
主机名":%HOST_NAME%"

We are migrating from ECS to Fargate. In ECS, we could set the hostname in the task definition like this:
"hostname": "%HOST_NAME%"

无法创建,错误为"networkMode = awsvpc时容器不支持主机名" 有什么方法可以设置主机名?

It fails to create with the error 'hostname is not supported on container when networkMode=awsvpc' Is there any way to set hostname ?

推荐答案

AWS文档The hostname parameter is not supported if using the awsvpc networkMode.除arvvpc外,FARGATE不支持任何其他功能,因此无法在任务定义中使用FARGATE启动类型设置主机名.

AWS documentation says The hostname parameter is not supported if using the awsvpc networkMode. Anything but awsvpc is not supported with FARGATE, therefore there is no way to set hostname in task definition with FARGATE launch type.

这篇关于如何在ECS Fargate任务定义中配置主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆