Kubernetes (EKS et ou GKE ) - capabdou/guide-devops GitHub Wiki

Doc : https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#diff

Hey Cloud Gurus! I'm Will Boyd and I'm a Training Architect here at A Cloud Guru. I have over 15 years of experience in the IT industry. I've worked as a software developer, a system administrator, and as a DevOps engineer. Among other certifications, I have my Certified Kubernetes Administrator and my Certified Kubernetes Application Developer. And I'm planning on going for the new Certified Kubernetes Security Specialist very soon.

Welcome to the "Introduction to Kubernetes" course. In this course, we're going to cover everything you need to know to get started with Kubernetes. This course is for those who are new to Kubernetes and just want to get their feet wet and learn what Kubernetes is all about. We're going to cover all of the basics. We'll talk about what Kubernetes is and what containers are, and you'll also have the opportunity to build your own Kubernetes cluster and learn how to use that cluster to run containers. In order to get started in this course, all you really need going in, is some basic familiarity with the Linux command line. We are truly starting at the beginning when it comes to Kubernetes, as you make your way through the course, be sure to check out our community forums - that's a great place to ask questions, get help and interact with your fellow students. Now you're ready to get started with the course. Good luck!

The Basics: what are containers?

Hello, and welcome to this lesson where we are going to be diving in and discussing the topic of containers. And we'll just be answering the simple question,

what are containers?.

So here's just a quick breakdown of what we'll be covering in the lesson. First, we're going to talk about what containers do. We'll talk about a brief analogy for containers, just to help you understand what containers are all about. We'll discuss the role of containers in packaging, your software. We'll talk about containers as they relate to portability, then we'll cover briefly some of the high level advantages of containers, and we'll discuss container runtimes as they relate to Kubernetes.

So what is a container?

Well "A container is a standard unit of software that packages up code and all of its dependencies, so the application runs quickly and reliably from one computing environment to another."

That's the definition of containers that is offered as part of the Docker documentation (docker.com). Docker is a very popular container technology, and this is how they're describing what containers are.

So what does that mean?

Well, containers essentially answer this question. How do I get my software to run consistently in different environments?

An Analogy for Containers

So to clarify what we're talking about here, let's go into just a quick analogy to help understand what containers are and what they do. And this analogy is pretty simple.

Containers are more like laptop computers than desktop computers.

So here we have a desktop computer and a laptop computer, but our desktop has certain dependencies.

image

image

If we're going to use a desktop,

  • I have to set up and manage multiple external components in order to use it. So I need my own separate screen. I need a computer mouse. I need a keyboard, all these different external dependencies that are not part of the desktop computer itself because

  • this desktop computer requires so much infrastructure, all these external components. It's not very portable. I can't easily take a desktop computer to a coffee shop and I definitely can't use it on an airplane.

image

So it kind of has to remain in place because of all of these external dependencies, a laptop computer on the other hand has everything that I need packaged into a single device.

So all of those external dependencies are essentially packaged into the laptop. It contains its own screen. It contains its own touchpad.

It contains its own keyboard. Everything's all packaged together and this makes the laptop computer more portable and allows it to run anywhere. So I can go use it at the coffee shop, or I can use it on an airplane because everything I need is all in that single device.

Containers Packages Your Software

And that's essentially what containers do for software.

They take all of the components that your software needs and put them all together into one portable package.

So here we have some application code and your application code actually has a lot of external dependencies, just like a computer.

image

You need additional things like the mouse and keyboard to get your code to actually be usable.

So we might have some operating system libraries and we might have some configuration files. There might be some other external dependencies that our application code requires in order to run.

image

And what we do with the container is take all of that and package it inside of the container.

image

image

Containers and Portability

So all those things go into the container and essentially become one thing. Now,** because containers package everything into a single package.** They allow our software to run consistently across different environments.

So if I'm a developer, developing some code on my laptop, I need to run the code on the laptop to make sure that it works.

image

And what I can do with a container is package my code inside that container, and then take that same container that I'm running on my laptop and I can run it on a development server, a production server, or in the cloud and it's going to run consistently in all of those locations.

image

image

image

I don't have to worry about whether the production or development or cloud servers have different operating system dependencies than my laptop that might cause my code not to work.

So because everything's all packaged into one neat package, there is consistency, no matter where the code runs.

So here are some high level advantages of containers. We've talked already about portability containers, let you run your software easily in a variety of different environments.

There's also consistency. Containers help your software run in the same way, no matter which environment you're running in and containers are able to do all of this with relatively low overhead, they use fewer resources than some of the technologies that were used in the past, such as virtual machines.

image

Container Runtimes

So before we end the lesson, I want to talk about one more thing. And that is the concept of a container runtime. **The container runtime is the software that you use to actually run containers on a machine. And there are many different container runtimes available. ** So in this course, we're going to be using containerd that's our container runtime that Kubernetes is going to interact with in order to actually run containers. And if you want to learn more about containerd just check out their website, containerd.io.

So here's just a quick recap of what we talked about in this lesson.

We talked about what containers do we discussed a brief analogy for containers that was the laptop versus desktop analogy.

We talked about the fact that containers package your software into one convenient package.

We talked about the fact that containers make your software more portable.

We summarized at a high level, some of the advantages of containers, and we talked briefly about container runtimes and the container runtime that we're going to be using in this course, which is containerd.

The Basics: What is Kubernetes?

Building a Kubernetes Cluster

Using Kubernetes to Run Containers