This is the solution video for the replica sets lab, so the first question we have to find out the
number of parts that are running on the system.
So let's go to the DOMHNALL and run the command cubicle and get Pod's answer a zero.
How many replica sets exists on the system, so again, let's on the command kubek to get our yes or
replica sets and again, the answer is zero.
About know how many replica sets do you see, so let's run that command again and can see that there
is one new replica set by the name of new dash replica dash set, which has been created.
The answer is one.
How many pods are designed and the new replica set so we can get this answer from the previous command,
so the answer is for.
For design parts.
What is the image used to create the possibly replica set, so to find this will run kill, describe
a replica set and the name of the replica said.
And if you scroll up, we'll be able to see the image which is busy, box seven seven seven.
How many pods are in real estate?
So, again, we can make use of the command from before.
I can see that zero parts are running.
All of four desired, so the answer is zero.
Why do you think the pods are not ready so we can see the reason from the even S. the image that is
used as Basbug 777.
So let's run Kubek to you get pods.
All of them are an air imitable status.
So let's describe one of these pods.
And from the even section, we can see that it's unable to pull a pulled US docker image because the
repository may not exist, so there is no image by this name in Docker Hub.
So that secret answer.
Now, let's try to delete one of the four pods.
So we'll do this by running cubicle delete pod and you can pick any pod from the four.
Wait for the report to be deleted.
How many pods exist now, so let's run CubeSat, we'll get pods and you'll see that there are four pods
still running.
One of them was one up 12 seconds ago.
And as for.
Why are there still four parts even after you deleted one?
So this is the feature of replicas.
It always tries to make sure that it's running the desired number of ports.
If a port is lost or deleted, it will automatically created to match the desired number of ports.
So that's the correct answer.
Now create a replica set using a definition file, which is located on the route called replica set
definition dash one dot and it appears there's an issue with that.
So we'll have to fix it.
So first, let's try to apply or create that replica set from the definition.
And here we are able to see an error that no matches for kind replica set and version be one.
So if you follow the lecture, you will see that that was an AP version as incorrect.
It should be forward slash we want instead of V1.
So let's make a change to the definition file.
So you're changing the value from we want to ABSs, we want and we'll save this file.
The rest of the replica said definition was great, so once we applied again, we have been able to
create the replica said.
All right, moving along, we have another definition file called replica set dash definition, dash
to document.
And it appears there's an issue with that as well.
So we have to fix.
So let's open up that file and be editor, and if you look at the specs under the magic labels, we're
using the tier as equal to front end, but under-report the report template.
You'll notice that the label use just here is equal to engineers.
So that's the problem with those definition file.
Let's change the labels for the pod from Engine X to front end.
And now let's try to create this object using cube steel applied ISAF and the replica set definition
file and it has created the replica said.
So now we have three in total and the latest one we created is a replica set dash to.
So now let's delete the two newly created replica sets and four that will use Kubek to delete replicas
set and the name of the replica said.
So that's a replica set out a dash one and replicas a dash to.
Now we just have one replica set.
So that should be it.
Now we have to fix the original replica set called New Dash Replica are set to use the correct image,
which is possible.
So we can delete and recreate if needed, so we are going to use the cube, ctrl edit replicas that
come on and the name of the replica set and let's go all the way to the bottom and change the image
from the Xbox 777 to the Xbox.
Once that is done, we will save an exit and let's get the pods again and we'll have to delete all of
these pods one by one for it to create a new board with the correct image.
So let's delete all of these four pods.
Not right now, so all four reports have been deleted.
If Iran could still get pods again.
We'll see that for new have been created and they are all in the running state.
Now, let's clear up, like I said, do five pods to do this, we can run cube kill scale replica,
set the name of the replica set and the replica is equal to five.
If you're on it, you'll get what you can see, that a new pod has been created to match the desired
number of pods, which is why now let us scale it down to two so we'll use the same command as before.
But the Republicans this time will be to.
Now, if you're on Kubasik, you'll get possibilty that three of the pods are in a dominating seat and
I'll leave just two pots running in this replicative, which is what we desire.
So that's the end of the slab.
Thank you for joining me.
I'll see you in the next one.