【发布时间】:2020-10-30 23:13:06
【问题描述】:
我有一些 docker 容器,我正在尝试使用 ECS CLI 在 AWS ECS 上启动它们。
这些是我的命令:
ecs-cli configure --cluster abc --default-launch-type FARGATE --config-name abc-conf --region eu-west-1
ecs-cli configure profile --access-key xxx --secret-key xxx --profile-name abc-profile
ecs-cli up --security-group sg-094607105993d0351 --vpc vpc-0479323e6e7107b74 --subnets subnet-009eb5c6e08b7dbf0,subnet-0e1c2846b268b170a --keypair abc-key --capability-iam --size 1 --instance-type t2.small --cluster-config abc-conf --ecs-profile abc-profile --region eu-west-1 --force
ecs-cli compose up --create-log-groups --cluster-config abc-conf --ecs-profile abc-profile --create-log-groups
但是我得到了
ERRO[0001] Error running tasks error="InvalidParameterException: No Container Instances were found in your cluster." task definition=0xc00031e6a0
FATA[0001] InvalidParameterException: No Container Instances were found in your cluster.
原因是ecs-cli up命令启动了一个EC2,但它没有把它带入集群,所以集群没有实例.
现在,如果我不指定自己的 vpc 和子网,这可以工作,但是我必须这样做,因为没有其他方法可以指定要在集群上打开的一堆端口(有一个选项只允许你指定一个端口)。
那么为什么 ecs-cli 没有将我的实例带入我的集群?
【问题讨论】:
标签: amazon-web-services amazon-ec2 aws-cli amazon-ecs