github.com/awslabs/fargatecli@v0.3.2-0.20210502061925-aa1c09cd404e/doc/website/index.html (about) 1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <title>fargate :: A CLI for AWS Fargate</title> 5 6 <meta charset="utf-8"> 7 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 8 9 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous"> 10 11 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300i,400,900"> 12 <link rel="stylesheet" href="styles.css"> 13 </head> 14 <body> 15 <div class="container"> 16 <div class="row"> 17 <div class="jumbotron"> 18 <div class="hed"> 19 <h1 class="display-1">fargate</h1> 20 <p class="lead">Deploy serverless containers onto the cloud from your command line</p> 21 </div> 22 23 <div class="hed-image"> 24 <img src="fargate.png"> 25 </div> 26 27 <div class="intro"> 28 <p><i>fargate</i> is a command-line interface to deploy containers to 29 <a href="https://aws.amazon.com/fargate/">AWS Fargate</a>. Using 30 <i>fargate</i>, developers can easily run containers as one-off tasks 31 or managed, highly available services secured by free TLS certificates. It bundles the power of AWS including <a href="https://aws.amazon.com/ecs/">Amazon Elastic Container Service (ECS)</a>, <a href="https://aws.amazon.com/ecr/">Amazon Elastic Container Registry (ECR)</a>, <a href="https://aws.amazon.com/elasticloadbalancing/">Elastic Load Balancing</a>, <a href="https://aws.amazon.com/certificate-manager/">AWS Certificate Manager</a>, <a href="https://aws.amazon.com/cloudwatch/details/">Amazon CloudWatch Logs</a>, and <a href="https://aws.amazon.com/route53/">Amazon Route 53</a> into an easy-to-use CLI.</p> 32 </div> 33 34 <hr class="my-4"> 35 36 <p class="lead actions"> 37 <a class="btn btn-primary btn-lg" href="#download" role="button"> 38 <span class="display-5">Get Started</span> 39 </a> 40 41 <a class="btn btn-secondary btn-lg" href="https://github.com/awslabs/fargatecli" role="button"> 42 <img src="github.png" class="icon"> 43 <span class="display-5">jpignata/fargate</span> 44 </a> 45 </p> 46 47 </div> 48 </div> 49 50 <div class="video row"> 51 <iframe width="100%" height="480" src="https://www.youtube.com/embed/P6iY6ovhbfc" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> 52 </div> 53 54 <div class="row examples"> 55 <div class="card"> 56 <div class="card-body"> 57 <h4 class="card-title">Run a Task from a Public Image</h4> 58 <p class="card-text">Tasks are one-time executions of your 59 container. You can run a task with a public IP address from an 60 image on Docker Hub in a single command:</p> 61 62 <p><pre>$ fargate task run web --image nginx:latest 63 [<span class="blue">i</span>] Running task web 64 65 $ fargate task ps web 66 ID IMAGE STATUS RUNNING IP CPU MEMORY 67 8c35747a-7c1c-4efe-b55a-8dfbc1108d82 nginx:latest Running 35s 34.228.17.157 256 512 68 69 $ curl -s http://34.228.17.157 | grep title 70 <title>Welcome to nginx!</title></pre></p> 71 </div> 72 </div> 73 74 <div class="card"> 75 <div class="card-body"> 76 <h4 class="card-title">Run a Task from a Local 77 <i>Dockerfile</i></h4> 78 <p class="card-text">If you omit the <i>image</i> flag, 79 <i>fargate</i> will build and push the application in the current 80 working directory to Amazon ECR:</p> 81 82 <p><pre>$ fargate task run web 83 [<span class="green">></span>] <span class="green">docker login --username AWS --password ******* 123456789012.dkr.ecr.us-east-1.amazonaws.com/web</span> 84 [<span class="green">></span>] <span class="green">docker build --tag 123456789012.dkr.ecr.us-east-1.amazonaws.com/web:20171227050818 .</span> 85 [<span class="green">></span>] <span class="green">docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/web:20171227050818 .</span> 86 l<span class="blue">i</span>] Running task web</pre></p> 87 </div> 88 </div> 89 90 <div class="card"> 91 <div class="card-body"> 92 <h4 class="card-title">Run a Service</h4> 93 <p class="card-text">Services are managed containers that are 94 restarted if a failure occurs. Like a task, you can deploy a service 95 using either a pre-existing Docker container or build and push it 96 using <i>fargate</i>.</p> 97 98 <p><pre>$ fargate service create myapp 99 [<span class="blue">i</span>] Created service myapp</pre></p> 100 </div> 101 </div> 102 103 <div class="card"> 104 <div class="card-body"> 105 <h4 class="card-title">Run a Load Balanced Service</h4> 106 <p class="card-text">Services can be placed behind either an HTTP/HTTPS 107 or TCP load balancer to serve requests to multiple instances of 108 your container from a single URL.</p> 109 110 <p><pre>$ fargate lb create mylb --port 80 111 [<span class="blue">i</span>] Created load balancer mylb 112 113 $ fargate service create myapp --lb mylb --port 80 114 [<span class="blue">i</span>] Created service myapp</pre></p> 115 </div> 116 </div> 117 118 <div class="card"> 119 <div class="card-body"> 120 <h4 class="card-title">Deploy a New Image To a Service</h4> 121 <p class="card-text">Use <i>fargate</i> to either push images built 122 separately via continuous integration by using the <i>--image</i> 123 flag or build and push directly from your computer.</p> 124 125 <p><pre>$ fargate service deploy myapp 126 ... 127 [<span class="blue">i</span>] Deployed 123456789012.dkr.ecr.us-east-1.amazonaws.com/myapp:abcd1234 to service myapp</pre></p> 128 </div> 129 </div> 130 131 132 <div class="card"> 133 <div class="card-body"> 134 <h4 class="card-title">Scale Vertically</h4> 135 <p class="card-text">Containers running using AWS Fargate can range 136 from a quarter of a vCPU to 4 vCPUs and from 0.5GB of RAM to 30GB. 137 This command scales our containers to a single vCPU and 4GB of 138 RAM:</p> 139 140 <p><pre>$ fargate service update myapp --cpu 1024 --memory 4096 141 [<span class="blue">i</span>] Updated service myapp to 1024 CPU / 4096 MiB</pre></p> 142 </div> 143 </div> 144 145 <div class="card"> 146 <div class="card-body"> 147 <h4 class="card-title">Scale Horizontally</h4> 148 <p class="card-text">Services can scale to any number of instances 149 with a single command.</p> 150 151 <p><pre>$ fargate service scale web +2 152 [<span class="blue">i</span>] Scaled service web to 3 153 154 $ fargate service ps web 155 ID IMAGE STATUS RUNNING IP CPU MEMORY DEPLOYMENT 156 8c35747a-7c1c-4efe-b55a-8dfbc1108d82 nginx:latest Running 56s 34.228.17.157 256 512 1 157 0487456c-8dbe-49ff-b7e7-d772eee447af nginx:latest Running 56s 34.229.59.235 256 512 1 158 8c35747a-7c1c-4efe-b55a-8dfbc1108d82 nginx:latest Running 2h57m1s 34.228.17.157 256 512 1</pre></p> 159 </div> 160 </div> 161 162 <div class="card"> 163 <div class="card-body"> 164 <h4 class="card-title">Secure a Load Balancer with a TLS Certificate</h4> 165 <p class="card-text">Load balancers can use HTTPS ports secured by 166 a TLS certificate for your domain or domains. Domains hosted in 167 Amazon Route 53 can be automatically validated from <i>fargate</i>.</p> 168 169 <p><pre>$ fargate certificate request *.somanymachines.com 170 $ fargate certificate validate *.somanymachines.com 171 $ fargate lb create mylb --port 443 --certificate *.somanymachines.com 172 $ fargate service create myapp --lb mylb --port 80</pre></p> 173 </div> 174 </div> 175 176 <div class="card"> 177 <div class="card-body"> 178 <h4 class="card-title">Add Multiple Services to a Load Balancer</h4> 179 <p class="card-text">HTTP/HTTPS load balancers can support 180 multiple services and will route to them based upon defined rules 181 that match either the path or hostname of the request. This allows you 182 to run a single service or a dozen microservices behind a single load 183 balancer.</p> 184 185 <p><pre>$ fargate lb create mylb --port 80 186 $ fargate service create myapp --lb mylb --port 80 187 $ fargate service create myservice --lb mylb --port 80 --rule PATH=/myservice/* 188 $ fargate service create myotherservice --lb mylb --port 80 --rule PATH=/myotherservice/*</pre></p> 189 </div> 190 </div> 191 192 <div class="card"> 193 <div class="card-body"> 194 <h4 class="card-title">View Logs from a Running Task or 195 Service</h4> 196 <p class="card-text"><i>fargate</i> configures containers to log to 197 Amazon CloudWatch Logs which allow you to view or follow a log in 198 real-time. Tail logs using <i>--follow</i> or select a range of logs 199 using start and end times expressed as durations (e.g. <i>-1h</i>, 200 <i>-1m30s</i> or timestamps (e.g. <i>2017-12-12 15:00 EST</i>)</p> 201 202 <p><pre>$ fargate task logs myapp --follow --start "-15m" --filter "curl" 203 <span class="green">fargate/web/0487456c-8dbe-49ff-b7e7-d772eee447af</span> 172.31.41.97 - - [27/Dec/2017:05:32:17 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.21.3 (i386-portbld-freebsd8.1) libcurl/7.21.3 OpenSSL/0.9.8n zlib/1.2.3" "199.233.217.27" 204 <span class="blue">fargate/web/358c439f-0613-4d69-abe8-fe8b7a25f64e</span> 172.31.4.10 - - [27/Dec/2017:05:32:19 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.21.3 (i386-portbld-freebsd8.1) libcurl/7.21.3 OpenSSL/0.9.8n zlib/1.2.3" "199.233.217.27" 205 <span class="red">fargate/web/8c35747a-7c1c-4efe-b55a-8dfbc1108d82</span> 172.31.53.143 - - [27/Dec/2017:05:32:18 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.21.3 (i386-portbld-freebsd8.1) libcurl/7.21.3 OpenSSL/0.9.8n zlib/1.2.3" "199.233.217.27"</pre></p> 206 </div> 207 </div> 208 209 <div class="card"> 210 <div class="card-body"> 211 <h4 class="card-title">Create an Alias Record to a Load Balancer</h4> 212 <p class="card-text">If you're hosting your domain using Amazon 213 Route 53, you can create an alias record to your load balancer in 214 a single command:</p> 215 216 <p><pre>$ fargate lb alias mylb app.somanymachines.com 217 [<span class="blue">i</span>] Created alias record [app.somanymachines.com -> mylb-518172311.us-east-1.elb.amazonaws.com]</pre></p> 218 </div> 219 </div> 220 221 </div> 222 223 <a name="download"></a> 224 <div class="row header"> 225 <h3>Get Started</h3> 226 </div> 227 228 <div class="row"> 229 <div class="card-deck w-100"> 230 <div class="card"> 231 <div class="card-body"> 232 <h4 class="card-title"><img class="icon" src="apple.png"> macOS</h4> 233 <p class="card-text"> 234 <a href="https://github.com/awslabs/fargatecli/releases/download/v0.3.0/fargate-0.3.0-darwin-amd64.zip">64-bit</a> 235 </p> 236 </div> 237 </div> 238 <div class="card"> 239 <div class="card-body"> 240 <h4 class="card-title"><img class="icon" src="linux.png"> Linux</h4> 241 <p class="card-text"> 242 <a href="https://github.com/awslabs/fargatecli/releases/download/v0.3.0/fargate-0.3.0-linux-amd64.zip">64-bit</a> | 243 <a href="https://github.com/awslabs/fargatecli/releases/download/v0.3.0/fargate-0.3.0-linux-386.zip">32-bit</a> | 244 <a href="https://github.com/awslabs/fargatecli/releases/download/v0.3.0/fargate-0.3.0-linux-arm.zip">Arm</a> 245 </p> 246 </div> 247 </div> 248 <div class="card"> 249 <div class="card-body"> 250 <h4 class="card-title"><img class="icon" src="github.png"> Source</h4> 251 <p class="card-text"> 252 <a href="https://github.com/awslabs/fargatecli">jpignata/fargate</a> 253 </p> 254 </div> 255 </div> 256 </div> 257 </div> 258 259 </div> 260 </body> 261 </html>