In this video, I will introduce you to Containers how they
work and why you want to manage them with an orchestrator.
If you're not using containers now you soon will be containers are
the preferred way to deliver software, especially in
the cloud wire contains preferred you ask because they
solve it works on my computer Fiasco containers
allow you to package an application and all its dependencies
into a portable artifact called an image that you
can easily distribute and run.
This image is constructed from a text file usually called
a Docker file that describes the commands and steps
needed to assemble the image.
Here, we have an example of a simple Docker file
that builds a rust container that you could use for development or
in a ci/cd pipeline.
Obviously there's a lot going on in this file, but the key
points are.
From envy and run directives shown
here in bold. The from is used to pick a base image
that your current one will be built on top of
in this example, Debian Lennox
The EnV directive is where you can set environment variables
like path as in our example here.
The Run syntax is used to issue commands that
can be executed inside the container during building.
In our case, it is installing some packages using the APT
package manager.
containers work by using a Linux technology called OS level
virtualization
OS level virtualization is made possible by using two
kernel features called namespaces and c groups.
These limit what a container can see and use on a host namespaces
restrict global system resources
like networks and file systems for container.
by restricting resources a container's isolated from the
host OS
cgroups manage and measure the resources of container
can use they allow you to set resource limitations like
memory CPU and prioritization for
processes.
The main point to remember is that name spaces
limit what a container can see while cgroups limit
what a container can use without these features containers
would not be secure bounded or much use.
Container makes applications portable and consistent but
it's only one piece of modern infrastructure. You might
be thinking containers sound amazing. I want to
run all my apps on them. But managing many containers running
on different hosts using different network ports and
shared volumes can be a nightmare.
What if one container stops? How do you scale containers
under load?
How do you force containers to run in different hosts for
high availability? Well, that is why we have container orchestration
in the Container orchestration Wars kubernetes
or k-8s is the Undisputed King
kubernetes is open source and comes preloaded
with some useful patterns such as networking role-based access
control and versioned apis.
You can think of it as low level PCB infrastructure just like
Linux.
Containers run in pods that are managed by
the case control plane. You can expose pods to
a Cades cluster or to the Internet by using what is called
a service.
Another great feature of kubernetes is that you can group
pods together in a deployment that is monitored and will
automatically recover. If one or many of those pods die.
In this video we learned about containers and why
they are the preferred method of delivery. I talked about OS level
virtualization which uses namespaces and see groups
to make containers work. You will also introduced to
the complexities of running containers at scale and how that is remedied
by using an orchestrated like kubernetes.
Finally we discussed some kubernetes features like being open
source pods and networking management.
I have only scratched the surface here on containers and kubernetes,
please Explore More to build upon this knowledge.
In this next video, we will switch gears and
discuss cloud computing.