Skill Introduction
Introducing Containers
Let’s dive into the world of containers, the shipping crates of the cloud.
Containers are like those perfectly packed suitcases that somehow fit everything you need for a trip, minus the extra socks. They bundle just the essentials—your app, its dependencies, and a sliver of an OS. Moving a virtual machine is doable, but more analogous to moving an entire house. Container portability is a game-changer for cloud environments, where speed and efficiency are king. Understanding containers means grasping how modern apps scale horizontally across cloud providers, saving resources and headaches. Back in 2013, when Docker burst onto the scene, it was like someone handed developers a universal adapter for software deployment—suddenly, “it works on my machine” wasn’t just a lame excuse anymore.
Knowledge Check
Which of the following are benefits of containers over virtual machines? (Select TWO)
Containers vs. Virtual Machines
Let’s break down why these two aren’t just different flavors of the same tech.
Think of containers as the food truck of computing—nimble, specialized, and serving up exactly what you ordered without the overhead of a full restaurant (that’s your virtual machine). Containers strip away the fat, relying on the host OS and container software to handle the heavy lifting, which makes them perfect for microservices architectures where each service does one job well. Containers shine in cloud-native setups, where you might spin up dozens to handle a traffic spike, while VMs are the go-to for older apps that need the full OS experience.
Knowledge Check
True or False: Containers are typically more suitable than virtual machines for applications requiring horizontal scaling.
Let's Containerize
Time to get your hands dirty with Podman, the container tool that’s like Docker’s cooler, open-source cousin.
Podman’s charm lies in its ability to play nice with Docker containers while dodging some of Docker’s baggage. However, Docker is still the king of the hill when it comes to what people think of when deploying containers. The key thing here is the comparison between the size of a full VM and the size of the container. Just think about how containers’ small footprint (like that 197MB NGINX image) translates to cost savings and agility in the cloud.
Knowledge Check
In the video, the command podman run -d -p 80:80 nginx includes the -d flag to:
Our Container Project
On to the real reason we're here...will containers Quake!?
Setting up a Quake server in a container is like trying to run a retro arcade machine on a Raspberry Pi—wildly ambitious but totally doable. For Cloud+ learners, this project highlights how ECS and GCP’s Kubernetes Engine simplify container management, abstracting away the nitty-gritty of manual Podman or Docker commands. Cloud providers have built robust services to handle container orchestration, letting you focus on deployment rather than server babysitting. Google’s Kubernetes, born from their internal Borg system, powers massive workloads—like, say, running YouTube—so it’s no surprise it can handle a Quake server.
Knowledge Check
In AWS ECS, what is roughly the equivalent of an EC2 launch template?
Will It Quake? AWS Edition
Let’s fire up Quake on AWS ECS and see if containers can deliver those sweet, sweet frags.
Don't worry if you get an error when you first try to activate your first cluster. It’s AWS’s way of keeping us humble. Just do the cloud equivalent of “turning it off and back on again” by retrying the creation. You'd be surprised how often it works.
For reference, the Docker image used in this project is linked below:
Knowledge Check
What is the primary benefit of using AWS Fargate for deploying containers?
Will It Quake? GCP Edition
Let's take our first trip into the Google lair and see if we can get our Quake on there.
Although I haven't tried it myself, supposedly you can load up some other Quake maps or hand out the URL to your friends for a virtual LAN party multiplayer action. With both ECS and Kubernetes, we really just scratched the surface of what those platforms can do. They are designed to manage thousands of containers with efficiency and effectiveness and are widely used in organizations worldwide. There are whole courses on Docker and K8s so don't feel like you have to learn everything. For the Cloud+ curriculum, you should know what containers are and how they fit into the overall Cloud universe.
Knowledge Check
True or False: The same Docker image can be run on AWS ECS and GCP Kubernetes without any modification.
Validation: Containerization in the Cloud
Let's test our knowledge so far with some exam-style questions.
Knowledge Check
A cloud administrator needs to deploy a web application that requires specific libraries not included in the host OS. Why would a container be an effective solution for this deployment?
Knowledge Check
Why might a legacy application struggle to run in a containerized environment compared to a virtual machine?
Knowledge Check
A company is migrating a multi-tier application to a containerized environment in the cloud. Which of the following steps are NOT recommended to ensure successful deployment and operation across multiple cloud providers?
Question Walkthroughs
View Transcript
Skill Introduction
0:00Welcome back beautiful learners to another skill. Thus far we've talked about
0:04virtual machines as some of the real workhorses of cloud computing, but we've
0:10really just scratched the surface. There are many layers to this onion.
0:14And I'd like to consider the next layer down to be containers. Behind all those
0:19page you go services that dominate our IT landscape today, you can bet there's
0:23a container or 100 quietly chugging along doing our bidding.
0:27In this skill we're going to learn why this is and how they differ from virtual
0:31machines. We're also going to get some hands on with deploying containers on
0:35AWS.
0:36And because Google was one of the OGs in container adoption, we'll show some
0:41love to GCP as well.
0:43Perhaps most importantly, we'll finally be able to settle that critical
0:47benchmarking question about containers.
0:50Will it quake? Let's go.
Introducing Containers
0:00So when you think about containers, what comes to mind?
0:03Maybe it's these little food containers for your lunch,
0:07or maybe it's these shipping containers right here.
0:10They have a standardized size,
0:12and if you have the right equipment,
0:13you can pick it up off of a ship
0:15and put it on the back of a truck
0:17and then drive that truck to some delivery point,
0:19and then it gets emptied out,
0:21and then you can bring the container back
0:22and fill it up again and so forth and so on.
0:24Well, this was the inspiration for coming up
0:28with what we are going to talk about,
0:30about containers in the IT context, these shipping containers.
0:35So let's go back in history a little bit.
0:38Back in the day, we had our physical machines here.
0:41Of course, we still have physical machines,
0:43but we have the hardware, the operating system,
0:45and we would load software on top of the operating system.
0:49So over time, you'd get a bunch of stuff loaded up here
0:52in the operating system, in the application space,
0:55and then let's say it's time to upgrade to a different system.
0:59Maybe the system is out of warranty,
1:02it's getting old or something like that.
1:03Well, you're going to try to upgrade to a new system,
1:06and inevitably, there is going to be
1:08some little piece of software here from here
1:11that some reason doesn't make it over here.
1:14Now, I know it's shocking,
1:16but IT folks don't really like to document things.
1:20So if there was a problem over here,
1:21they'd solve the problem,
1:23and then we install the software over here,
1:25"Hey, there's something missing here,
1:27it's causing a problem,"
1:29and that would cause this application maybe not to work.
1:33So this was a real pain,
1:34and it really is still a real pain
1:36when you're dealing with kind of upgrading physical hardware
1:39and moving all your stuff to a new system.
1:42Just imagine having to do this at scale,
1:44like with hundreds or even thousands of systems.
1:47This would really be a major headache.
1:50So along came virtual machines, we have the hardware,
1:53we have the operating system,
1:55and we have our hypervisor right here.
1:57Here are our nice little virtual machines.
1:59The problem is that this doesn't really solve that issue
2:04of all these different softwares kind of interacting together.
2:08Then if we wanted to maybe take this particular software out
2:11and pull it out into a separate virtual machine,
2:14well, we run the risk of the same thing.
2:16We're really not sure if we have all the stuff
2:19that we need here.
2:20So yes, we have portability.
2:21We can take this virtual machine to other locations,
2:25other physical locations, other cloud providers,
2:28but we still kind of have this nagging problem of,
2:31do we have all the ingredients if we want to move this
2:34to another virtual machine?
2:37And that's kind of the problem that containers
2:39were built to solve.
2:41So very similar to virtual machines, we have hardware,
2:44we have an operating system,
2:46and we have some container software here.
2:49And the container software is going to allow us
2:51to define little containers.
2:53They're kind of like little lightweight virtual machines.
2:56And the idea here is that each of these containers
2:58is specialized.
2:59It has just one purpose.
3:01Now, yes, you could create a container
3:04that's like this massive container
3:06and load all the software onto it,
3:07but that is really not what containers are designed to do.
3:11They're designed to be very atomic, kind of self-contained.
3:15So that I can take this little piece of software here,
3:17I can move it to another system or another cloud provider
3:20as long as they support this container software here,
3:23and it's going to run just fine.
3:25As a matter of fact, this is a very common way
3:28for developers whenever they're developing,
3:31they will create a container for their product
3:34or whatever they produced.
3:35And the old adage of, well, ran on my machine,
3:39that's kind of the excuse the developers always say,
3:42but by using containerization here,
3:45they can package all the needed requirements
3:47in this little package and then send that
3:50to some other developer or some other DevOps person
3:54or SysOps person, and they can put that in production,
3:57and they will know, they will know
3:59that if this container has been packaged properly,
4:02then it will run exactly like it did
4:06on the developer's machine.
4:08One of the most popular software,
4:10this container software here is something called Docker.
4:14And yeah, look at that.
4:15Their little logo has these little shipping containers,
4:17and it's kind of this happy little whale,
4:20looks like a shipping ship, I guess,
4:23and you may have heard of Docker.
4:26Well, if we say Docker containers,
4:29that's exactly what they're talking about here.
4:31They have used the Docker software to define a container,
4:35then you would build that container,
4:37and then you can upload that container
4:40into a registry, for example.
4:42So this container here is kind of like an image.
4:46It has a lot in common with an image
4:48when we were talking about virtual machines,
4:50but it is much more lightweight,
4:53and we'll see how much more lightweight later in this skill.
4:58So here's the cool thing about containers.
5:00We have all these little independent software bits here
5:04that are working properly on our local network,
5:08our local data center,
5:10and we can very easily move those to the cloud if we wanted to.
5:15And yes, we can do the same with virtual machines,
5:18but let's say a virtual machine,
5:20maybe it averages five gigabytes in size
5:23or something like that.
5:24Well, what we can do by being able to scale back
5:27on what we need inside this container,
5:30maybe this container is only like a couple megabytes
5:32or something like that.
5:34Well, we can upload that to the cloud
5:36much more regularly and much faster
5:39than if we're trying to upload a full virtual machine.
5:42So containers are really easy to be able to deploy
5:45in these cloud providers.
5:46And all the major cloud providers support Docker for sure.
5:51And in fact, they'll support any container
5:53that adheres to something called the OCI standard
5:57or the OCI compliance.
5:59That is not Oracle Cloud infrastructure.
6:02That is open container initiative.
6:05And if the container applies or is compliant to that standard
6:10and Docker will create containers
6:12that are compliant with that,
6:14then we can very easily move this
6:16into one of these cloud providers.
6:19Or we can also host this on-prem in our own data center
6:23and kind of move them back and forth as needed.
6:25Now, if we just have all these containers
6:27just lying around on somebody's hard drive somewhere,
6:29that's not very good at all.
6:31No, we have something called a registry.
6:34So there are public registries of containers.
6:37And you can also create a private registry
6:40for within your organization
6:42where you can store all these containers in that registry.
6:46And most of these registries have version control.
6:50So let's say you have a version one of this
6:52and a version seven of that and so forth and so on.
6:56And you can upload that to the registry.
6:58And then you can pull that container from that registry.
7:02It's very similar to GitHub if you've ever used that
7:05where you can pull a certain version.
7:07If you want a back version of this for one reason or another.
7:10Or if you want the latest version,
7:12you can just say,
7:12"Hey, give me the latest version of that container."
7:15And it is going to download that from that registry.
7:18Now, in and among this discussion about containers,
7:22there have been all sorts of other tools and processes
7:26and services that have cropped up.
7:28One of the most popular is something called Kubernetes.
7:32And that came from these folks right here at Google.
7:35They open sourced Kubernetes.
7:37And really Kubernetes is designed to manage containers
7:42at a huge scale.
7:43So most of the organizations that are deploying containers
7:47that have more than 100 or so or 50 or so or whatever,
7:51they're going to be using something like Kubernetes
7:53because it offers a bunch of tools to help manage
7:56the instances that are running these containers
8:00and manage fault tolerance and workload distribution
8:03and all sorts of stuff like that.
8:04So of course, if you're like me,
8:06when you first heard Kubernetes,
8:08you're asking yourself,
8:09"What the heck is a Kubernetes?"
8:12Well, it's a Greek word that means a captain or a pilot.
8:16And sometimes it's shortened to K8s.
8:20And the reason for that is that there's a K
8:23and there's one, two, three, four, five, six, seven, eight
8:26letters and I guess this S doesn't really count.
8:30But Kubernetes is sometimes shortened to K8s.
8:33Why? Why do they call it K8s?
8:35I don't know.
8:37We computer nerds are kind of a strange bunch.
8:40But anyway, that is how we got here with containers.
Containers vs. Virtual Machines
0:00All right, one of the things you may be asking yourself,
0:02is it sure it does sound like containers
0:04or a lot like virtual machines?
0:06Well, yes, they are a lot like virtual machines.
0:09They are virtual entities that host software
0:13and both of these kind of do that same thing.
0:16But really virtual machines are supposed
0:18to be totally self-contained.
0:20And that just means that we can take
0:22that particular virtual machine,
0:23we can load it on some other virtual machine software
0:26and then start it up and it's gonna boot up
0:28as if it's a full computer.
0:30Containers on the other hand are mostly self-contained.
0:34They do rely on the container software
0:37to do some magic and abstract things away.
0:40But here's the trade-off here.
0:42Virtual machines are less portable,
0:44usually because they're larger
0:46and they require relatively specialized hardware.
0:49And yes, if you create a virtual machine using VMware,
0:52you can run it using VMware someplace else,
0:55but it's a bit of a hassle to run a VMware machine
1:00and then have it load up into VirtualBox, for example.
1:03Yes, it can be done, absolutely.
1:04But sometimes you may have to go through
1:07some sort of conversion process.
1:09So virtual machines are less portable.
1:12And that's also due to the fact that they're usually
1:14larger than containers because they contain everything
1:18that they need, everything in the operating system.
1:20Containers on the other hand contain just really
1:23the only stuff that they're gonna need
1:26to do whatever job it is they're supposed to be doing.
1:29And that makes them more portable.
1:31Virtual machines have a full OS, full operating system.
1:35So they're larger usually.
1:37And containers typically only have the parts and pieces
1:41of an operating system that they need
1:43because they rely on the container software
1:46to do other stuff that normally would be encased
1:50in a virtual machine.
1:52Virtual machines require more hardware
1:54because they have all these things, all this OS
1:57and kind of virtualizing the hardware.
2:00They require more horsepower to run.
2:03And containers are lightweight and they're relatively nimble
2:07and they would just require less resources.
2:10Now finally, this is kind of the most important distinction
2:13here is that if you remember back when we were talking
2:15about our scaling conversation, if you're dealing
2:19with legacy applications that kind of needed to scale
2:23vertically rather than they didn't have the ability
2:26to scale horizontally, vertical machines are more attuned
2:30or they're more equipped to deal with legacy applications.
2:34And if you think about it, it makes sense
2:36because if you have this legacy application
2:38that is used to running on a physical system,
2:42a full operating system with all the underlying hardware,
2:46then that legacy system is gonna wanna run
2:48on a virtual machine or you could get it to run
2:51on a virtual machine.
2:52In contrast, containers, kind of think of those
2:55as kind of like bits and pieces of various stuff,
2:57you're not going to get the full complement
3:00of a full virtual machine using a container.
3:04So virtual machines are typically used more
3:06for legacy purposes, legacy application purposes,
3:10whereas containers are typically used
3:12for more cloud native applications.
3:16And these are applications that are probably gonna be able
3:18to scale horizontally.
3:20And let's say we have this little container
3:22and we can spin up maybe a dozen containers
3:25and that would be the horizontal scaling aspect of it there.
3:28Whereas maybe your legacy app just doesn't handle that.
3:32It doesn't know how to deal with multiple systems.
3:35It only knows, hey, I need a more memory or a bigger CPU.
3:39So those are the main differences between VMs and containers.
Let's Containerize
0:00Alright, let's play around with some containers.
0:02So I have just created just a standard old EC2 instance out here using Ubuntu
0:07Linux.
0:08Now in the past, we've been working primarily with Amazon Linux.
0:13And if you remember, Linux is kind of the lingua franca of the cloud.
0:17So I would really highly encourage you to learn at least some Linux.
0:21And there are many different variants of Linux.
0:23Ubuntu is one type.
0:25Amazon Linux is another type.
0:27There's Red Hat.
0:28There's Sent.
0:29There's Debian.
0:30There's all sorts of other variants.
0:32Generally speaking, they all work the same way.
0:35They have little different subtle differences between them and they're used for
0:39different
0:39purposes.
0:40So I am just going to log into the system.
0:43We're going to log in the same way we have with the other systems.
0:46I'm going to connect there.
0:49And you can see there's a little bit different information when we log in here
0:54than when we
0:55logged into Amazon Linux.
0:56They had that bird looking thing there.
0:59So this gives us some statistics here about the machine we're logging into.
1:03Let me make this a little bit larger.
1:06What I've already done here is I've already updated and upgraded the system.
1:13And let me just do that again just to show you and I'll explain what these
1:17commands do.
1:20Because whenever I can show you some Linux, I think that's going to be a good
1:23thing because
1:24Linux skills go hand in hand with cloud skills.
1:28So what this is is pseudo.
1:30That's the little command that allows us to perform administrative tasks in
1:35most Linux's.
1:37When we were dealing with Amazon Linux, we used a command called YUM.
1:40That was the package manager for Amazon Linux.
1:44That's because it was based on a red hat, RPM style distribution.
1:50So you don't really have to know that.
1:51The two big flavors we're talking about here is did it come off the red hat
1:56tree or did
1:57it come off the Debian tree and Ubuntu came off the Debian tree.
2:02And so it uses apt apt to do its software package management.
2:08So apt update and this little dash Y is just going to go ahead and say yes.
2:13Because if I didn't include that there, it would prompt me to have to enter yes
2:17.
2:17Do I want to continue?
2:18So this little ampersand here says do this command and then after that do this
2:23command.
2:24So this command right here looks similar, but this one says update.
2:28This one says upgrade.
2:30So this is going to update the software library such that it matches the
2:34repository out there
2:36on the public internet and then upgrade is going to upgrade any packages that
2:41may need
2:42to be upgraded or patched.
2:44So there it's going to install.
2:46Let's see.
2:47It doesn't look like there's anything that we need to install.
2:50There are some extra packages out here and just because I like to clean things
2:54up, I'm
2:55going to get rid of those extra packages.
2:57pseudo apt auto remove.
2:59Yep, get rid of all those things.
3:02I think I know why they got installed because I was trying something else out
3:06on the same
3:06box, but we don't need them for our purposes.
3:09So next we are ready to install Podman.
3:12What's that Podman?
3:14Well, Podman is a container software much like Docker.
3:18And yes, I said the Docker is one of the most popular container softwares out
3:22there.
3:22It is, but Podman is an alternative and it creates OCI compliant containers
3:29just the
3:30same as Docker does.
3:31And we can use Podman to run Docker containers and Docker to run Podman
3:35containers.
3:35So Podman is just another software.
3:38It's often pre installed and like sent OS, I think it may be red hat, but let's
3:43go ahead
3:43and install it here.
3:44So pseudo apt install Podman and it's going to want to install some other
3:50dependencies
3:51here.
3:52I'm going to click yes and there it goes.
3:56All right.
3:58So it is installed.
3:59I'm going to issue a clear command that's going to clear my screen here and
4:02move my cursor
4:03back up to the top.
4:05Just like every beginner learning programming or something like that, it is
4:09customary for
4:10us to do a hello world type project, whereas the mission is to print out hello
4:16world.
4:16If we're working on learning a programming language or something like that.
4:20So we are going to do the same.
4:21So here we go.
4:22Podman run.
4:24Quay.io Podman hello.
4:29So what does this command say?
4:31So Podman is the command that we're going to be issuing.
4:35That's our container software.
4:37Run says, Hey, run this thing.
4:40And this right here, Quay.io is the repository.
4:44That's where this image, this container image lives.
4:48So we're saying go out to this address, go to the subdirectory and download
4:53this image
4:54right here.
4:55There's an image called hello.
4:57Now as soon as I hit enter, it's going to be very quick to download that
4:59because this
5:00is a very tiny image, but then it's going to give us some nice little, I don't
5:05know what
5:05these are moles or something.
5:07Hello, Podman world and it gives us some URLs and stuff like that down here.
5:11So that's really all that particular container does.
5:15It just is hello world.
5:17But hey, congratulations, you just ran your first container.
5:20Okay.
5:21So let's go do something a little bit more substantial.
5:24So now let's install engine X.
5:27That is a well known web server in the past.
5:30We've been installing Apache, which is fine.
5:33Engine X tends to be more performant, more designed for commercial performance
5:39use.
5:39And so we're going to be installing that container.
5:43So to do that, we need to do pseudo podcast podcast, Podman, not Podmon, Podman
5:52.
5:52So why are we saying pseudo?
5:53Because if you noticed when we did the hello world, we didn't have to do pseudo
5:57there.
5:57Well, the reason we're having to kind of switch over into administrator access
6:01is because
6:02this particular image and the container interacts with our network.
6:07It touches parts of the system that are outside its tiny little container
6:11environment.
6:13So we're going to map parts of this container to this virtual machine such that
6:19we can accept
6:20web requests inbound.
6:23Okay.
6:25So let's take a look at this full command here.
6:27Podman run dash D.
6:30That's going to say detach.
6:32If we didn't have this in here, it would keep running and we would see the logs
6:36of the engine
6:37X process.
6:38And that could be kind of cool, but we don't really need to do that.
6:41So I'm just going to issue a D detach.
6:44So it's going to kind of spin it off in the background.
6:47Here's a name.
6:48Here's where it's mapping the ports.
6:50So it's saying, Hey, on the host port, I want 80 to map to my container port 80
6:56.
6:56And here is the repository.
6:58Here's the registry.
6:59And here is the image that it's going to pull down.
7:02Now, when I hit enter here, it's going to take a little bit longer than that
7:06other little
7:06hello world thing because it's going to download its parts and pieces.
7:10Okay.
7:11So there it was pretty quick though, but you can see it is downloading some
7:13parts and
7:14pieces required for that particular container.
7:18It was definitely more than that hello world, but really it wasn't that much at
7:23all.
7:23So it gives us this big old long number here.
7:26This is the container ID.
7:29And because I said dash D here, it just kind of dropped us back off at the
7:33command parameter
7:34here, command line interface here.
7:37And so how do we know if it's running?
7:38Well, we'll do a pseudo Podman PS.
7:42That's going to give us the processes that are running.
7:45And so there it is.
7:46Here's its name.
7:47You can see it's kind of a truncated version of this up here.
7:51Here's the image.
7:52Here's the command.
7:54This is the command that was inside the image that when the container software
7:57said, Hey,
7:58it's time for you to run.
8:00What do you want to do?
8:01Hey, run this command here.
8:03And that just starts up the engine X web server.
8:06It was created 28 seconds ago.
8:08And here are ports that are mapping in our container from the container to the
8:13outer VM.
8:15And it's going to accept traffic from anywhere.
8:18So let's give it a shot.
8:20Let's run curl local host.
8:23And there we go.
8:24So this is our web page that's being served up by our engine X container.
8:30All right, let's say we want to stop that container.
8:33Pseudo Podman stop.
8:36And then we have to give it part of this little name here.
8:40We can usually just get by with giving it the first three here, B88.
8:44So if go down here, B88.
8:47And then it will have stopped that and we'll check here.
8:51And you can see there are no more containers running.
8:54Let's take a look at the image of that particular container.
8:57So I can use that command Podman images.
9:00And this is the image that was downloaded from that repository here.
9:04And it was created five weeks ago or less updated five weeks ago.
9:07This is the latest version of that.
9:10And look at the size, 197 megabytes.
9:13That's really nothing.
9:14Now compare that to our virtual machine here.
9:17If I do df dash h.
9:20So this root volume that we're using here, it's bigger than this.
9:24I think it's eight gig altogether, but it's kind of partitioned in different
9:28things here.
9:29But if we were to install our web browser or if we are into install our web
9:33server on
9:34here, then this would go up slightly.
9:38But you can see it's still 2.6 gig.
9:40So if we trim this system down, this virtual machine down to bare minimum, it
9:45would probably
9:46be about three gig as compared to doing the same task as if we were to load in
9:53Genex or
9:54Apache on this virtual machine, we can do that same task in a size of 197 meg
10:00abytes.
10:01So that is one of the benefits of containers and we can shuffle them around
10:05much, much
10:06easier than we can virtual machines.
10:09So that is some pretty low level work using Podman in this case.
10:14Let's go explore some of the cloud services that the cloud providers provide to
10:20us to
10:20run these containers.
Our Container Project
0:00All right, let me take a few minutes to explain what project we are going to
0:04build here.
0:05So if you recall in our last project, we created some instances here, some EC2
0:10instances, and
0:11we put them behind a load balancer, and we put them in a target group, we even
0:14did this
0:15through an auto scaling group as well.
0:18And we could very easily do the same exact thing.
0:21We could create containers that have web servers, and we could deploy them in
0:25our target group.
0:26And yes, there's auto scaling with those as well.
0:30We would be using a service called Elastic Container Service that would prevent
0:34us from
0:34having to go and issue all those Docker commands or those Podman commands that
0:38we issued.
0:39It's just going to manage things for us.
0:41And yes, we can absolutely do this.
0:44But that's kind of boring.
0:46What we want to do is we want to see if it will quake.
0:49Yes, that quake.
0:51So what I'm going to do is be deploying a container with an image that is
0:55supposedly
0:56a version of quake that we can play via our browser.
1:01So we're going to find out if containers can quake, we're going to do it on AWS
1:05.
1:06And then we're going to do the same thing on GCP, because as I mentioned,
1:10Google was
1:11one of the OGs.
1:12When it comes to containers, they contributed a lot of open source to the
1:17effort.
1:17Kubernetes was one of their projects.
1:20So I wanted to show GCP, some love plus it's good to go into another cloud
1:24provider and
1:25basically see how that cloud provider is similar and is different to some of
1:30the other cloud
1:31providers that we've already explored.
1:33Now before we get into ECS, I wanted to kind of draw some similarities between
1:38these two
1:39here.
1:40We have EC two and ECS when we were dealing with EC two, we had AMIs that was
1:45an image.
1:46Well, for ECS, they call it an image.
1:49So same, same there.
1:51Then we have the AMI catalog that was that catalog that we can choose from,
1:54either our
1:55own images or images that other people had created.
1:59Same thing is called a registry and ECS or that's kind of container speak for
2:05this type
2:06of similar AMI catalog here.
2:08Then we had the launch template that kind of defined, okay, when it was time to
2:13launch
2:13a new instance, here's kind of the pre populated information that I want you to
2:18use.
2:18So I don't have to enter that all the time.
2:20Well, we have a task definition over here on ECS that is kind of equivalent to
2:26this right
2:26here.
2:27And then we have the instance that was our EC two instance and ECS calls that a
2:33service.
2:34So we will be defining a task definition and we will say, hey, for this service
2:39, use that
2:40task definition, pull the image from the registry.
2:44And that's kind of the similar thing that we did over here.
2:47but it's just slightly different terminology.
2:49So let's go.
Will It Quake? AWS Edition
0:00All right, here we are back out at the AWS console.
0:02We want to go into Elastic Cloud Service, so ECS.
0:08Click on that right there.
0:09And there we go.
0:11So we're just gonna click on getting started
0:13and that's gonna drop us off
0:14onto this little page right here.
0:16So let's create a cluster.
0:17Well, a cluster is what's going to actually run our containers.
0:22So let's go ahead and click on Create Cluster,
0:25Frequent Zebra.
0:27I could not have come up with a more creative name,
0:29I think.
0:30So I'm just gonna leave that there.
0:31We're gonna call this cluster Frequent Zebra.
0:34And we are going to use AWS Fargate.
0:37It says serverless, but it's not really serverless.
0:39There's servers behind it.
0:41The difference here is that if we had EC2 instances
0:44that we wanted to manage ourselves,
0:46then we can deploy this cluster onto those EC2 instances.
0:51But if we didn't want to have to fuss with EC2 instances,
0:55then we can just use Fargate
0:57and AWS is gonna handle everything for us behind the scenes.
1:00And that is all right by me.
1:03So I'm gonna leave that there.
1:05Gonna keep scrolling down here.
1:06There's nothing here I need to change.
1:07So I'm gonna click on Create.
1:09And hopefully this is going to properly create.
1:12Just a word of caution here.
1:13About 50% of the time when I've gone into other accounts
1:17and tried for the first time to create
1:19an elastic container service cluster,
1:22I've gotten a big old fat red error message up here.
1:25And I believe the reason for that is because
1:28whenever we try to create something in AWS,
1:31things kind of spider out and create in parallel.
1:34And I think some things get finished faster than others.
1:37And sometimes some dependencies are left undone
1:41because they're not really synced up
1:42as to how they get created.
1:45So it gives me a big error there.
1:46All I do is go in and create another cluster.
1:49And then after that one error is done,
1:52then I seem to be able to create them pretty easily.
1:56As a matter of fact, on this account here,
1:57I'd come in here earlier today and created a cluster.
2:00And I got that same red error message.
2:02So we're just gonna keep on rolling here.
2:04If you do get that error message,
2:06just say, okay, and then create a cluster,
2:08then just do the exact same thing again,
2:10and it should work.
2:11So frequent zebra, this is our cluster.
2:13Now we have to define a task definition.
2:17So let's go over here.
2:18This is kind of analogous to the launch template.
2:21So I'm gonna click on create new task definition.
2:24Let's get rid of that right there.
2:25And we are gonna call this quake.
2:28And launch type is fargate, yep.
2:30That architecture is fine.
2:32These defaults are fine.
2:34Keep on scrolling down.
2:35Now we get to the container.
2:37It's asking us for the details of our container.
2:40So I'm gonna call this quake.
2:42And the URL that I'm going to be using
2:44or the location of the repository is this right here.
2:49It's Trey Yoder/QuakeJS colon latest.
2:54And I'll include this in the paragraph below this video
2:58if you wanna just copy and paste it.
3:00And this is not a private registry.
3:02This is a public registry.
3:04And we're asked for some port mappings.
3:07These are the mappings from the container
3:09or from the kind of outside the host into the container.
3:13Now we want port 80 because that's how we're going
3:15to visit this site.
3:17But we also wanna add another port.
3:19And that port is 27960.
3:23Now this is very specific to this container.
3:25I believe that that port is the port that multiplayer
3:30is communicating with behind the scenes
3:33when we're dealing with quake on port 80 here.
3:36So in my experience, you can't really start the game
3:39unless you have also exposed this port as well,
3:42which we will do.
3:44Scrolling down, I'm gonna keep all this stuff there.
3:48So keep all this stuff there, keep all the logs,
3:51keep on scrolling, keep on scrolling.
3:54All this stuff looks good I'm going to create.
3:57So I am creating our task definition
4:00and it appears to me that it created properly.
4:03All right.
4:04So now we can go back over here to namespace,
4:07oops not namespace clusters.
4:09Now we'll go into clusters.
4:11And here's our cluster.
4:13Now we have services and tasks.
4:15Whenever we create a service,
4:18there probably gonna be a task out here
4:20to actually build that container and deploy it.
4:23The difference here is tasks are kind of those things
4:26that if you want a container to come up,
4:28do some sort of activity and then go away,
4:30then that's a task.
4:32If you want a service,
4:33that's gonna come up and stay up
4:35until you intentionally shut it down.
4:38So you can have containers, do either one of these
4:41and containers are really useful in doing tasks
4:44because maybe have something relatively complex
4:47and you need to do a lot of processing.
4:49You can have that container spin up, do that thing
4:51and then go away.
4:52So let's go over to here to services
4:55and we are going to create a service.
4:58So I'm gonna choose Quake
5:00and it's gonna identify the fact that,
5:02hey we have a task definition revision.
5:04Well, it says two, that's fine.
5:06I think it's because I had created a task
5:09by that name earlier today,
5:11but I deleted it.
5:13So I'm just gonna keep on scrolling down here.
5:16Capacity provider strategy, that's fine.
5:18All this stuff is fine.
5:19We're gonna leave that alone.
5:21And we're gonna go to networking.
5:23Now this is kind of important
5:25because we want to be able to reach our instance.
5:28And if we don't have the right security group
5:30and the right subnet set up,
5:32then that's going to be very difficult.
5:34So I'm gonna choose our good old VPC,
5:36cloud plus VPC, has the two subnets.
5:39I don't really care which subnet receives this container.
5:43And as far as security groups,
5:45I am going to choose, yeah, I'll create a new security group.
5:49We'll just keep this separate here.
5:50So we're gonna create a new security group.
5:52I'm gonna give this my SG Quake.
5:55That'll just save me from navigating over to the VPC
5:59to create a new one.
6:00And we're gonna do HTTP port 80.
6:05The source is anywhere.
6:06And we're gonna add a rule HTTP.
6:09We're gonna do custom.
6:11And the port is 27960 from anywhere.
6:16And public IP, yes, we want a public IP.
6:21So I think that looks good.
6:23Yep, okay, gonna keep on going down here.
6:27There's load balancing.
6:28If we wanted to, we could spin up a load balancer
6:31and stuff these containers into that load balancer
6:34instead of our instances.
6:36Gonna hit create here.
6:38Now, what it's going to do is it's gonna start
6:40the deployment process for that service.
6:44So if I scroll down here and hit refresh,
6:47eventually our service is gonna show up.
6:50There it is.
6:51So the service has showed up,
6:53but if we go over here to tasks,
6:55generally speaking, whenever you launch a service,
6:57there's going to be a task to actually build the container.
7:01So eventually we're going to get a task show up there.
7:06There we go.
7:07And it says provisioning.
7:09So it's running.
7:10It's a desired status is running.
7:11It's provisioning right now.
7:12So this is building that container
7:14and deploying that container onto our Fargate resources.
7:19So this is probably gonna take maybe a minute or two.
7:22What we're looking for here is the last status
7:23is gonna be ready or running.
7:25That's what we wanna see.
7:27And I'm just gonna pause the video until that happens.
7:31No sooner that I paused the video
7:33did it turn into a running status.
7:35Go back over here to our service.
7:37There's our service there.
7:38So now our container should be available for us.
7:42I think it's available.
7:42Let's drill into the task here.
7:45And we are gonna go to network bindings.
7:49So if we look down here,
7:51we have our network bindings here
7:53and we have our external link.
7:56So there's our two ports right there.
7:58I'm gonna copy that one right there.
7:59Go up here to open a new tab, paste.
8:03See what we get.
8:05Ha ha.
8:06All right.
8:06So some license agreement here.
8:08I agree and it's loading.
8:11Loading.
8:12Oh, look at that.
8:16I don't know if you can hear the audio here.
8:18Nope, that's not me.
8:21That's the game.
8:22Yeah.
8:24Yeah.
8:26Woo hoo.
8:29All right.
8:30Well, I will say it is kind of boring
8:32because there's nobody else here.
8:34So, but we can say that containers on ECS will quake.
8:40All right.
8:49Enough of this.
8:51Let's shut this down.
8:52I'll show you how to kind of disassemble this
8:55and get out of here.
8:57Close that down.
9:00Let's go over here to task definitions.
9:02We're gonna click on that.
9:03Click on that.
9:04D register.
9:06There we go.
9:08Then we're gonna go up here to the cluster.
9:10Click on that.
9:11Delete cluster.
9:13We have to confirm it here.
9:14And in a little bit,
9:17it's going to shut our cluster down.
9:20All right.
9:23Clues.
9:25And there was an error deploying it.
9:26Yeah, because we shut it down before it got deployed.
9:29So we have no clusters right there and task definitions.
9:32This is gonna go away.
9:34There we go.
9:35Okay.
9:36So we're back to normal on ECS.
9:39Now let's try to do the same thing over on GCP.
Will It Quake? GCP Edition
0:00Alright, so here we are in GCP.
0:02You can see it kind of looks similar to the other cloud providers.
0:06And there's this little hamburger over here that you can click on.
0:09Now if you want to create a GCP account and play around, I highly recommend
0:13that.
0:13The more clouds that you can kind of sample, the better you're going to have an
0:17idea about
0:18how just general cloud stuff works.
0:21But they have this little hamburger over here.
0:23I'm going to scroll down here and I'm going to go to Kubernetes Engine and
0:27click on that.
0:28And we're going to go out to Overview.
0:31So this is going to give us an overview of anything we have set up.
0:35But we don't have anything set up.
0:37I'm going to go to Clusters.
0:39Very similar terminology here.
0:41Create a cluster.
0:43And we'll just call this Quake.
0:45That's all we're going to be running on here.
0:49And Standard tier is fine.
0:51Click on Create.
0:53Alright, so it's going to take a little bit of time.
0:56Actually, I think it's already set up.
0:58It is being created.
0:59Okay.
1:00So we need to give it a little bit of time until it's finished setting up.
1:04And then we can start working on our workload.
1:06So I'm going to just pause the video until that happens.
1:09Alright, at long last, our cluster is up and running.
1:12That took probably all of 10 minutes to do.
1:15So we have a little green check there.
1:16Next, we're going to go over to Workloads.
1:19And this is where we can define our service or what was the equivalent of the
1:23service
1:23in AWS.
1:24And we're going to call this deployment Quake.
1:28And scroll down here.
1:29We want to put it on the Quake cluster, container details.
1:33And it's asking us for what is the existing container image or maybe a new
1:37image.
1:38So let me grab that, paste this in here.
1:41There we go.
1:42And keep going down here.
1:44Next we want to go to Expose.
1:46Do we want to expose this as a new service?
1:49Yes, we do.
1:50Report map 80, target port 80.
1:54TCP, we're going to add a port mapping there.
1:57Port is 27, 960.
2:01Target is 27, 960.
2:03There we go.
2:06And we have our option of what we want to put in front of this.
2:09We're just going to use a load balancer because, yeah, why not deploy.
2:15And it's in the process of deploying our workload.
2:18So now all we have to do is wait until this deployed deploys.
2:22And if we did everything right, we'll find a public IP address and we should be
2:27able
2:28to get our Quake on.
2:29I'm going to pause it for the moment and then resume whenever it looks like it
2:33's up
2:33and running.
2:34All right, as soon as it was done deploying, it brought me to this screen right
2:38here, which
2:38is kind of like an overview for this service.
2:41If I scroll all the way down here, so let me tell you what these things are,
2:45managed
2:46pods.
2:47Kind of like the resources that are used to run this container.
2:50I'm going to come down here.
2:52There's our Quake service.
2:53There's our little endpoint IP address there.
2:55I'm going to click on that.
2:57There, I got my little agreement.
3:00Click on agree.
3:01And if we did everything right, we should be quaking in no time at all.
3:06All right, there we go.
3:11Yeah.
3:12Oh, yeah.
3:14Get some, get some.
3:17All right.
3:19Enough of that.
3:20This is not really fun just wandering around an empty dungeon.
3:24But anyway, we have proven the point.
3:28This does Quake.
3:31Our containers do Quake.
3:33So let's back out of this.
3:36All right.
3:37So here we are.
3:38It gives us some CPU's memory, some disk, but let's tear it back down.
3:42All right.
3:43So Quake delete.
3:45Get rid of that.
3:47All right.
3:48So that's going to terminate all the resources involved there.
3:52And I believe I can go back over here.
3:54Once that's done deleting enough, click on that and click on delete as well.
4:00Quake.
4:01So you can see there's a lot of similarities between the platforms, at least
4:05with regard
4:05to these particular services.
4:07If you want to go out to Azure and try it out there as well.
4:10Yeah.
4:11I welcome that.
4:12I don't really see a need to do that a third time on that platform as well.
4:16But I did want to give GCP some love because after AWS, GCP was my second cloud
4:22certification.
4:23So I really like GCP and it has a lot of cool things that it can do a little
4:28bit better
4:28than some of the other cloud providers.
4:30So that is, will it Quake on AWS?
4:34The answer is yes.
4:35Will it Quake on GCP?
4:37The answer is yes.
Validation: Containerization in the Cloud
0:00Alright, let's take a look at these questions. First question, a cloud
0:02administrator needs to
0:04deploy a web application that requires specific libraries and not included in
0:08the host OS.
0:10Why would a container be an effective solution for this deployment?
0:14Alright, let's start up here. Containers require the libraries to be installed
0:20on the host OS system.
0:22Well, no, that's not correct at all. Containers are their own container. They
0:28contain all the
0:29stuff. So they don't require anything to be installed on the host OS other than
0:35the container
0:35software itself. Next option for us containers can modify the host OS to
0:40include the required
0:42libraries. Well, no, because this would really be a security issue if this was
0:47allowed to happen.
0:48Containers cannot just modify the host OS to install new software. We're not
0:54going to allow
0:56that and we wouldn't want our containers to do that either. So I can definitely
0:59eliminate that one.
1:00Next option containers automatically upgrade the host OS to support the
1:05libraries. Well, again,
1:06this is kind of the same thing as that. So we can get rid of that one there.
1:09And we're going to get
1:11rid of that one by process of elimination. This is probably it. But let's just
1:14make sure containers
1:15isolate the application and its libraries from the host OS. Well, yes, that is
1:21exactly kind of the
1:22business case for why containers are useful is because they package everything
1:27they need in a
1:28nice neat little portable container that we can send to multiple places pretty
1:33easily. So that
1:35is my final answer. I'm sticking to it. All right, next question, why might a
1:40legacy application
1:41struggle to run in a containerized environment compared to a virtual machine?
1:46Let's start at
1:47the top here. Containers lack support for network connectivity. No, that is not
1:51correct at all.
1:53We can draw a line through that because that is not true. Containers cannot
1:57isolate applications
1:58from the host. Well, no, containers can isolate applications from the host. So
2:04that is not a
2:05factual statement unto itself. So we know that cannot be a reason why a legacy
2:11application
2:12might struggle to run in a containerized environment. Containers require more
2:17hardware
2:17resources than virtual machines. Well, no, that is not true. Actually,
2:21containers are more lightweight,
2:23and they would require less resources compared to the same application loaded
2:28on a virtual machine.
2:29So we can even eliminate that one. Look at us, we only have one left. Cont
2:34ainers rely on the host
2:35OS limiting OS customization. Well, yes, that is true about containers. And
2:43that is one of the
2:43reasons why legacy applications may really struggle to run in a containerized
2:48environment,
2:49because sometimes those legacy applications need to modify and do things to the
2:55underlying
2:56OS. So that is a good reason why a legacy application might struggle in a
3:02containerized
3:03environment. So that's my final answer. Last question, a company is migrating a
3:08multi tier
3:08application to a containerized environment in the cloud, which of the following
3:14is not recommended
3:16to ensure successful deployment and operation across multiple cloud providers.
3:21So this is the
3:22key here, because if you kind of skimmed over this, and you didn't pay
3:26attention to this not here,
3:29then you may be going through here saying, Hey, some of these are valid answers
3:33. Multiple of
3:34these are valid answers. Why am I supposed to pick just one? Well, no, we're
3:38being asked,
3:39which is not? Let's start up top here, use a standardized container format to
3:44ensure portability.
3:45Yes, that is a best practice. That's something that I would recommend people to
3:50do is to use a
3:51standardized container format. You certainly don't want to try to invent your
3:55own container format
3:56or use a proprietary one. Next option store container images in a registry with
4:02version control. Yes,
4:03that is something that is beneficial as well, especially when we have multiple
4:08versions of the
4:09same container, we want to be sure that we're using the latest and greatest or
4:13whatever version
4:14we need. Implement a container orchestration tool to manage load balancing and
4:19fail over.
4:20Well, yes, yes, if we have a bunch of containers, we certainly don't want to be
4:24going out there and
4:25using the command line interface to issue Docker commands or podman commands,
4:30we would want
4:31some sort of infrastructure, some sort of tool to help us manage those. And we
4:36call that 90 orchestration.
4:39So yes, that is something I definitely want. Last option here, install a full
4:44operating system in
4:45each container for compatibility. No, we would not want to do that because that
4:50kind of defeats
4:50the purpose of having a lightweight container. So of all these options here,
4:55this is the one
4:56that sounds most bananas. And I'm going to pick that one because that was would
5:00be something I
5:01would not recommend somebody do. And that is my final answer. I hope this has
5:05been formed
5:06before you and I'd like to thank you for viewing.
Team training path
Turn this skill into assignable team training
This free skill is a preview of the courses your team can assign, track, and report on with CBT Nuggets.
$708
seat / year