Check out a free preview of the full Complete Intro to Containers, v2 course
The "Scaling" Lesson is part of the full, Complete Intro to Containers, v2 course featured in this preview video. Here's what you'd learn in this lesson:
Brian demonstrates the scaling capabilities within Kubernetes. Each service is scaled and the status is checked with "kubectl get all". The load balancer will manage traffic to each service replica.
Transcript from the "Scaling" Lesson
[00:00:00]
>> Brian Holt: But now this is all set up correctly for us to be able to scale all the surfaces cuz we have a proper load balancer in front of it all now as well. So let's actually go do that cuz that's why else are we here, if we can't do that.
[00:00:14]
So kubectl scale -- replicas=5 deployment/api. So let's say, that our API is getting hammered, and we want it to scale up there, so that will do that. And now we can go back and look at our get all. Now you can see that our API only 1/5 is ready at the moment but up to date eventually, if we keep checking yeah, you can see these are all pending, let's check again
>> Brian Holt: They're all still pending.
[00:00:56]
>> Brian Holt: Eventually, they'll start running, anyway, that's how you scale up and down off the various different components here. We could do it with web. Well, that should work maybe with a load balancer.
>> Brian Holt: And for fun, let's just to dB as well. You can see this ends up being super easy to just scale up and scale down things.
[00:01:28]
>> Brian Holt: Okay, and then if we wanna just get scaled back down.
>> Brian Holt: Web, then we are back to just one for each.
>> Brian Holt: Okay, and then once you're done with everything, you can just say, kubectl delete all --all. And then, know behold, you have nothing running anymore. On one hand, I hope you see that, you're armed with enough information to be dangerous to have conversations about Kubernetes.
[00:02:11]
On the other hand, I hope you have some respect for people that are very good at this, right? Again, we very much just scratched the surface, there's so much depth here. There's so much cool stuff that Kubernetes does. We didn't even talk about secret management, right? That's a big part of what Kubernetes can do for you, and internal networking and all that kinda stuff.
[00:02:33]
So let's go back to our project here. Kubernetes really, at of the day you're gonna end up going to something probably like Azure AKS, EKS, or GKE. Azure Kubernetes Service, Elastic Kubernetes Service, or Google Kubernetes Engine, if I remember correctly what those stand for. There's a ton of places to do that.
[00:02:55]
You can also just run your own, it's not very hard as long as you have the ability to spin up and spin down services, that's not very hard. So I've seen people do it on either EC2 and AWS or Hetzner, which is a big VM provider, all that kind of stuff.
[00:03:15]
Yeah, you do pay a premium, especially, EKS is very expensive, but it does what it promises, so it is cool.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops