21 ms·
How Far Out Is AWS Fargate?
- mullingitover 7y ago> "Compare that with AWS EKS pricing where the Kubernetes cluster alone is going to cost you $144 a month. A cluster isn’t terribly useful without something running on it, but just wanted to highlight that Fargate doesn’t come with a cost overhead." That $144 a month is a deal considering it's just the price of a few instances that you'd normally provision anyway if you were rolling your own k8s cluster, and it manages the control plane administration for you. The moment your hand-rolled k8s cluster goes the way of so many horror stories [1] that savings evaporates into hours of expensive engineering labor hours wasted. [1] https://k8s.af https://k8s.af
- symfrog 7y agoEKS has its own share of problems, and in several cases they can't be mitigated due to the limitations that EKS imposes. For example: - Service cluster IP range is not definable, making it difficult to integrate with an existing network topology [1] - Limited choice of CNIs, e.g. Calico can not be used - No accessible etcd snapshots for recovery I tend to avoid EKS and prefer to create most clusters by using kubeadm as the foundation. [1] https://github.com/aws/containers-roadmap/issues/216 https://github.com/aws/containers-roadmap/issues/216
- markbaikal 7y agoCalico can be used on EKS!? https://docs.aws.amazon.com/eks/latest/userguide/calico.html https://docs.aws.amazon.com/eks/latest/userguide/calico.html
- symfrog 7y agoCalico can only be used as the network policy engine on EKS, not as the CNI
- micah_chatt 7y agoEKS Engineer here. Calico policy can be used with the AWS VPC CNI, but you can remove the default CNI and install Calico or any other CNI plugin you’d like.
- symfrog 7y agoIn theory, you could replace the CNI on worker nodes, but is that something that is practically useful (when it can't be done on master nodes in EKS) and supported? How would the kube-apiserver, for example, communicate to the metrics-server if it is not connected to the Calico network?
- micah_chatt 7y agoYou are correct that the API server is only aware of the VPC network, and not any overlays. One solution to the metrics-server or other webhooks is to use host-networking mode so the API server can have connectivity.
- jrockway 7y agoIndeed, the networking layer that EKS forces upon you is quite strange. For example, you can only run 17 pods on a t3.medium instance because of how IP addresses are managed in your VPC (and because of various mandatory daemonsets that run pods on every machine, like aws-node). Most people will likely find out about this very low limit not in normal operations, but when one AZ blows up and pods are rescheduled on other AZs. You will hit the pod limit, things will be down and nothing new will schedule. And Amazon provides no meaningful monitoring for health at the control plane level; you need to bring all that yourself. Managing worker nodes is also a huge pain. They recently released a tool that manages some of it, but it doesn't work with older clusters. To do something simple like fix a vulnerability in the linux kernel, you have to make a new CloudFormation stack (involving cutting and pasting a ton of random stuff; the template ID, the AMI ID, etc.), edit several security groups, start the new nodes, make sure they join, drain the old nodes, delete the old stack, edit security groups. Upgrading the Kubernetes version in the cluster is a similar story, especially if you skipped an intermediate version. (That said, incidental changes like adding more nodes is easy. It's a lot rarer than upgrading Linux or the k8s version, however.) Their load balancers other than Classic don't work every well either. I would prefer to use a NLB for all incoming traffic (terminated by Envoy in the cluster which does the complicated routing) but that apparently results in kube-proxy not working right... and every time you change a set of pods whose selector matches the NLB service, it changes all the IP addresses in DNS, and traffic just stops arriving until the DNS TTL changes. It is very broken and the docs should say "never even think about using this" instead of "it's beta and here are some weird caveats that probably won't dissuade you from using it". Anyway, my overall impression of EKS is that Jeff Bezos walked into someone's office, said "you're all fired if we don't have some half-ass Kubernetes service in the next 3 months" and walked out. The result is EKS. It's wayyyyyy better than being locked into Amazon's crazy stuff (CloudFormation, etc.) but it's not as good as what other managed k8s providers offer. If I were to setup k8s again, I would just buy my own servers and self-host everything. Dealing with Things That Can Go Wrong With Servers is much easier than dealing with Things That Can Go Wrong With AWS. (But I already have a datacenter, can get the machines a 100Gbps connection to the Internet for free, and have a team of network engineers to tell me which CNI to use. If I didn't have that I would just use GCP.)
- micah_chatt 7y agoEKS Engineer here, thanks for the feedback. Service IP configurability is a very common ask, and as you’ve linked, is on our roadmap along with a slew of other control plane configuration options. You can delete the AWS VPC CNI DaemonSet and install any CNI plugin you’d like. EKS regularly backs up etcd and has automatic restore in the case of a failure. Manually restoring to an old snapshot would be quite disruptive. What is your use case, and what would be the interface you’d like to see?
- 9nGQluzmnq3M 7y agoGKE, the equivalent GCP service, is free though. You pay for your nodes at regular Computer Engine rates, but the master is at no extra cost.
- fitzoh 7y agoSame story for Azure and Digital Ocean, AWS is the outlier here.
- yebyen 7y agoAbsolutely, but it's worth mentioning that it's not zero-cost for those providers. (I have no idea what their actual cost is, and I assume they take steps to minimize it...) EKS is priced competitively, with Amazon's other offerings. I was a part of the chorus of voices saying "wtf Amazon, control planes ought not cost, nobody else is charging for them" but I think this is fairly priced for what it is... it only takes four reserved M4.large instances to eclipse the cost of an EKS cluster, and you will likely want more than that if you are aiming for real High Availability and trying to build it on your own EC2 nodes. The default configuration of EKS is fully HA, AIUI is built to be resilient to faults like failure of an entire region. If you don't want to pay for the Kubernetes API, the interop chances for engaging outside support that it gives you, and the associated complexity required to support it and keep pace with the release cadence, then there is also Fargate which is cheaper at low scale, (or my preference, go with the competition who have all agreed to undercut AWS, so why not take advantage as it's clearly favorable to run at least some of those workloads elsewhere.) And hey, there's even Virtual Kubelet on Fargate if you want to get the best of both worlds, right? Of course that one comes with a big warning, DO NOT run any Production...
- guidedlight 7y agoAWS Fargate seems very similar to what Hyper.sh used to offer (before they shutdown)
- sejtnjir 7y agoare you implying Fargate will suffer the same fate?
- lukasLansky 7y agoAs much as I like the described move from "functions" to "containers", solutions like KNative / Cloud Run are still inherently more hackable than solutions like Fargate. It's good to have properly defined, stable, open interface for compute workloads (containers as defined by OCI), so we don't have to lock ourselves into whatever shape of runtime environment our current cloud provides for their flavor of FaaS. So we don't have to learn cloud-provider-specific tooling, getting certifications for handling various tasks at AWS, becoming 2010s variants of Cisco-certified network engineers of the previous age. But it's even better to have a properly defined, stable, open interface for orchestration too. To be able to run stuff locally. To be able to extend things. To ease the lock-in cloud providers currently have. To be able to actually understand what happens under the hood. And last but not least: to enable rise of open source solutions for higher-level abstractions, like KubeDB.
- k__ 7y agoFunny that both sides has its gripes with Fargate. For a serverless proponent like me it's still too much config. For a no lock-in proponent like you it's not enough config.
- StavrosK 7y agoThe way to satisfy both camps is sane defaults.
- shabda 7y ago“A good compromise is when both parties are dissatisfied”
- jjoonathan 7y agoA bad compromise leaves both parties dissatisfied, too.
- blowski 7y agoWhat's the Azure equivalent of Fargate? I have to migrate a bunch of small containerised PHP apps from AWS ECS into Azure, but while ECS has been easy, I'm sceptical of our ability to work with Kubernetes. I've looked at App Service, but I don't know anyone that's had experience. If anyone has any feedback or advice I'd happily hear it.
- tripue 7y agoThere's also a service called Azure ACI which is pretty much the same thing as fargate
- tootie 7y agoNot sure there is a direct equivalent but Azure App Service will let you deploy a docker image and autoscale. The configuration is more analogous to AWS Elastic Beanstalk but they serve similar purposes.
- dkkapur 7y ago(disclaimer: I work for Azure on ACI and other container offerings) Azure Container Instances (ACI) is what you're looking for. The intent behind ACI is to provide the easiest/simplest way for you to deploy serverless containers in Azure (no management of underlying infrastructure). See this to get started: https://docs.microsoft.com/en-us/azure/container-instances/container-instances-quickstart https://docs.microsoft.com/en-us/azure/container-instances/c....
- mosselman 7y agoFargate is pretty useful and it works well... when it works. One of the most annoying things is that you can't (as far as I know and I hope someone will correct me and show me the light) see the errors from the docker engine. This means that if there is some issue while spinning up your docker instances that you'd normally see in the docker engine's log, you won't know what is going on when using fargate. This makes debugging these issue a nightmare. Again, I hope I am just stupid and that there is some obvious way with which I CAN see the logs and someone will point out to me how.
- mr-karan 7y agoIf your container feels to even run, then no logs are generated. Logs are only generated after your container spawns. So if you get errors in your `ENTRYPOINT` or `CMD` commands, the only way is to override these commands with something like [1] and debug why it's failing. [1]: `command: ["/bin/sh", "-c", "sleep 36000"]`
- NathanKP 7y agoI don't think I've ever seen an error from the "docker engine" on AWS Fargate. There is a task status field on the task, so if your container completely fails to start because you have a bad entrypoint command that can't be executed or your process immediately exits with a non zero exit code without outputting anything to stdout/stderr you will see a task status that says that the task stopped unexpectedly because the container exited, and why the container exited. If your containerized process does start and output to stdout/stderr, but then crashes for some reason you can see those stdout/stderr logs in CloudWatch, via the awslogs logging driver. In general I'd say the docker engine logs are the wrong place to try to diagnose an app running AWS Fargate. The point of AWS Fargate is to abstract away the Docker daemon, and just run your containers for you. So if the Docker engine itself was failing for some reason that is an issue for the AWS team on call to fix. Your area of responsibility starts with the application code that is running inside your container. The bits outside the container are the responsibility of an AWS employee.
- joemccall86 7y agoOne thing I'm keeping my eye on is the fargate virtual kubelet [1]. It seems to offer a way to use the familiar kubernetes tooling with a managed "clusterless" offering like fargate. [1] https://github.com/virtual-kubelet/aws-fargate https://github.com/virtual-kubelet/aws-fargate
- kylek 7y agoWhy deal with the complexity of one when you can have both! (/s...)
- KaiserPro 7y agoThe problem with fargate is that like all AWS "compound tools" that are meant to be an answer to competitor x, is that they are painful to use if you don't have an infra team take elastic beanstalk, its meant to be a competitor to heroku(thats how it was pitched to us in $big company), but my word it misses the mark. Lambda and API gateway is a massive faff to setup manually, but serverless and zappa make it really really simple to do. That and its cheapness is why its caught on, its fast(to iterate), simple enough and super cheap. Fargate is kinda aimed at people who have out grown lambda, but then you will be evaluation the whole hosting ecosystem. But if you are evaluating hosted K8s, I don't know why you wouldn't just plump for GKE. Mind you, avoiding K8s and sticing with lambda + ECS for long running stuff is far simpler to understand, even if updating it with CF is a massive ball ache.
- tootie 7y agoI'm pretty sure Beanstalk predates Heroku. I'm curious how you think it misses the mark though. I've found it to be really easy to operate although that's mostly low-traffic systems.
- sokoloff 7y agoHeroku was 2007. Beanstalk was 2011. Salesforce purchased Heroku in 2010 for $212MM in cash before Beanstalk was even announced.
- aphexairlines 7y agoBeanstalk was announced in 2011. Heroku came out of beta in 2009.
- deleted 7y ago[deleted]
- lkschubert8 7y agoI don't see how you could say it doesn't miss the mark of being a heroku level PaaS competitor. Heroku is leaps and bounds simpler to use and configure for most use cases. I mean getting started its either heroku new; git push or just point it at an existing public repo.
- codeulike 7y agoWatching this from a distance, I vaguely understood Docker. Then everyone was talking Kubernetes, and I vaguely grasped it was some kind of meta solution for something or other. And evidently really complicated but really buzzwordy. And then came Serverless which seems to really mean 'sortof stateless' and reminds me of MTS, an early Microsoft effort that let you run COM objects as a service on an NT server, but only if they were stateless. And now this thing, which I can't begin to fathom. In short, I am lost, but I'm beginning to wonder if all the cloud complexity might one day wrap back around to something very simple again.
- goatinaboat 7y agowonder if all the cloud complexity might one day wrap back around to something very simple again Yes, all these solutions are gradually converging back to CGI.
- jonahbenton 7y agoYou are exactly right, serverless is very much like COM (and wow, haven't thought of MTS in decades), except (!) that there is no mechanism for defining standard interfaces provided by a component, and no registry in which to indicate that said component provides said interfaces...yet. The "ServiceCatalog" cloud product will be the vehicle through which the concept of interfaces is delivered to serverless. Absent interfaces, you might think serverless is spaghetti messiness, and you would be right. We are in a very messy infrastructure stage at the moment, which really just revolves around 3 concepts- being able to run code on a lot of machines as "easily" as one machine (kubernetes), being able to support in that context multiple runtime languages consistently (docker), while also protecting the machines the code is running on from malicious and/or poorly behaved code (kubernetes and docker together). So maybe we will soon get back to a place of "simplicity" with a stateless function-oriented programming model that looks a lot like COM/DCOM, hopefully with better ergonomics.
- JakaJancar 7y agoApproachability-wise, wouldn't an even better approach be to drop ECS Fargate (in terms of API) and simply add to EC2 the ability to execute Docker images, instead of AMIs? Feels like if AWS started with dedicated boxes, they'd now be calling EC2 the "Elastic VM Service Fargate".
- jon-wood 7y agoRunning Docker images directly on EC2 instances is also supported by ECS, in fact it the first iteration of ECS required you to run a cluster of EC2 instances. The API to do so is identical to the one used for Fargate.
- digianarchist 7y agoRight but with ECS on EC2 you are still responsible for maintaining the underlying AMI. Security patches etc. This was the major reason we wanted to move to Fargate in our org.
- londons_explore 7y agoThe best way to describe a service, rather than 1000 words of buzzword heavy text, is a service diagram, a hello world example of the config, and a more complex example showing off the best/main features. I don't want to hear that 'it's a bit like kubernetes but not quite'. I want to try it inside 30 seconds and see for myself.
- moduspol 7y agoYep. For new AWS services, I always end up having to open the web interface and click through the GUI before any of the rest of the explanations make sense.
- x86_64Ubuntu 7y agoYes, I generally will read about a service, then click around the GUI to make "something". Then I'll put something in terraform (roles, needed buckets, images) and then try to make it go. As someone else said, a diagram with a quick-starter implementation would go far in getting people interested.
- deleted 7y ago[deleted]
- brento 7y ago> I want to try it inside 30 seconds and see for myself. So let me get this straight, you want to try something as complicated as Kubernetes, inside of 30 seconds? I'm thinking you might have some unrealistic expectations.
- vinceguidry 7y agoI don't think he meant 30 secs to "evaluate" the service. But you should be able to get enough from a pitch page to know whether or not it would be worth clicking through to "Getting Started" and installing the prereqs.
- joseph 7y agoI think it is a realistic expectation. Think of EC2 in 2006. Getting started was almost immediate if you already had an Amazon account. You downloaded a CLI tool and your credentials, and started a VM. Prior to this, it might have seemed unrealistic to provide such a streamlined experience. I would love to see the same done for Kubernetes. What I want is a kubeconfig file that links me to a paid account somewhere, and whenever I run `kubectl apply -f foo.yml`, I pay by the millisecond for whatever resources get created. Zero ops for me the customer, and all the complexity will be on the side of the company offering this service.
- hendry 7y agoIterations are still crazy slow compared to AWS Lambda. :( https://s.natalian.org/2019-08-15/cdk-containers.mp4 https://s.natalian.org/2019-08-15/cdk-containers.mp4
- holografix 7y agoDisclaimer: I work for Salesforce, Heroku’s parent company. When Fargate was released I was very curious about it as it seemed like AWS was moving up the ladder towards PaaS and I wanted to know how it compares to Elastic Beanstalk and also Heroku. I started going through this AWS written tutorial: https://aws.amazon.com/getting-started/projects/build-modern-app-fargate-lambda-dynamodb-python/module-two/ https://aws.amazon.com/getting-started/projects/build-modern... The app they use as an example is of course meant to demonstrate how a plethora of AWS services can work together. I still couldn’t help but be surprised at the sheer number of different things I had to learn and configure, sometimes involving editing yaml. For long time AWS users: is that tutorial representative of how you really build apps in AWS?
- sudhirj 7y agoYes. The Heroku developer is still fantastic and pretty unique, and hasn’t been replicated (yet). If Heroku intends to maintain the lead, it’ll have to keep moving - the new offerings like Kafka and Redis before a pretty good - providing S3, SNS and SQS as addons would also be pretty great - right now one still needs to drop into AWS for these services. Heroku also really needs to wake up to the world outside the US and Europe. Just enabling the other regions (for general use, not the super expensive private spaces) would be a step on the right direction.
- joncrane 7y agoYeah, seems about right for a tutorial. In real life things are never as simple or well suited to the underlying technology so it's lots of painful little missteps until you get it "just right" for your use case and the strange rules you're subject do because of your organization.
- throwawayFCfan 7y agoThat is exactly it, except sometimes you're editing or copy-pastaing JSON instead of YAML. I've often assumed that no one's KPIs are tied to making things more usable or docs more readable, and everyone's KPIs are tied to shipping new features.
- 7y ago
- mharroun 7y agoI really dont get the hate or disinterest with ECS or fargate. It took me all of 4 days to come up with a CI/CD pipeline/production environment using ECS and fargate for the startup I was the cto for. We are now looking at kuberneties or reserved instances to save some money as we have scaled to angel->seed->series A. Though tbh its looking like the extra cost is worth it given the out of the box 1 click scaling, blue/green deployments and "conatiner as a server" level monitoring and logging.
- rynop 7y agoI have a CI/CD driven AWS Blueprint for Fargate - with a bunch of other production grade best practices built in. Should get you up and running in under an hour (much less if your experienced with AWS). https://github.com/rynop/aws-blueprint https://github.com/rynop/aws-blueprint
- bastardoperator 7y agoWhat took you 4 days takes seconds using tools like Jenkins X and Kubernetes. Just sayin...
- freehunter 7y agoIf you don't know Jenkins or Kubernetes it definitely will not take you seconds to learn them, spin them up, configure them, and put them into production.
- ewindisch 7y agoHumans are more expensive than infrastructure!
- chadash 7y agoFargate is a very useful service for anyone hopping on the serverless/lambda train. Here's a simple use case: say you have a simple banking website with a frontend and an API and whatever. People log in and check their balances, etc. Typically, this requires requests that take on the order of milliseconds, so lambda works for this [0]. However, every month, you want to go in and calculate what you owe in interest for everyone's account. Say that you have 100,000 users and it takes 0.01 seconds to do each calculation, so this job will take 1,000 seconds, or 16 minutes to run. Lambda functions are automatically killed after 15 seconds, so that won't work. That's where Fargate comes in. You dockerize your environment and then run a command in Fargate. Now, it runs for 16 minutes for the task itself + 1 or 2 minutes to wind up and then it automatically kills itself when it's done. You pay for the 16 minutes of run time and call it a day. [0] One issue with lambda/serverless is dealing with cold starts when your application hasn't been used in a while, or you need more concurrent instances running, so it takes some time to "warm up". This is a good reason not to use serverless frameworks in many cases, but I won't get into that.
- alpha_squared 7y agoMild correction, but AWS lambdas are limited to 15 minutes of execution time as of October 2018 [0]. Prior to that, they were limited to 5 minutes. > One issue with lambda/serverless is... when you need more concurrent instances running... Lambda can have 1,000-3,000 concurrent burst invocations for most of the popular regions and 500 for others[1]. Are you saying that's not enough? [0] https://aws.amazon.com/about-aws/whats-new/2018/10/aws-lambda-supports-functions-that-can-run-up-to-15-minutes/ https://aws.amazon.com/about-aws/whats-new/2018/10/aws-lambd... [1] https://docs.aws.amazon.com/lambda/latest/dg/scaling.html https://docs.aws.amazon.com/lambda/latest/dg/scaling.html
- chucky_z 7y agoI recently had a use-case where that wasn't enough, and AWS would not give us enough concurrent invocations either.
- sten 7y agoI've run into this problem. But I believe the parent was referring to the situation where new lambdas spin up and aren't immediately ready to respond to invocations. The delay can be significant in some cases though almost immeasurable in aggregate.
- lvh 7y agoWe use Fargate a lot for internal tooling. It's pretty great! Being able to schedule containers instead of Lambdas is nice, and genreally not having the restrictions of a Lambda environment is nice. We have, no joke, Lambdas that kick off Fargate tasks to do "actual work". Why do we have Lambdas? Because that's the integration point AWS has everywhere. "Run code when X happens" on AWS means a Lambda, so that's what we use.
- poxrud 7y agoI think that this should be the only use case for lambdas. They should respond to events and act as the glue between aws services. If you're doing anything that requires a running time of over 200ms you should be using a proper app server, probably inside a docker container.
- pbalau 7y agoI have on my todo list a lambda function that will get invoked from bitbucket and will kick off a bunch of tasks. Then another one that can be called multiple times and let you know if those tasks finished and the exit code.
- joshstrange 7y agoSmall note if OP is author or author is in the thread: There are two typo's of the word "Firecracker" spelled as "Firecrracker". It's spelled correctly in between and right after the second misspelling. > Under the hood, they share the same virtualization technology called Firecrracker. Firecracker is a KVM-based virtualization layer that creates and manages minimalistic container-like virtual machines called “microVMs”. Firecrracker is still relatively new and was designed from the ground up to address issues identified with the previous generation of AWS Lambda.
- adjohn 7y agoFixed, thanks for the heads up!
- jknoepfler 7y agoI stopped reading when the author claimed Fargate gave Kubernetes a run for it's money, which is blatantly false. They don't even occupy the same niche. Also, no, shitty lambda for containers does not give a hyperscaling container / virtual networking / etc. orchestrator designed to manage millions of persistent containers a "run for its money"
- auslander 7y agoYou can run pure ECS without using Fargate, all it takes is to write a bit of extra Cloudformation code. Worked for me, with autoscaling.
- scarface74 7y agoMy experience with Fargate: I had a Node/Express microservice running in lambda using the lambda proxy integration to send and receive files from/to S3. I knew in advance that the 6MB request limit for lambda was going to hit us, but it was good enough for what we needed right then. When it came time, I knew I was going to have to convert to Fargate but I didn’t know anything about Docker or Fargate. It took less than a day for me to get the API up and running in Fargate following this tutorial. https://medium.com/@ariklevliber/aws-fargate-from-start-to-finish-for-a-nodejs-app-9a0e5fbf6361 https://medium.com/@ariklevliber/aws-fargate-from-start-to-f... And automating it with Cloud Formation https://github.com/1Strategy/fargate-cloudformation-example https://github.com/1Strategy/fargate-cloudformation-example To be fair, I did have experience with the other fiddly bits of AWS and CloudFormation so I knew how to modify the template to work in our own environment.
- ewindisch 7y agoAWS Serverless Community Hero and CTO/Co-founder of IOpipe here. AMA!
- yebyen 7y ago> I’ll also introduce you to a CLI tool that is Fargate’s equivalent to Kubernetes’ kubectl that can take you from a Dockerfile to a running web service in just two commands. Is anyone aware of this tool? Is it something I can check out now, or do I have to wait for the next installment? This sounds compelling, and even if I don't want to use Fargate, it will help me to relate with people that have used Fargate, and give us more common ground so we can talk on equal footing. (Subscribe me to your newsletter!)
- kolanos 7y agoAuthor here, the CLI tool is: https://github.com/jpignata/fargate https://github.com/jpignata/fargate Part 2 is still planned and is now being fast tracked since there's interest in Fargate.
- yebyen 7y agoThanks, this is awesome! I am not a fan of Fargate based on personal bias mostly towards K8s and a sour taste I got when Fargate and EKS were first announced together, (with Fargate "available now" and EKS coming soon, it felt very desperate, but that's neither here nor there...) Was very impressed by this screencast and will definitely try Fargate now thanks to your work here. When I got to the point in the screencast where you build the image locally, I was on the edge of my seat hoping it would include some CodeBuild setup automation too; maybe you have already planned that, (or maybe that would ruin its simplicity.) That was a great demo, even without this part.