【问题标题】:create service using cloudformation in aws ecs fargate "did not stabilize"在 aws ecs fargate 中使用 cloudformation 创建服务“不稳定”
【发布时间】:2018-09-17 12:26:02
【问题描述】:
AWSTemplateFormatVersion: "2010-09-09"
Description: Not Have Any Idea
Parameters:
  Service:
    Description: Service Name
    Type: String
  Cluster:
    Description: Cluster Name
    Type: String
  TaskDefinition:
    Description: TaskDefinition Name
    Type: String
  securitygroup:
    Description: securitygroup
    Type: AWS::EC2::SecurityGroup::Id
  SubnetId:
    Type: List<AWS::EC2::Subnet::Id>
    Description: Select at two subnets in your selected VPC.
Resources:
  sernginx:
    Type: "AWS::ECS::Service"
    Properties:
      ServiceName:
        Ref: Service
      LaunchType: "FARGATE"
      DesiredCount: 1
      Cluster:
        Ref: Cluster
      TaskDefinition:
        Ref: TaskDefinition
      DeploymentConfiguration:
        MaximumPercent: 200
        MinimumHealthyPercent: 70
      NetworkConfiguration:
        AwsvpcConfiguration:
          AssignPublicIp: ENABLED
          SecurityGroups:
          - Ref: securitygroup
          Subnets:
            Ref: SubnetId

我正在使用此代码创建 aws ecs service fargate

我得到 ROLLBACK_COMPLETE 状态并显示一条错误消息

服务 arn:aws:ecs:us-east-1:439138162442:service/yuiyiuyiu 没有稳定

【问题讨论】:

    标签: amazon-cloudformation amazon-ecs


    【解决方案1】:

    我使用这种模板来创建 fargate 任务。

    AWSTemplateFormatVersion: '2010-09-09' Description: Docker Core App service Parameters: EnvironmentName: Type: String Default: coreapp Description: A name for the environment that this cloudformation will be part of. ServiceName: Type: String Default: coreapi Description: A name for the service ImageUrl: Type: String Default: your_image_URI Description: The url of a docker image ContainerPort: Type: Number Default: 5000 Description: What port number the application inside the docker container ContainerCpu: Type: Number Default: 256 Description: How much CPU to give the container. ContainerMemory: Type: Number Default: 512 Description: How much memory in megabytes to give the container DesiredCount: Type: Number Default: 2 Description: How many copies of the service task to run Role: Type: String Default: "" Description: (Optional) An IAM role to give the service's containers Resources: Service: Type: AWS::ECS::Service Properties: ServiceName: !Ref 'ServiceName' Cluster: - coreapp LaunchType: FARGATE DeploymentConfiguration: MaximumPercent: 200 MinimumHealthyPercent: 75 DesiredCount: !Ref 'DesiredCount' NetworkConfiguration: AwsvpcConfiguration: AssignPublicIp: ENABLED SecurityGroups: - sg-483aa03e Subnets: - subnet-2ce41866 - subnet-ceefe5aa TaskDefinition: !Ref 'TaskDefinition'

    【讨论】:

    • 能否将完整模板上传到 github 并在此处粘贴链接?
    • 感谢 Ratul Basak 的重播,但问题解决了我尝试了相同的模板,但我不知道是什么问题
    猜你喜欢
    • 2017-10-16
    • 2019-04-19
    • 1970-01-01
    • 2018-12-14
    • 2021-06-08
    • 1970-01-01
    • 2018-05-18
    • 1970-01-01
    • 2020-01-05
    相关资源
    最近更新 更多