Amazon ECS ã®ãããã¤ãã¼ã«ãecspresso ã® v1.5.0 ããªãªã¼ã¹ããã®ã§ãç¥ããã§ãã
ä»å㯠Amazon ECS Exec ã¨ããæ°æ©è½å¯¾å¿ãç®çã§ããã»ãã«ããéãããã ããPRãåãããã å種修æ£ãå ¥ã£ããªãªã¼ã¹ã«ãªãã¾ããã©ãããå©ç¨ãã ããã
PRããéãããã ããçæ§ããããã¨ããããã¾ããï¼
æ°æ©è½
ECS Exec ã¸ã®å¯¾å¿ã追å ãã¾ãã
ãã¹ããã docker exec ããããã«ãFargate ã«å¯¾ãã¦ãèµ·åãã¦ããã³ã³ããã«å ¥ã£ã¦ã³ãã³ããå®è¡ã§ãã ECS Exec æ©è½ããªãªã¼ã¹ããã¦ãã¾ãã
ecspresso v1.5 ã§ã¯ exec ã³ãã³ãã追å ãã¦ãAWS CLI ãªã㧠exec ã§ããããã«ãã¾ãããsession-manager-plugin ã¯å¿ è¦ã§ãã
exec ã使ç¨ããããã«ã¯ãã¾ããµã¼ãã¹å®ç¾©ã§ enableExecuteCommand
ã true ã«è¨å®ã㦠create / deploy ãã¾ãã(èµ·åä¸ã® ECS ãµã¼ãã¹ã«å¯¾ãã¦ããã¨ããå¤æ´å¯è½ã§ã)
{ "enableExecuteCommand": true }
å¿ è¦ãªæ¨©éãªã©ãæã£ã¦ãããã©ãã㯠amazon-ecs-exec-checker ã§ç¢ºèªããã¨ä¾¿å©ã§ãã
ãã®å¾ã¯ ecspresso exec
ã³ãã³ãã使ç¨ãã¦ãèµ·åä¸ã®ã¿ã¹ã¯ã«å¯¾ã㦠exec ãã§ãã¾ããã¿ã¹ã¯ã«è¤æ°ã³ã³ãããããå ´åã¯ãæ´ã«é¸æè¢ãã§ã¾ãã
å®éã«å®è¡ãã¦ã¿ãæ§åã¯ä»¥ä¸ãã覧ãã ããã
ãã®ä¾ã§ã¯ã¿ã¹ã¯ãã³ã³ããã®çµãè¾¼ã¿ã« peco ã使ã£ã¦ãã¾ãããçµãè¾¼ã¿ã«ä½¿ãã³ãã³ãã¯è¨å®ãã¡ã¤ã«ã® filter_command
ã§æå®å¯è½ã§ããæªæå®ã®å ´å㯠ID / ã³ã³ããåå
¥åãããã¤ã¢ãã°ã表示ããã¾ãã
ã¿ã¹ã¯ãä¸è¦§/詳細表示ãã tasks ã³ãã³ãã追å
ããã¾ã§ ecspresso ã§ã¯ãµã¼ãã¹ã¨ã¿ã¹ã¯å®ç¾©ã®ç®¡çã«ä¸»ç¼ãç½®ãã¦ãããããèµ·åæ¸ã¿ã®ã¿ã¹ã¯ã®æ å ±ãè¦ãæ段ãããã¾ããã§ããã
ecspresso tasks
ãå®è¡ããã¨ããµã¼ãã¹ããèµ·åãããã¿ã¹ã¯ã¨ãåãã¿ã¹ã¯å®ç¾©ãæã£ãã¿ã¹ã¯(åä½ã§ run ããããã®ãå«ã) ã表示ãã¾ãã
$ ecspresso --config config.yaml | ID | TASKDEFINITION | INSTANCE | LASTSTATUS | DESIREDSTATUS | CREATEDAT | GROUP | TYPE | +----------------------------------+--------------------+----------+----------------+---------------+---------------------------+-----------------------+---------+ | 28852184e15e48e0aad6b7549f92ed65 | ecspresso-test:274 | | RUNNING | RUNNING | 2021-04-13T13:45:23+09:00 | service:nginx-local | FARGATE | | bed89f2e492e44cd82d75776ff2d8a7f | ecspresso-test:276 | | RUNNING | RUNNING | 2021-04-13T13:48:04+09:00 | service:nginx-local | FARGATE | | fad8863654f945588273916a3a56bd95 | ecspresso-test:275 | | DEPROVISIONING | STOPPED | 2021-04-13T13:46:21+09:00 | family:ecspresso-test | FARGATE |
--find
ãªãã·ã§ã³ãä»ãã㨠exec åæ§ã«ã¿ã¹ã¯ãçµãè¾¼ãã§ã決å®ããã¨ãã®ã¿ã¹ã¯ã®æ
å ±ã JSON ã§åºåãã§ãã¾ãã
åæ¢ããã¿ã¹ã¯ã«ã¤ãã¦ã API ã§åå¾ã§ããæç¹ã¾ã§ã¯é²è¦§ã§ããã®ã§ããªããä¸æãèµ·åã§ããã«è½ã¡ã¦ãã¾ã£ãã¿ã¹ã¯ã§ã詳細ã表示ããã°ãããã¼ã¸ã¡ã³ãã³ã³ã½ã¼ã«ãè¦ã«è¡ããã«çç±ãåããã¾ãã
次ã®ä¾ã§ã¯ã"stoppedReason": "Essential container in task exited"
ãªã©ãèªã¿åãã¾ãã
$ ecspresso --config config.yaml --id fad8863654f945588273916a3a56bd95 --output json { "attachments": [ ... ], "availabilityZone": "ap-northeast-1c", "capacityProviderName": "FARGATE", "clusterArn": "arn:aws:ecs:ap-northeast-1:123456789012:cluster/ecspresso-test", "connectivity": "CONNECTED", "connectivityAt": 1618289185.693, "containers": [ ... ], { "containerArn": "arn:aws:ecs:ap-northeast-1:123456789012:container/ecspresso-test/fad8863654f945588273916a3a56bd95/8a04958b-4918-4a15-b6d4-6b40791c4fba", "cpu": "0", "exitCode": 137, "healthStatus": "UNKNOWN", "image": "debian:buster-slim", "lastStatus": "STOPPED", "managedAgents": [ { "lastStatus": "STOPPED", "name": "ExecuteCommandAgent" } ], "name": "bash", "networkBindings": [], "networkInterfaces": [ { "attachmentId": "bcb4aa98-1dfe-4a08-9a29-9db6e15d8334", "privateIpv4Address": "10.3.3.161" } ], "runtimeId": "fad8863654f945588273916a3a56bd95-987533343", "taskArn": "arn:aws:ecs:ap-northeast-1:123456789012:task/ecspresso-test/fad8863654f945588273916a3a56bd95" } ], "cpu": "256", "createdAt": 1618289181.026, "desiredStatus": "STOPPED", "enableExecuteCommand": true, "executionStoppedAt": 1618289229, "group": "family:ecspresso-test", "healthStatus": "UNKNOWN", "lastStatus": "STOPPED", "launchType": "FARGATE", "memory": "512", "overrides": { "containerOverrides": [ { "command": [ "nginx", "-V" ], "name": "nginx" }, { "name": "bash" } ], "inferenceAcceleratorOverrides": [] }, "platformVersion": "1.4.0", "pullStartedAt": 1618289214.039, "pullStoppedAt": 1618289223.039, "startedAt": 1618289229.039, "stopCode": "EssentialContainerExited", "stoppedAt": 1618289345.672, "stoppedReason": "Essential container in task exited", "stoppingAt": 1618289280.886, "tags": [], "taskArn": "arn:aws:ecs:ap-northeast-1:123456789012:task/ecspresso-test/fad8863654f945588273916a3a56bd95", "taskDefinitionArn": "arn:aws:ecs:ap-northeast-1:123456789012:task-definition/ecspresso-test:275", "version": 6 }
rollback ã³ãã³ãã CodeDeploy ã«å¯¾å¿
ããã¾ã§ ecspresso rollback 㯠CodeDeploy ã§ãããã¤ãããå ´åã«ã¯æ©è½ãã¾ããã§ããããæ©è½ããããã«ãªãã¾ããã Feature Request: Rollback by CodeDeploy by cohalz · Pull Request #261 · kayac/ecspresso · GitHub
ã¿ã¹ã¯å®ç¾©ã¸ã®ã¿ã°ä»ãã«å¯¾å¿
ããã¾ã§ã¯ã¿ã¹ã¯å®ç¾©ãã¡ã¤ã«ã« tags ãè¨è¿°ãã¦ãã¿ã°ãä»ä¸ãããã¨ãã§ãã¾ããã§ããããã¿ã°ãã¤ããããããã«ãªãã¾ããã
ããã«ä¼´ã£ã¦ãã¿ã¹ã¯å®ç¾©ãã¡ã¤ã«ãåãæ±ãã¨ãã« AWS SDK Go ã® ecs.TaskDefinition
ã使ç¨ãã¦ããé¨åããecs.RegisterTaskDefinitionInput
ã使ç¨ããããã«å¤ãã£ã¦ãã¾ããJSON ãã¡ã¤ã«ã¨ãã¦æ±ãå ´åã«ã¯äºææ§ãæããã¦ãã¾ãããããä½ãåé¡ãããã¾ããããç¥ãããã ããã
{ "tags": [ { "key": "TagKey", "value": "TagValue" } ] }
Support tagging for task definition. by fujiwara · Pull Request #260 · kayac/ecspresso · GitHub
ãã°ä¿®æ£
init ã³ãã³ãå®è¡æã« ECS ãµã¼ãã¹ã® propagateTags å±æ§ãæ±ããããã«
ããã¾ã§ã¯ init ã³ãã³ãã§æ¢å ECS ãµã¼ãã¹ãå®ç¾©ãã¡ã¤ã«åããæç¹ã§ propagateTags å±æ§ãæ¶ãã¦ãã¾ããããä¿æããããã«ãªãã¾ããã
verify ã³ãã³ãå®è¡æã« ELB ã®æ¤è¨¼ãã¿ã¹ã¯å®è¡ãã¼ã«ã§ã¯ãªã ecspresso ã®å®è¡æ¨©éã§è¡ãããã«
ããã¾ã§ã¯ verify ã³ãã³ãå®è¡æã® ELB (target group) ã®æ¤è¨¼ããã¿ã¹ã¯å®è¡ãã¼ã«(ã«AssumeRoleããç¶æ )ã§è¡ã£ã¦ãã¾ããããecspresso èªä½ã®å®è¡æ¨©éã§è¡ãããã«å¤æ´ãã¾ããã
ã¿ã¹ã¯å®è¡ãã¼ã«ã«ã¯æå°éã®æ¨©éããæãããªãæ¹ãæã¾ãããã¨ããçç±ã§ããv1.5 ã®æç¹ã§ã¯ecspresso ã®å®è¡æ¨©éã§ã®æ¤è¨¼ã«å¤±æããå ´åãã¿ã¹ã¯å®è¡ãã¼ã«ã§ã®æ¤è¨¼ã«ãã©ã¼ã«ããã¯ãã¾ããããã®æåã¯ç§»è¡æªç½®ã¨ãã¦æ¬¡ã®ãªãªã¼ã¹ã§åé¤ããäºå®ã§ãã
ecspresso handbook ãæ¹è¨äºå®ã§ã
ãã¿ã¾ãããv1.4.0 ãªãªã¼ã¹æã«æ¹è¨äºå®ã¨ãã¦ãã¾ããããã¾ã handbook 㯠v1.3 対å¿ã®ã¾ã¾ã§ããv1.4, 1.5 ã§ã®å¤æ´ã«ã¤ãã¦å çäºå®ã§ãã®ã§ãå¼ãç¶ãããããé¡ããã¾ãã
GitHub Sponsors ã¯ããã¾ãã
One-time ã®ã¹ãã³ãµã¼ãã§ããããã«ãªã£ã¦ãã¾ãã®ã§ããããããã°ãã¡ãããæ¤è¨ãã ããã