{"id":289,"date":"2022-02-06T01:56:31","date_gmt":"2022-02-06T01:56:31","guid":{"rendered":"https:\/\/192.168.1.3\/wordpress\/?p=289"},"modified":"2024-12-20T03:45:44","modified_gmt":"2024-12-20T03:45:44","slug":"aws-solution-architect-associate-saac02-review-material-container-management","status":"publish","type":"post","link":"https:\/\/mylinuxsite.com\/wordpress\/?p=289","title":{"rendered":"AWS Solution Architect Associate (SAA-C02) Review Material  &#8211; Container Management"},"content":{"rendered":"\n<!--more CONTINUE READING-->\n\n\n\n<h4 class=\"wp-block-heading\">ECS<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>A fully managed container orchestration service that makes it easy for you to deploy, manage, and scale containerized applications.<\/li><li>Only support Docker containers.<\/li><li><strong>Tasks and Services:<\/strong><ul><li><strong>Tasks<\/strong>:<ul><li>A <strong>task definition<\/strong> is required to run Docker containers in Amazon ECS which defines:<ul><li>The <strong>Docker image to use<\/strong> with each container in your task<\/li><li>How much <strong>CPU and memory <\/strong>to use with each task or each container within a task<\/li><li>The <strong>launch type to use<\/strong>, which determines the infrastructure on which your tasks are hosted<\/li><li>The <strong>Docker networking mode<\/strong> to use for the containers in your task<\/li><li>The <strong>logging configuration <\/strong>to use for your tasks<\/li><li>Whether the task should continue to run if the container finishes or fails<\/li><li>The command the container should run when it is started<\/li><li>Any <strong>data volumes <\/strong>that should be used with the containers in the task<\/li><li>The <strong>IAM role that your tasks should use<\/strong><\/li><\/ul><\/li><li><span class=\"has-inline-color has-vivid-cyan-blue-color\">A Task is a running container<\/span>.<\/li><li>Can be invoked by CloudWatch Event\/Event Bridge.<\/li><li>Can autoscale via CloudWatch Metric. <\/li><\/ul><\/li><li><strong>Service<\/strong>:<ul><li>Allows you to run and maintain a specified number of instances of Tasks.  It is usually used for long-running processes.<\/li><li> Can be configured to talk to an ALB<\/li><\/ul><\/li><\/ul><\/li><li>Manages worker nodes &#8211; either an EC2 or Fargate<\/li><li>2 Launch Types:<ol><li><strong>EC2<\/strong> Launch Type<ul><li>Requires an ASG<\/li><li>Requires an agent installed on the EC2 (not required to be installed if used AMI for ECS)<\/li><li>Can have it&#8217;s private IP or use VPC IP<\/li><\/ul><\/li><li>Fargate<ul><li>Serverless offering. Does not require to provision EC2 instances.<\/li><li>Will assign an ENI for each running task.<\/li><li>Will use VPC IP.<\/li><\/ul><\/li><\/ol><\/li><li>Integration with ALB (<strong>Dynamic Port Mapping<\/strong>) for EC2 Launch Type. Must allow in Security Group ALB access to all ports. Fargate use fix port (ENI) <\/li><li>Requires 2 types of IAM Roles:<ul><li>EC2 Instance Profile:<ul><li>Used by the ECS agent to make AWS API calls (e.g. CloudWatch, ECS service)<\/li><\/ul><\/li><li>ECS Task <ul><li>Used by the ECS task to make AWS API calls.<\/li><li>Good practice to use different roles for each task,<\/li><\/ul><\/li><\/ul><\/li><li>Normally use <strong>EFS<\/strong> for task volume.<\/li><li><strong>Rolling Update<\/strong><ul><li>Uses <strong>Minimum Healthy Percent <\/strong>and <strong>Maximum Healthy Percent<\/strong><\/li><li>Minimum Healthy Percent &#8211; the minimum number of tasks that must be running as a percentage of the total.<\/li><li>Maximum Healthy Percent &#8211; the  maximum number of tasks that must be running as a percentage of that total<\/li><li>Example 1:<ul><li>4 Running Task; Minimum= 50% Maximum = 100%<ul><li>Cannot add new version before terminating the old version since Maximum = 100% (i.e. current running task is already 100%)<\/li><li>Can only terminate 2 instances for replacement (50 % of 4) before adding a new version.<\/li><\/ul><\/li><li>4 Running Task; Minimum= 50% Maximum = 150%<ul><li>Can add additional 2 instances since the Maximum is 150% before terminating the old version (so total is now 6)<\/li><li>Can terminate 2 instances and replace them with a new version so we can maintain 4 running tasks.<\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">EKS<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>A managed <strong>Kubernetes<\/strong> service<\/li><li>2 Launch Types:<ol><li><strong>EC2<\/strong> Launch Type<ul><li>Requires an ASG<\/li><li>Requires an agent installed on the EC2 (not required to be installed if used AMI for ECS)<\/li><li>Can have it&#8217;s private IP or use VPC IP<\/li><\/ul><\/li><li>Fargate<ul><li>Serverless offering. Does not require to provision EC2 instances.<\/li><li>Will assign an ENI for each running task.<\/li><li>Will use VPC IP.<\/li><\/ul><\/li><\/ol><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[11],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-aws-review-notes"],"_links":{"self":[{"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=289"}],"version-history":[{"count":15,"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":1402,"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/289\/revisions\/1402"}],"wp:attachment":[{"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mylinuxsite.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}