aws배포 과정 ci/cd with github actions

송은우·2022년 4월 13일
0

진짜 최악의 경험들

무조건 로드 밸런서가 있는지 확인하기

task definition은 진짜로 최악이었음.
날려야 할 것은 제발 좀 날리고 보자...
task definition은 그대로 복사 하는 것이 아닌, 알아서 양식에 잘 채우는 것인데, 필요 없는 것은 없애야 한다.
기본값대로 배포하면 망함

container name 은 container 어쩌구 is not in the task definition이라고 뜨면 그걸 참고해서 대충 넣으면 됨

{
  "ipcMode": "task",
  "containerDefinitions": [
    {
      "dnsSearchDomains": [],
      "logConfiguration": {
        "logDriver": "awslogs",
        "secretOptions": [],
        "options": {
          "awslogs-group": "/ecs/로그이름",
          "awslogs-region": "리전",
          "awslogs-stream-prefix": "ecs"
        }
      },
      "entryPoint": [],
      "portMappings": [
        {
          "hostPort": 80,
          "protocol": "tcp",
          "containerPort": 3000
        }
      ],
      "command": [],
      "linuxParameters": [],
      "environment": [
        {
          "name": "환경변수",
          "value": "환경변수 값"
        }
      ],
      "resourceRequirements": [
            ],
      "ulimits": [],
      "dnsServers": [],
      "mountPoints": [],
      "secrets": [],
      "dockerSecurityOptions": [],
      "memoryReservation": 512,
      "volumesFrom": [],
      "stopTimeout": 2,
      "image": "ecr 이미지 이름",
      "startTimeout": 2,
      "dependsOn": [],
      "workingDirectory": "도커파일 workdir과 매칭",
      "interactive": true,
      "healthCheck": {
                "command": [
                   "CMD-SHELL", "curl -f http://localhost/ || exit 1" 
                ],
                "interval": 300,
                "timeout": 30,
                "retries": 3,
                "startPeriod": 0
            },
      "essential": true,
      "links": [],
      "pseudoTerminal": true,
      "name": "people"
    }
  ],
  "placementConstraints": [],
  "family": "people",
  "pidMode": "task",
  "requiresCompatibilities": [
    "EC2"
  ],
  "networkMode": "bridge",
  "inferenceAccelerators": [],
  "volumes": []
}

피플의 task definition

https://aws.amazon.com/ko/premiumsupport/knowledge-center/create-alb-auto-register/

documentation 잘 읽기....

profile
학생의 마음가짐으로 최선을 다하자

0개의 댓글