In this lab, we'll get introduced to deployments.
Let us begin.
The first question is, how many pods exist on the system?
Let's run kubectl get pods command.
We see there are no pods.
The next one is to identify the number of replica sets.
There are none.
The answer is zero.
Now, it's the number of deployments, so get deployments.
That's zero as well.
It's a clean environment.
There are no pods, no replica sets, or deployments at the moment,
but some changes have been made.
We'll now check the deployments again.
There is one deployment.
Okay, so the answer is one.
Now, how many replica sets exist on the system?
Now, we know that there's one deployment,
you do not know how many replica set.
Let's just run the get Rs command again
to check the number of replica sets.
That's one replica set.
Basically, the deployment called frontend deployment
has now created a replica set named frontend deployment, dash, some numbers.
That's the name of the replica set that the deployment has created.
Then let's also check the number of pods now.
There are four pods.
Basically, that's what we're trying to understand here.
There was nothing before, but when we created a deployment,
it's created a replica set, and then it's also created four pods.
Now, out of all the existing pods, how many are ready?
If you look at the status here, out of four pods, zero already.
Let's select zero.
What is the image used to create the pods and the new deployment?
Let's take a look at one of the pods in a bit more detail.
Describe pod
frontend deployment.
Maybe we'll just pick one of the pod.
We see the image used is BusyBox 888.
Let's select that.
Now, I know that there's a little bit of repetition
between different exercises here,
but this is mainly to get you familiar with some of these commands,
the get commands and the describe commands.
I promise that we have more fun stuff coming up in the upcoming labs.
We're just getting started.
Why do you think the deployment is not ready?
As before, we know that
it's because the image BusyBox 888 does not exist.
Let's select that.
The next task is to create a new deployment
using the deployment definition, one file in root.
We're already in root.
Let's check this file.
Let's try to create the deployment using the file.
It didn't go.
It didn't go through, so there is some error.
It says, "No kind deployment is registered for version apps/v1."
If we look at the file,
we see that the API version is app/v1,
which seems to be correct, but the kind is deployment,
which is also right, but the issue is that it's case sensitive.
The first character has to be a capital letter.
That's the standard for kind.
The reason we have these exercises is just to help you understand
and learn how to know what the issue is when you come across these errors.
Oftentimes, you'll face these errors because of these typos
or words not being spelled correctly or not in the right case.
You should know what those mean when you see these errors.
There are possibilities that you may mix up the API version or kind.
We don't want to spend a lot of time
during the exam just not knowing what those are.
That's the reason for these exercises.
I've just fixed that.
Let's proceed with the creation.
That went through.
The final task is to create a new deployment with the below attributes.
We have the name, we have the replicas, and we have the image.
To create an object, we know we could run the kubectl create command.
This time we want to create a deployment.
Let's take a look at the help for that.
We see there are different options.
You can create a deployment, specify a name with an image.
We have a name and we have an image.
We also want to specify the number of replicas.
There is a command just for that.
We have the name, the image, and the replicas.
That's what we're going to follow.
Run the kubectl create deployment command
and specify the name, which is httpd-frontend.
The image is--
It's good to create a practice of just copying and pasting
from the question as that will also help you with
the exam if you're learning this for the purpose of giving the exam.
The replicas is the number three.
Also make it a practice, always verify if what you did is right.
Kubectl get deploy.
We have the httpd frontend deployment.
We also want to make sure
that it goes to a ready state.
Three out of three already.
Check my work.
Okay.
That's done.
That's the end of this lab.