[2024]Digital Global Overview Report 2024 Meltwater.pdf
Shipping apps to eks with code pipeline and lambda functions
1. Shipping apps to EKS with
CodePipeline and Lambda
functions
Stepan Vrany
Cloud Architect @ Revolgy
twitter.com/MstrsObserver
linkedin.com/in/stepanvrany
1
2. Ship faster to AWS! 2
A few things about
containerized workload and
Kubernetes
3. Ship faster to AWS! 3
Managed Kubernetes is easy to operate
4. Ship faster to AWS! 4
By design, it is able to prevent some
painful anti patterns from the past
5. Ship faster to AWS! 5
Container market is constantly growing.
“Gartner predicts that by 2022, more than 75% of global organizations will be
running containerized applications in production, which is a significant increase
from fewer than 30% today.”
https://www.gartner.com/smarterwithgartner/6-best-practices-for-creating-a-container-platform-strategy/
6. Ship faster to AWS! 6
https://dzone.com/articles/survey-reveals-rapid-growth-in-kubernetes-usage-se
And Kubernetes is playing a big role in
this movement
“When we first conducted the survey in November of 2018, 57% of respondents
were using Kubernetes. By mid-2019, the percentage of survey respondents who
said they use Kubernetes as their orchestrator grew from 57% to 86% – a 50%
increase.”
7. Ship faster to AWS! 7
Translated:
Kubernetes is most successful container
orchestration tool (so far)
8. Ship faster to AWS! 8
So perhaps it's a good idea to give it a
shot, right?
First of all, let's talk about conteineres, Kubernetes and IT folks. We, as Revolgy, really love containers, orchestration tools and Kubernetes.You might be asking: Why is that?
It is easy to operate. What I mean is: when you have reliable application, you can just put it inside the container and that's it. In case of failure it will be automatically restarted, in case of traffic peaks it will scale up and down if configured. What I don't mean: Kubernetes itself is not so easy to operate. Self-managed Kubernetes has certain pitfalls so it's always a good idea to start with managed Kubernetes services as EKS. Trust me, been there seen that.
The next very practical thing is that you can't just reapply some nasty practices from the legacy environments. For instance, it is not possible to open SSH connection somewhere, upload new artifacts and run the new application without any trace. Again, been there, seen that.The main building block of Kubernetes is a container, the container is being spawned from the image.And images need to be built upfront. Also, Kubernetes is just API so the state of each resource is precisely described there. This means we are able to track changes, what's more - we are able to rollback changes.Now, let's talk about numbers!
Container market is constantly growing. And also we have some predictions that containers will dominate the market soon. Of course we don't know if it happens, but we know that Kubernetes is a really big player in this game.
So if you need some provocative claim:
Well, here we go: Kubernetes is the most successful container orchestration tool.
So let's give it a shot. Imagine the situation when you create your first Kubernetes cluster.It's always like: ok, I have kubernetes cluster but what's the next step?Do I need to kill a cat, read from the satanic bible and walking naked at the full moon?
You are right, Deployments can be complicated for newcomers…. Let's go through some typical scenario!
So yeah, I absolutely agree. Deployments to Kubernetes can be complicated when you are not use proper tools.
Thankfully, there's an answer!
And the answer is hidden under terms Continuous Delivery and Continuous Deployment!
And we are finally getting to the topic of my talk. Let's see what CD means in the AWS environment. Believe me or not, It's pretty simple.Basically you just need to create a few AWS components and put them together.
So one of them is CodeCommit repository. Right, you can use GitHub or Gitlab, but AWS CodeCommit is a very interesting choice and personally I love it a lot.
The next piece is CodeBuild. This component will be building Docker container with our application. Also, it will be pushing the artifact, Docker image, to the AWS ECR which is something like Docker Hub but inside your AWS account.
Then we need some doer which will be deploying changes to the EKS Kubernetes cluster as the CodePipeline natively does not support deployments to Kubernetes. This Lambda function will basically mimic functions you know from your command line: kubectl, IAM authenticator and stuff like such.
And now we can just put together all the parts and create the deployment pipeline. And that's pretty much it!
Now I want to point out one important thing. Or perhaps just articulate one important thing. And I really hope that you have noticed it. I'm not using any heavy tool which answers all the questions about CI and CD. Instead, I've taken a few tools which work even standalone and I've created something more complex. Well, and I just can't help myself but I can see there analogy with other AWS stuff.
Even CI/CD tools are as composeble as the rest of the AWS landscape. You can just put together a few pieces of building kit and create something awesome. This is why I love AWS.