2:25:36
2024-12-16 09:21:57
2:03:59
2024-12-16 11:06:33
1:46:52
2024-12-16 13:50:28
1:56:02
2024-12-17 09:35:43
1:52:29
2024-12-17 09:39:32
1:51:17
2024-12-17 13:36:38
1:35:13
2024-12-18 08:59:20
23:23
2024-12-18 11:50:59
1:47:49
2024-12-18 13:41:04
Visit the Docker and Kubernetes Training Course course recordings page
WEBVTT
-->
you can you refresh the command such a chance get pods
-->
you can write the command once more troops will get pods
-->
ok completed right screen zero still ok do describe the pod
-->
oops it here K K describe yeah yeah the pod still getting created
-->
it's still not ready so do get pods again pods now try the top one yeah forget
-->
about that what other command says you see correct ok maximize the window let's
-->
so there's some problem in your webnet so can you do not create log into the
-->
pod a chance what you can do is setting let me show this you want to be
-->
careful for this so in case you're having some errors are getting it what
-->
they do is on every node like a work one and work at two ok delete the
-->
other files also so if you don't even want those plugins and those
-->
things for example in my worker one you can delete all the files you want to
-->
delete these files if you want let us there but do not we can see anything
-->
is it working now Charles are you able to log into the pod
-->
the master better log in the pod
-->
once again once again they give a part that is wrong it is hyphen F pod dot
-->
yaml the create commit is wrong the create command it is wrong it is F
-->
hyphen F pod not P prod that's the reason nothing's happening yes yeah P
-->
delete R the file name what you gave is pod correct please Charles the file name is
-->
pod dot yaml not prod dot yaml remove R under the word remove word letter R
-->
delete the letter R under prod yes yes yes now do get pods the
-->
next steps are you getting created correct is getting created or not the
-->
pod okay so understand so can you go and delete the additional files delete
-->
the files of the I think it's taking more space or something for some
-->
reasons but it's still able to log in to log in the pod now log in the pod
-->
it's a master log into the pod kubectl exec kubectl exec yeah type in the
-->
command kubectl kubectl k you're not sure short name yeah exec exec space
-->
hyphen it g-inx space space hyphen hyphen space bash vsh enter in the
-->
pod okay yeah okay yes Charles are you good yeah you're you're looking to the
-->
pod you say the pod now pods type in no white yeah it's running so do a get
-->
log in to the pod now describe kubectl describe the pod and the pod name do
-->
slowly all the commands
-->
tapping because of some firewall even I have same problem let's see but you
-->
have to proceed now let's proceed
-->
you
-->
many questions you can ask me inform on this lab is done yeah yeah yeah
-->
yeah yeah you type in exit enter that's it
-->
you can next next lab can proceed okay next lab I think she can do yourself
-->
later we'll do laugh for okay I'm going to explain this everyone please
-->
listen here very important that for please listen observe and I wanted to
-->
ask questions okay I want you to think and let me know so can you all
-->
open laugh for at urine would you all please open lap for okay and I want
-->
you to say read that lab and tell me what is the name of the part in laugh
-->
for these open the lap for at urine read and let me know what the name of
-->
the part look into the M and see and see what the name of the containers
-->
first and the other container second okay what does this happening what
-->
exactly this lab is doing now before good what is happening the second
-->
container the second container what is happening go down and let me know in
-->
second container what is happening in second contain what is it while you're
-->
doing okay in Linux what does date date command do type in Linux in date
-->
command date what will happen so for example if I type in date
-->
what I'm getting the current time okay this is a hint let me know what's
-->
happening yes so every second it is writing a date to a HTML file clear
-->
we're getting it so where is it writing on the top you can see there's
-->
an empty directory a folder so let me explain now you're getting idea so it
-->
is going to create a volume of the type empty directory and what the mapping
-->
you see a map mount path where the mount is getting mounted the first
-->
container anyone there's a map into the volume what is the path in first
-->
container see I'm a file mention mount path yes user share in the next
-->
HTML the second one say slash HTML now I understand diagram so it is
-->
creating a temporary volume on your host so in whichever node the mark work
-->
this part get created it will create a temporary storage empty that is your
-->
storage in the memory and that volume is getting mapped the first container
-->
in this location the second contains getting mapped to slash HTML so what
-->
is happening in the second container for example if I make any change under
-->
this HTML it also gets copied to this volume and the same data is also
-->
getting mapped to the container the first one so all these three paths are
-->
in sync getting it this volume and the path and the first is container the
-->
second container they all are in sync they're working together and they all
-->
will have the same data let me do a small demo let me do this observe
-->
I'll give it time so I say now for example shared some name I'm going to
-->
give and I put an insert mode I copy the
-->
file and we paste it now I'm going to say apply FNF in a file it will get
-->
created so now I'll go and check on which node it got created
-->
getting created on worker to getting error message
-->
okay might be the image version fine and I'll just a mistake so can we go
-->
ahead and modify
-->
you
-->
it is some problem with this image okay so I think we'll use some other image
-->
let's let's say same image for both of them
-->
just take one second let me just check on the image I'm going to your
-->
index
-->
you
-->
only have to create it just write this is it working for you
-->
you
-->
is working for you please confirm
-->
proxy errors are getting network error because of the second node
-->
because of this error
-->
let me delete all the parts I go to work at two
-->
I remove this
-->
go one is a problem okay on what curve one let me remove the files
-->
I'm going the fires and then I'm going to go to the master
-->
let me just check are you able to work is working or no
-->
okay okay yeah yeah you got proceed let me
-->
several shoot mine and storage others you're good use is good chance is
-->
working for you you know modify it he was as good mine I'm getting error
-->
message let me just check why the reason is both the container getting
-->
created go and check complete the lab
-->
some problem in my conference
-->
to modify to nginx or use Debian
-->
you
-->
suppose to do is go to the worker machine where you created go to CD
-->
var lip cubelet which you know got created go to that node and under
-->
cubelet you see a folder color parts go to parts do LSF and L and log into
-->
the latest part going to latest form this way get maps and under that go
-->
to volumes yeah go to where lip cubelet this path on your node where it got
-->
created you see a volume folder everyone under that go to volumes the
-->
latest volume what he created good inside that now in this now if you
-->
see you have entered that we go into the empty directory folder CD and empty
-->
directory go inside this this is where you'll see the file it's not working
-->
for me getting at us do you see your file of what he didn't create you see
-->
some files there well as everyone gene everyone I see in files on this one
-->
not this one empty directory you in the wrong folder after are you know
-->
volumes now no no no you went the wrong worker node you have to see
-->
which worker node got created your part on the master once again in which
-->
node your part got created worker to any maximize this you're even a wrong
-->
maximize this maximize your worker to screen please maximize worker to okay
-->
here typing clear clear clear look okay now type in CD space dot dot dot dot
-->
dot dot enter once more CD now do LS hyphen L now you're supposed to be
-->
just for the third one study a yes go inside it CD CD into that is now do a
-->
list CD volumes CD volumes yeah now LS yes now with the first one CD the
-->
entry directory two minutes type in E and tap yeah enter do LS enter now go
-->
inside this CD space HTML okay do LS do a cat of this file cat yes got it
-->
everyone once again a gene is look everyone are able to understand now
-->
what you do is try to create some file in here type typing clear type
-->
clear create a file touch touch the T O U T S touch word T O U C H O U O O U
-->
C H space space give a file host dot T X T type in H O S T dot T X T okay
-->
right now minimize this now go to your master now QCTL exec log into the pod
-->
Q log into the pod QCTL exec exec C minus minus space hyphen C hyphen C C
-->
space first first container space yes space no no no use of the space hyphen
-->
hyphen space bash enter the first container the first kind of as a path
-->
so CD forward slash user user share engine X HTML enter do a list now so
-->
you see the file now which came from there again understanding so now try
-->
to get a file in here say touch type in touch what first dot dot dot now go
-->
to the worker node the good worker node do LS you see the file coming in
-->
understanding now again go back I mean again go to master now exit out of
-->
log in the second container enter use the apparel and instead of C first use
-->
second so in this you're supposed to go to which part will go to which
-->
part is under slash HTML right HTML no no no just HTML see the lab no no
-->
forward slash do a CD dot dot yeah see CD yes HTML not coming in do a
-->
yes you see the file is coming in understanding all these are in sync if
-->
we get a file in here it will also effect in a first container as well as
-->
near center are we good everyone this is a simple example about how you can
-->
it is bash yes such a space after hyphen hyphen one space and then bash
-->
CD forward slash user USR forward slash share forward slash
-->
engineer forward slash HTML and press enter now do LS yeah this is a file so
-->
make some changes in here you'll see this is this file yeah do T O U C H
-->
you T O U C H yeah give a name like first dot txt yes and now go to the
-->
where it got created that location go and check the file is there okay I'm
-->
getting it are we clear everyone we can take some two more minutes and play
-->
around concepts more one chance the concept then it will be very easy for
-->
you to do the hands-on yeah the mount the mount path is different but they
-->
are using the same volume so you can define any mount path it's up to you
-->
for example the first container I wanted that path because I found that
-->
was very critical this more so mount cut to the different but the both are
-->
getting mounted the same volume getting it the volume name is the same but
-->
they are getting mapped from a different mount path what's your
-->
question please yes yeah yes yes yeah it is because for example your
-->
engine X you might want a some other file this is a different debian you
-->
might want some other file to be mounted depends on where is your file
-->
which you want to map which part any part could be there's up to you but
-->
those parts will be available so now delete the part delete the part and
-->
observe what happens to the storage on the host do you assume and observe
-->
what happens to the storage on the worker nodes but what is happening to
-->
the storage are we good everyone so you see once deleted what happens you
-->
will not find the details in that mount path you agree everyone is
-->
limited JP yeah yes there is a pod MC1 and go to work worker 2 and see
-->
whether do you see that fights now on the worker know why exit if I'm
-->
logging back so once you're done what is an option did you see that
-->
contents and gene yeah yeah I'll be done the fights are not good long be
-->
there the fights will not be there once you delete your part you
-->
observe it and not like that no no no one second one here I see
-->
the CD CD for slash where var var forced as live live be cubit you be
-->
LED LED yes yes now go inside the point you'll not have a part now CD
-->
parts and do LS now you see that you don't have that is gone you don't
-->
at all do LS FNL you has a study a remember you don't see the part at all
-->
is gone the part is not there so it means that you'll lose the data to
-->
delete the part here of this time okay others are we good so I'm trying
-->
to do it on my local mission because of errors any questions you can ask me
-->
one minute others any questions
-->
you
-->
so see I mean so wrong am I in the dormant and you see that everything is
-->
Good.
-->
I'm not sure if there is some challenge in here.
-->
So, OK.
-->
Next lab, everyone.
-->
Next topic.
-->
OK.
-->
So I've done it.
-->
I'm going to use my network because I'm not
-->
going to use this.
-->
You see, it works.
-->
Everything's fine.
-->
Something is happening in the back end.
-->
I'm not sure.
-->
But everything is fine.
-->
I'm just going to do it at my end
-->
so that it acts as output.
-->
So we talked about this is done.
-->
The next topic.
-->
Now, could you tell me, is there
-->
any disadvantages of using pod?
-->
OK, let me give an example.
-->
So let's consider right now, we
-->
created some pod on a worker node.
-->
We have a pod, which is a container.
-->
Now, what if this pod goes down?
-->
What will happen to the application?
-->
So we need to create multiple pods.
-->
Do you agree?
-->
So now, I have to create a manual pod again.
-->
I cannot create two pods at once.
-->
Are you understanding?
-->
In a kind as a pod, I can create only one pod at once.
-->
I have to again run the command to create a pod.
-->
So I cannot.
-->
The challenge with a kind pod is multiple pods cannot
-->
be created at once.
-->
I have to again do it manually.
-->
Now, if I have two pods and the load is more,
-->
I cannot scale up the pods.
-->
So I cannot scale up.
-->
I cannot make it five or scale down.
-->
If you're having a pod with a version one,
-->
and you want to update this to V2, a new version,
-->
and do this, there will be some downtime would be there
-->
in your kind pod.
-->
And all these are very important when
-->
you have a live application.
-->
Because tomorrow, you might want
-->
to create multiple pods at once.
-->
You might want to scale up the pods because load is more.
-->
You might want to do any updates without having
-->
any downtime.
-->
So this example of a kind pod, just to start off,
-->
but we actually create pods with different methods,
-->
which is your deployments.
-->
So deployment is a method using which we create the pods.
-->
Which is highly available.
-->
And you can scale up your pod.
-->
You can do updates.
-->
You can pause.
-->
You can do all the operations if you
-->
use a kind as deployment.
-->
So what I'm saying here is, if you want to create a pod,
-->
the better method to create a pod using a kind deployment.
-->
So example, you want to create something like this,
-->
name.
-->
So now, the difference between this.
-->
So kind is deployment.
-->
Now, what is three here?
-->
What will three do?
-->
This answer, please think.
-->
Because we have to answer this question.
-->
I give a hint.
-->
What are the three?
-->
Yes, we'll create three pods.
-->
And each pod will be having this container.
-->
So I don't have an option of matching replicas, option
-->
and kind of support.
-->
So you're talking something like this now.
-->
So it means I can scale and create multiple pods.
-->
And tomorrow, I want to scale up.
-->
For example, I have three pods.
-->
I can scale to scale up to five.
-->
It will become from three to five, increase automatically.
-->
If I want to scale down, I can scale down to one.
-->
All these operations is what your deployment would
-->
allow you to do it.
-->
That's what we are talking about now, the next topic.
-->
So for doing this, first you need to understand about
-->
labels.
-->
What are labels?
-->
So labels are key value pairs.
-->
So you give some names for the pods,
-->
like app equal to blue in here.
-->
So tomorrow, if you want to do some operations on different
-->
applications, you can do some filtering.
-->
So I can get in the pod which I wanted.
-->
And I want to a patch.
-->
So I want to a patch of this particular pod, which has
-->
the label name.
-->
Or I want a building of it.
-->
I can do a filtering like this.
-->
This is called a selector.
-->
So we can define labels.
-->
And we can define selectors.
-->
So labels are key value pairs that we can attach to objects
-->
such as pods or the nodes we can attach.
-->
And all these are some recommended key and value
-->
pairs, which is recommended by Amazon, working on release,
-->
environment, here, partition, all these.
-->
So how do you create it?
-->
This is syntax for the labels.
-->
And this is what they say.
-->
Now, can you create labels?
-->
Yes, you have multiple labels, method to create a label.
-->
Let me do a demo.
-->
So in this pod, you're going to create the pod
-->
with this name, with these two labels.
-->
Let me do this.
-->
Let me, and even you can try to do this.
-->
So try to create YAML of this.
-->
And try to get a pod from this.
-->
So go ahead on the master machine.
-->
Try to create a pod of this.
-->
So you can say label pod dot YAML.
-->
And you paste it.
-->
Now, I'm going to say apply FNF label the pod name.
-->
Now, the pod has got created.
-->
I would say get pods FNO and YAML.
-->
So now, I can use a command, see, show labels.
-->
This will show the labels of this.
-->
Now, I'll take one more pod.
-->
For example, I just create a pod, like an example,
-->
the image of Nginx, for example.
-->
If I say get pods, show labels,
-->
it is showing for both the pods.
-->
This comes by default.
-->
This is specific.
-->
Now, I can also say a label F equals Nginx.
-->
So it's going to filter the pod
-->
and show only this pod.
-->
Did you get it, everyone?
-->
Are you getting it?
-->
There's a filter.
-->
What is equal to?
-->
What is the symbol?
-->
What is the symbol?
-->
What is the symbol of?
-->
What is the symbol?
-->
What do you call the symbol as?
-->
If this is equal, what will not equal to?
-->
So now, I'm going to do a not equal to.
-->
So it will give me all which is not matching it.
-->
It's giving me the other pod.
-->
Are you getting it?
-->
So we can use these operators for equal to, not equal to.
-->
This is how you can do a filtering.
-->
So you can do equal to, not equal to.
-->
You can use for operators and operators.
-->
All these are called as selectors.
-->
Are you understanding what are labels and selectors?
-->
Now, I can also create one more label manually.
-->
So let me show.
-->
So for example, create a label.
-->
So I can say, this is my pod.
-->
Only a label for example, for example.
-->
I want additional label.
-->
So I can say, label, the pod,
-->
and the pod name, example.
-->
Then you can say, I want to give a label,
-->
and you can give a label with this hyphen E and V
-->
equal to prod, it's got label.
-->
So now, if I say get pods, hyphen hyphen show labels,
-->
you see that it also got one more label.
-->
If you don't want the label, for example,
-->
I can just same command.
-->
And in the end, I can just say hyphen with a key.
-->
It is unlabeled here.
-->
So like this, you can define multiple labels.
-->
Are we good?
-->
Label is gone.
-->
Just use the syntax.
-->
Okay, I think you want to do a lab.
-->
I don't think lab is there for this.
-->
Are you understanding what are labels and selectors?
-->
Are you good?
-->
Okay.
-->
It's going to help you a lot.
-->
So what happened in the deployment?
-->
So when you write a YAML file of a kind deployment,
-->
and when you apply, when you apply the YAML file,
-->
when the request goes first,
-->
to which component the request goes first in master.
-->
Just think, you're writing a YAML file
-->
and apply where the request goes
-->
to which component in master.
-->
API, do you agree?
-->
As for this diagram, it will go to next
-->
after you go to controller manager.
-->
The controller manager would create the replica set.
-->
And then the replica set in turn uses scheduler
-->
to create the pod.
-->
So this could be your worker one, for example.
-->
And this is your worker two.
-->
So the replica set.
-->
So since you asked for three,
-->
the replica set would remember that you asked for three.
-->
And if something happens to this,
-->
the cubelet would immediately inform the problem
-->
and a new pod would come immediately.
-->
That's what the replica set is.
-->
So the replica set would remember there's a problem.
-->
So in this case, example,
-->
if your pod went down, what will happen?
-->
Let me explain once more.
-->
So in this case, we have worker one
-->
in which we have this one.
-->
Worker one.
-->
You'll also have a cubelet.
-->
This could be your worker two.
-->
You have cubelet, the node.
-->
Now this goes down.
-->
Cubelet will understand there's a problem.
-->
It'll go and inform to API.
-->
It'll go and contact the controller manager.
-->
Controller manager will check on the replica set.
-->
So replica set says that three.
-->
So it was value was set as desired was three,
-->
current was three before.
-->
This is what is said in the memory.
-->
But right now it is not.
-->
It'll understand there's some problem
-->
because desired is not even current right now.
-->
So it'll again take the help of scheduler.
-->
And scheduler will inform the API
-->
that you're going ahead
-->
and it'll go ahead and create a pod
-->
immediately on that node.
-->
This is what replica set does.
-->
Replica set ensures that any time the numbers,
-->
what was there, is going to match.
-->
So even the pod goes down,
-->
it'll come up automatically because of replica set.
-->
That'll be good.
-->
Everyone.
-->
Yes, no?
-->
Questions?
-->
Now let's do a lab on this.
-->
Now the first one in lab three,
-->
I'll explain this.
-->
There are two methods to create a deployment.
-->
One is the imperative method
-->
in which you create deployment,
-->
deployment name, the image,
-->
and how many pods you want,
-->
and which pod you want to expose internally.
-->
They create it.
-->
So we'll go ahead and see it.
-->
Scalar will create two more pods.
-->
We'll observe it.
-->
Then let's first do this.
-->
So go ahead and run the first command.
-->
Before you do this,
-->
to avoid confusions,
-->
delete all the pods.
-->
So say delete pods hyphenate and all.
-->
So type in,
-->
delete pods hyphenate and all.
-->
And now run the command
-->
and see what happens in the back end.
-->
Got created.
-->
So you can get deployment or deploy hyphen over y.
-->
Get deployment or deploy hyphen over y.
-->
You see that there are two copies.
-->
Again, you can say get RS.
-->
It is a Replicaset.
-->
It's created too.
-->
So how do you know this?
-->
This deployment created your Replicaset.
-->
And again, you can say get pods hyphen over y.
-->
You see it's got.
-->
So deployment created your Replicaset
-->
and Replicaset in turn created the pod.
-->
How do you know this is a naming conventions?
-->
Sorry, I'm getting error.
-->
Okay, let me see your screen.
-->
So can you,
-->
that's what, there is some network problems
-->
that you can have.
-->
I'm not having them.
-->
So can you go to worker1 machine?
-->
Do ls.
-->
Can delete the files.
-->
rm, rm minus, no, no, no.
-->
rm minus rf, rf, yeah.
-->
Space, just type in cni.
-->
Yeah, enter.
-->
rm minus rf, container d, yes.
-->
Tab, tab, tab.
-->
Not that side, just type in tab.
-->
Don't do that.
-->
Not this one, yes.
-->
Tab, test tab.
-->
The first one, hyphen.
-->
Just type in hyphen 1.6.
-->
Yeah, delete this.
-->
Okay, now go back.
-->
To the master.
-->
So kubectl, delete the pods.
-->
Yeah, delete the pods, hyphen o, hyphen.
-->
All, yeah.
-->
All, all.
-->
Yeah, enter.
-->
That's fine.
-->
We'll go up.
-->
We'll again come back.
-->
kubectl, kubectl.
-->
kubectl, kubectl.
-->
kubectl, kubectl.
-->
kubectl, kubectl.
-->
kubectl, kubectl.
-->
kubectl, kubectl.
-->
kubectl, kubectl.
-->
Because of the storage issue.
-->
Okay, let me.
-->
I'm going to log in and increase the storage.
-->
Yeah, proceed.
-->
Ifcon, ifconfig, apt install, apt install, run command.
-->
No, no, no, no, no hyphen.
-->
Net hyphen tools.
-->
Run that command.
-->
What is seen on the top?
-->
It just says the exact command.
-->
Run that command.
-->
Space net hyphen tools.
-->
You see the command says that?
-->
Run that command.
-->
Net hyphen tools.
-->
Yeah, choose enter.
-->
Yeah.
-->
Now type in ifconfig.
-->
The top go up.
-->
Go up on the top.
-->
Up, up.
-->
No, no, no.
-->
The output, what do you call it?
-->
Up, up on this.
-->
Up.
-->
Yeah, go up.
-->
What was 172, 20, 0.1.
-->
That one.
-->
Come down, come down.
-->
Come down.
-->
Yeah.
-->
172, 31, 27.
-->
One second.
-->
172, 31.
-->
Is this a 192 ending?
-->
Yeah, yeah.
-->
20, 31, 27, 192.
-->
So I'm going to increase the storage.
-->
Let me check if I can add it.
-->
Okay, I don't have permission to do it.
-->
Okay, please proceed.
-->
Let me check in the break about how to do it.
-->
Is it running now?
-->
The master, both the bots?
-->
Please check.
-->
That's fine.
-->
Proceed.
-->
That's fine.
-->
We got it created.
-->
Others, are you?
-->
Yes.
-->
Are you do it?
-->
Others, are you good?
-->
Tell them to increase the storage, the backend.
-->
Are we good with the first one?
-->
So now, please observe the screen.
-->
I'm going to do the next steps.
-->
Observe.
-->
So now we have two bots.
-->
Please observe right now.
-->
So now, when I do a describe
-->
of deployment, and you would see that
-->
it created a replica set.
-->
So the deployment is creating a replica set.
-->
Backend team is calling.
-->
Yes, sir?
-->
Yeah, yeah.
-->
Yes.
-->
Yes, yes.
-->
Hi, Raghav.
-->
Raghav, they're getting errors in between
-->
for some bots.
-->
They're not, when they get a bot,
-->
it says error, it cannot create.
-->
These are the errors we're getting in.
-->
And some, it's an intimate issue.
-->
There is something blocking sometime in between.
-->
I'm not sure.
-->
If you want, you can join the session and see.
-->
For example, I'm able to do it on my laptop.
-->
There's something, a session,
-->
or from Nobleprog, I'm not sure.
-->
Yeah, yeah.
-->
Nobleprog.
-->
That's it.
-->
Everything is,
-->
they're not able to reach.
-->
The TCP port is all inbound and all outbound is open.
-->
Right.
-->
Right.
-->
Yeah.
-->
How did we create this?
-->
I want to understand.
-->
How did we get into that Nobleprog case?
-->
How was it coming in there?
-->
Okay.
-->
Okay.
-->
Then why are they getting intimate issues?
-->
What reason?
-->
I'm not sure.
-->
I'm able to do it online.
-->
So the reason I'm using CreateInMine
-->
and mine is working, for them it's not working.
-->
The same lab they're doing, actually.
-->
Mine doesn't like...
-->
I use my AWS account.
-->
Yes.
-->
Mine and then your virtual machines or your local machines?
-->
I created in my AWS account and mine.
-->
In that, I created the Kubernetes cluster.
-->
In that, I'm not having issue.
-->
But if I am using your environment in which I deployed,
-->
it is having some problem, sometimes the ports.
-->
Hope you understand.
-->
I have no idea.
-->
Are you trying to...
-->
No EKS.
-->
EKS on those nodes, right?
-->
No EKS.
-->
Normal Kubernetes.
-->
Kubernetes.
-->
Is it okay?
-->
Is it okay that you can join?
-->
Someone can join the session.
-->
I think they're asking me.
-->
One second.
-->
Okay, team.
-->
I'm with the backend team.
-->
Yes.
-->
Is it working, everyone?
-->
Yes, team.
-->
We have a question.
-->
Okay.
-->
Okay.
-->
I'm checking the backend team.
-->
Why are you getting error messages?
-->
Is it working on mine?
-->
Others?
-->
Are we good?
-->
Okay.
-->
Are you still getting error messages, team?
-->
Are you still getting error messages?
-->
When you are in all the namespaces?
-->
Okay.
-->
Let me see error now.
-->
Can you do...
-->
Do a clear.
-->
Get ports.
-->
I don't know why.
-->
This hyphen...
-->
Why?
-->
They're doing the restart.
-->
Okay.
-->
Get ports.
-->
Do a kubectl.
-->
Get ports.
-->
Hyphen, hyphen.
-->
All.
-->
Hyphen namespaces.
-->
Yes.
-->
Hyphen space.
-->
Hyphen, hyphen.
-->
Oh, oh.
-->
Why?
-->
Hyphen, hyphen.
-->
Not there.
-->
Namespace also.
-->
Hyphen, hyphen.
-->
Enter.
-->
Okay.
-->
One second.
-->
Let me give a command.
-->
Okay.
-->
Sorry.
-->
Hyphen, hyphen.
-->
All hyphen namespaces.
-->
Is that better?
-->
Enter.
-->
Okay.
-->
Fine.
-->
One second.
-->
Getting a call.
-->
Yes, sir.
-->
Can you give me a zoom call?
-->
I'll ask the backup to join me.
-->
What do you want me to do?
-->
Sorry?
-->
You want the link or zoom link?
-->
You want the link?
-->
Yeah, zoom link.
-->
Tell the zoom link.
-->
So that he can connect with you over the call.
-->
Because you don't have access to your mobile phone.
-->
He's not from mobile phone.
-->
He's fighting.
-->
Okay.
-->
Okay.
-->
I think I'll manage now.
-->
I think the break or something we can do.
-->
Is it okay?
-->
Let me know the...
-->
Okay.
-->
Then I think I'll ask for a break now.
-->
Team.
-->
I'll ask for right now.
-->
Is it okay?
-->
Right now is available.
-->
Fine.
-->
I'll ask for a break and then I'll talk with you.
-->
Yeah.
-->
Okay.
-->
Thank you.
-->
Team.
-->
So we want to do see what's happening in the backend.
-->
Is it okay that you can take a 10 minute break now?
-->
Yes.
-->
I want to check the word by the reason getting this.
-->
So that we need 10 minutes.
-->
Yeah.
-->
So break for 10, 15 minutes.
-->
So I think we take 15 minutes break now.
-->
And we'll be back.
-->
Yeah.
-->
Thank you.
-->
Sir, I've given a link to you.
-->
You can join the Google Meet.
-->
Hi, sir.
-->
Can you hear me?
-->
Hi, Raghav.
-->
Hi, Raghav.
-->
Hi, Raghav.
-->
Can you hear me?
-->
Now who's speaking?
-->
Hello.
-->
Hello.
-->
Hi, Raghav.
-->
Can you hear me?
-->
Yeah, yeah.
-->
See the admission screen.
-->
So, Raghav, when they log in here, so they are getting this error.
-->
See here.
-->
This is coming common.
-->
See if I.
-->
Yes, yes.
-->
This is mine.
-->
Also it happened.
-->
So now I have to go.
-->
Oh.
-->
Get pods called.
-->
And this has some intermediately.
-->
See here.
-->
Okay.
-->
So now if I do describe the pod.
-->
And this is my.
-->
Pod name.
-->
And I'm just mentioning.
-->
Man.
-->
System.
-->
So you're getting this error.
-->
Magnet network.
-->
Hi, sir.
-->
Okay.
-->
So I'm getting something because of this fail container Q proxy for backup restarting.
-->
So I also went ahead and any any additional for anything is there.
-->
I'm trying to read it.
-->
And it's happening only on a few of them.
-->
Not an honor.
-->
At least all of them is fine.
-->
See here.
-->
It works for this.
-->
Work for this.
-->
But not this.
-->
Syntimately happens.
-->
So what I've done is.
-->
The reason I've installed.
-->
On my own EC2 instance.
-->
And for the past one I'm using this.
-->
Yes.
-->
So for past whenever I'm using my account.
-->
I'm not having this.
-->
And this people are getting intermediately.
-->
So even when I'm telling them to.
-->
Delete the files.
-->
I just storage.
-->
I'm not able to do the storage because I don't have access to the storage on beans.
-->
I'm not sure.
-->
It is.
-->
Yeah.
-->
I feel that.
-->
Or.
-->
It's something else.
-->
That we are taking.
-->
Because it is not happening in mine.
-->
Here.
-->
It is happening in my account.
-->
Intermediately.
-->
And for example.
-->
I also had some files.
-->
I wasn't.
-->
Remove any other files.
-->
We are just having many basic files.
-->
So can we increase storage now.
-->
In the back end.
-->
I feel that could be a problem.
-->
Because other things is good.
-->
So I feel sorry for the problem.
-->
So I want to increase the storage.
-->
Or anything else you feel could be a problem.
-->
I mean based on settings.
-->
What setting we have done.
-->
You know what.
-->
Apart from that.
-->
Anything else settings or something.
-->
I'm not sure.
-->
Any policies or something.
-->
Or anything.
-->
I'm not aware of it.
-->
Have you mentioned all traffic.
-->
Or you all mentioned all TCP ports.
-->
Okay.
-->
Fine.
-->
Why is that.
-->
See now we have used two rules correct.
-->
Why are we having.
-->
We can remove the previous one.
-->
So for example.
-->
If you go to security.
-->
You added it.
-->
So why are we having the minimum port.
-->
Don't think this is going to have a conflict sometimes.
-->
Because you have small and then more.
-->
Understand.
-->
But to be.
-->
Understand.
-->
But why do you want to do.
-->
No teacher.
-->
That's what I'm having a problem.
-->
So my question is.
-->
Can you remove this one.
-->
Because.
-->
There is some conflict between.
-->
More and less.
-->
I'm just thinking of thoughts.
-->
Can you remove this.
-->
This one rule is all traffic.
-->
Why are you having both of them.
-->
This is one.
-->
Another one is.
-->
I want to increase the storage on all the nodes.
-->
In the back end.
-->
Can you do these two.
-->
The security group is removed.
-->
I mean the ports are modified.
-->
The ports have been modified.
-->
Okay let me just check.
-->
Teacher.
-->
And then.
-->
Click this.
-->
Yeah.
-->
Yeah.
-->
It's coming in.
-->
Okay.
-->
Okay.
-->
Can you increase the storage.
-->
For example.
-->
My.
-->
Worker one.
-->
Is having a problem.
-->
So for example.
-->
This is coming on my.
-->
Worker.
-->
One.
-->
Which is.
-->
This IP.
-->
So can you.
-->
Go ahead.
-->
And.
-->
This one.
-->
Which is.
-->
This one.
-->
Increase storage.
-->
Of this.
-->
To at least 10 or something.
-->
At least 2 GB.
-->
And let's see what happens.
-->
At least 18.
-->
138.99.
-->
The public IP.
-->
For instance I.
-->
I am asking because my concern is here.
-->
Since all of them.
-->
Are coming in.
-->
Somewhere in.
-->
See at the end of the day they all are coming in one screen.
-->
So is it because of.
-->
Any network issues.
-->
In which you are seeing everything.
-->
Any bandwidth issues or something.
-->
I'm not sure.
-->
Just give me a thought.
-->
It is working.
-->
With.
-->
On my putty.
-->
Perfect.
-->
And this lab is still edited.
-->
And this is happening randomly on some machines.
-->
Not on very specific machines.
-->
See for example.
-->
You can see for these.
-->
It's working.
-->
But some doesn't work.
-->
So that's the reason not to understand.
-->
Why is it one for some.
-->
Randomly it happens like this.
-->
What I've done now.
-->
If you increase the volume.
-->
Existing volume.
-->
You need to reboot them.
-->
You need to reboot.
-->
Can't directly modify the existing one.
-->
I think it must allow you.
-->
Tim are you back?
-->
Charles.
-->
Nathas.
-->
Okay.
-->
Okay.
-->
We're just seeing the issue.
-->
This for.
-->
To be unsafe aside.
-->
Okay.
-->
Rack of.
-->
Can we start working in.
-->
Back in.
-->
Anything else you want me to.
-->
Okay.
-->
Thank you.
-->
Yeah.
-->
Yes.
-->
Now let's continue.
-->
So now we're going to.
-->
I'm going to do a demo now.
-->
For the yaml file.
-->
So before.
-->
I'm going to use this mind.
-->
I'm going to say delete.
-->
The problem.
-->
I can.
-->
Let me do this.
-->
You want to observe.
-->
And then I'll give you.
-->
Time for every step.
-->
Yeah.
-->
So in the down now.
-->
First.
-->
I'm going to write in the yaml file.
-->
With this.
-->
I copied this yaml file.
-->
Going to the master.
-->
I say deploy dot yaml.
-->
And observing here.
-->
The API version is different because.
-->
Your deployment is a different location.
-->
The path.
-->
And to find this.
-->
We are using these commands.
-->
So this command will let you know.
-->
Which is your.
-->
API version to be used.
-->
And it will give apps.
-->
For such even.
-->
And this session is for your deployment.
-->
This session.
-->
For replica set.
-->
This is your pod.
-->
And this is your continuous session.
-->
So once I apply this.
-->
We create a deployment with this name.
-->
That will create.
-->
A replica set.
-->
And that replica set in turn.
-->
Creates the pods.
-->
Three pods.
-->
With each one having one container.
-->
So now I'm going to apply this.
-->
So now I say.
-->
Deploy dot yaml.
-->
And now I say deploy.
-->
Hyphen o and y.
-->
Deployment got created with three copies.
-->
Of this image.
-->
And I say.
-->
To replica set.
-->
It got three copies.
-->
And this got created.
-->
From this deployment.
-->
You see this name.
-->
And I say get pods.
-->
Hyphen o and y.
-->
You see three pods got created.
-->
From this replica set.
-->
How do you identify it?
-->
It has the replica set name.
-->
And the unique name.
-->
Are we good till here?
-->
Charles, CK, Green, others.
-->
Could you please do this step everyone?
-->
On the same lines.
-->
Do just create the yaml file.
-->
Apply it.
-->
And observe the outputs.
-->
Do till F command.
-->
And both these pods get created on different nodes.
-->
You see they are getting load balance.
-->
Waiting for it.
-->
Let me see.
-->
Creating on worker one.
-->
Yeah.
-->
So you can see it here.
-->
Refresh the command now.
-->
G.
-->
Again do get pods have no y.
-->
Okay.
-->
Let's see.
-->
Didn't create it.
-->
Now let's go next step.
-->
So now let's play around.
-->
Okay.
-->
Let's try to delete the pod.
-->
And see what happens.
-->
So delete the pod.
-->
Any pod got created among these.
-->
This is running. Copy the pod.
-->
And paste it.
-->
Now since we talked about replica set.
-->
It will understand that's the problem.
-->
It will immediately create the pod.
-->
Let's see what happens now.
-->
So I do get pods have no y.
-->
And you see the pod came up automatically.
-->
Yeah.
-->
You observe that the pod will come automatically once gets deleted.
-->
So this is what is replica set.
-->
So replica set will ensure that the numbers
-->
would match.
-->
Now let's just try to scale up.
-->
So now we will say
-->
scale up your pod.
-->
So let's do
-->
kubectl scale.
-->
Next command.
-->
So when you go to documentation.
-->
It's almost scaling up now.
-->
Run this command and observe
-->
does it scale up.
-->
It will immediately update.
-->
So you can do a deploy.
-->
You see five copies.
-->
Deployment.
-->
It will update the replica set to five copies.
-->
It will also create two more pods to make it
-->
five. Are we good everyone?
-->
You see five is coming in.
-->
Yeah. There is some issues going on.
-->
But I think that is coming up.
-->
Taking some time.
-->
Now you can make it to one.
-->
So observe to get created more.
-->
And again you can try to make it less.
-->
So we see it increases.
-->
Now you can use the same command.
-->
And make it less.
-->
So make it two for example. Delete.
-->
And you can see
-->
that you have only two pods.
-->
So this is how we can either
-->
scale up the workload is more.
-->
Or you can scale down when
-->
the workload is less. Are we good?
-->
Everyone now let me
-->
talk the next one. Don't delete it.
-->
Let us proceed to the next step. I'll explain the next.
-->
Now next topic is
-->
rolling update.
-->
Now right now what we
-->
created your pod
-->
version is engine
-->
x 1.14.2
-->
which is
-->
part of a replica set.
-->
And that replica set
-->
in turn your scheduler got created.
-->
All these are 1.14.2
-->
Now you want to update the application
-->
to a new version. To
-->
1.16.1
-->
So you do
-->
need to do update.
-->
When do an update it creates
-->
a new replica set
-->
for 1.16.1
-->
and it will create
-->
new things.
-->
First we create
-->
equivalent one of this.
-->
We create this
-->
and then this will get terminated.
-->
Then we create equivalent one of this
-->
on the other side.
-->
Then this will get terminated.
-->
And then we create one
-->
of this
-->
and then this will get terminated.
-->
This is called as a
-->
rolling update.
-->
So rolling update you can mention
-->
how many you want to update
-->
at a single point of time.
-->
It will always ensure that
-->
the other version comes up first.
-->
All settle down
-->
and then the existing pod
-->
would go down.
-->
And this is the default strategy in your
-->
pod.
-->
Let's do this in your documentation
-->
to lab.
-->
This is the command
-->
to update to a new version
-->
and you want to record it.
-->
So that tomorrow you can go ahead and see
-->
what exactly updated.
-->
Then we can read the rollout history.
-->
And you can roll back
-->
to previous version
-->
or the specific version using
-->
these rollout history commands.
-->
So now let's
-->
go ahead and set the image.
-->
So now when I do now
-->
getRs or getPlot
-->
while
-->
you see that it gets updated
-->
so fast.
-->
And if I do getRs
-->
hyphen on white
-->
there are two replica sets.
-->
So all of them
-->
became zero in here
-->
and this has got two. And all the pods
-->
have got updated to the latest version.
-->
You can go describe and see the pod.
-->
So you can go describe of the pod
-->
and see what is the version of the pod
-->
image. So you see that they updated
-->
to 1.16.1. Let me know if
-->
you have any questions. And you can see the rollout history.
-->
Let's see now.
-->
Okay.
-->
So can you do getPods hyphen o white
-->
g?
-->
kubectl getPods
-->
space hyphen o
-->
and white.
-->
I think we need to understand
-->
what we did now.
-->
Yes?
-->
No? Are we good?
-->
After describe command, describe pod
-->
describe pod
-->
and the pod name. And in that go ahead
-->
and see which version is it.
-->
It's using 1.16.1.
-->
You can see under the container session.
-->
It means the pod is
-->
using right now it is using this
-->
image version. Did I answer your question?
-->
Yeah.
-->
So now let's consider that something
-->
happened. You want to revert back.
-->
You can revert back to previous
-->
just the previous version by
-->
just mentioning
-->
this command undo deployment.
-->
So now undo deployment
-->
and this command.
-->
It will roll back just to
-->
previous version automatically.
-->
And you can see all the pods
-->
will move to the old replica set. So now run
-->
this command. And when you now do
-->
get all or you can do one by one.
-->
You see it rolled back to 1.14.2.
-->
And do
-->
get rs-o
-->
wide. You see that
-->
all of them has moved to the previous ones.
-->
And again you can get pods
-->
if you know one by
-->
do a describe of any of the pods
-->
square any of the pod.
-->
And you would see the version
-->
would be 1.14.2
-->
for the
-->
image.
-->
Yeah.
-->
You can also roll out a specific
-->
version by using a revision
-->
number also. All the revision numbers
-->
you can again update to different
-->
versions. Try to update different versions for example.
-->
You can use one
-->
more if you want to play around. So we use
-->
1.14.2 something correct.
-->
So try to update
-->
it to this one and
-->
try to update to latest one. So I'm going
-->
to just find player app. So I'm going to do latest
-->
and record.
-->
Yeah. So now
-->
how many replica sets must be there now?
-->
How many replica sets now?
-->
Two or three?
-->
Run this command now. You will have
-->
three replica sets or two replica sets now?
-->
Others
-->
CK
-->
Jean. You must have three replica sets. Do you
-->
agree? Because we have three image versions.
-->
Are we good? I understand it.
-->
So every image version would be part
-->
of one replica set. Clear?
-->
And all of the latest one now. It is
-->
according to latest version.
-->
Now let's see the rollout history.
-->
Same thing. Just play around. So now see the rollout
-->
history. And see
-->
the history of your
-->
the J command run again.
-->
And see a rollout history.
-->
And you see it is update
-->
to 4. Now let's again revert
-->
back to revision number 2.
-->
So you want to move to revision
-->
number 2.
-->
So you can go ahead
-->
and run this command
-->
for revision number 2.
-->
Any revision number you can put.
-->
For numbers you see there.
-->
So revision number 2 is my
-->
1.16.1. You see number 2.
-->
I press enter and you would see
-->
deployment wide.
-->
Move to
-->
1.16.1.
-->
And also
-->
your replica set
-->
would be under
-->
the 1.16.1.
-->
And your
-->
pods also. You can also do like this.
-->
And also do a describe pod.
-->
Get pods for example.
-->
And do a describe the pod.
-->
Describe pod.
-->
Give any pod name.
-->
And you can use a grip symbol
-->
if you want. Grip.
-->
The image. Now use the syntax.
-->
It will give you only the line which has
-->
the word image. Replace the
-->
pod name with your pod name.
-->
It's a shortcut. Instead of me
-->
going into the pod and seeing the details
-->
I can see the details by
-->
gripping it. Very good. The content
-->
player for everyone. Charles
-->
CK.
-->
June. So in enterprises
-->
you normally
-->
create pods using a deployment.
-->
Because it helps
-->
to create multiple pods at once.
-->
You can scale up.
-->
Scale down. You can do
-->
updates. You can record it.
-->
And you also have other methods
-->
to update which we are going to talk about now.
-->
Now
-->
a question for you all. If you delete
-->
replica set what would happen?
-->
If you delete replica set what would happen?
-->
Please try to think.
-->
Would it come up automatically or no?
-->
It is because the statement is the deployment.
-->
So it
-->
may come up. So if you want
-->
to delete everything then you delete the deployment.
-->
Now let's go ahead and delete
-->
the deployment. So you can delete
-->
multiple ones. You can say delete
-->
deploy nickname.
-->
And you can say pod.
-->
Like this.
-->
So get
-->
delete
-->
deploy hyphen hyphen pod.
-->
All will get deleted.
-->
Now when you go back
-->
now and you see you will not have
-->
pods. Your deployment
-->
is gone. You don't have any
-->
replica set.
-->
You also see that
-->
there are no pods of that
-->
particular names. So let's
-->
go to the next topic. The continuation of
-->
deployment. Let me I think
-->
so do you work on updates?
-->
Do you work on
-->
updates in your
-->
work? Do you update applications
-->
like this? Is it part of your
-->
workloads? The future? Yeah. Yeah. Yeah.
-->
So tomorrow you would be updating application
-->
different version. All these you are supposed to do.
-->
Is that your work? Okay. Okay fine.
-->
Yes let me share one more document.
-->
Give me a minute. I am going to share a document
-->
to you which will be useful for you.
-->
For deployment. Please download this document.
-->
It will only take some time.
-->
So this
-->
document talks about different
-->
methods to update or deploy
-->
in your
-->
Kubernetes. Now we are talking
-->
about recreate
-->
ramp, blue
-->
green, canary,
-->
A-B testing and shadow.
-->
These are different methods.
-->
Now how does it work?
-->
We observed right now that one deployment
-->
can have single replica set
-->
or multiple replica sets.
-->
We will talk about services
-->
the next topic.
-->
We will talk about these in the next topic.
-->
So what is recreate? So recreate
-->
is wherein
-->
the user traffic. The user
-->
is going to load balancer and then reaches your application.
-->
These are the pod.
-->
So these are
-->
you have three v1 pod
-->
versions.
-->
Now if you want to update
-->
you delete the v1 and then
-->
create the v2 version.
-->
So there is a down time involved.
-->
So this
-->
method is used when
-->
you are doing a testing of a
-->
workloads. Whether the down time
-->
doesn't matter. It is quite easy to do it.
-->
You just need to delete the older ones, create a new
-->
yaml file of a new version and then create it.
-->
But there is a huge
-->
impact
-->
in case if you are looking for live customers.
-->
Down time will be there. The one which we
-->
used right now is also called a ramp
-->
or incremental or rolling
-->
update.
-->
So in this what happens right now we have
-->
v1 like 1.14.2
-->
which we use. When you say
-->
update 1.16.1
-->
what happens?
-->
You define the percentage. In default
-->
if you don't mention percentage it is normally
-->
33%.
-->
33% of 3 is 1. So you will update
-->
one of them first, the higher version
-->
and then the existing one will go down.
-->
You create equivalent one of this
-->
you see here. The user
-->
is still connected to this version not
-->
this. Once this is ready
-->
then this will go away.
-->
And then
-->
this gets created. This is called
-->
as a rolling update.
-->
And you can modify
-->
how many you want to update at once
-->
by using in a kind
-->
deployment.
-->
You can write in this parameters.
-->
So for
-->
example if you observe your
-->
deployment. So if I
-->
say apply
-->
the yaml file which you created
-->
and if I say
-->
get deploy
-->
yaml file.
-->
You see this
-->
it gets in the yaml file information.
-->
And in this yaml file right now
-->
you can see the rolling update
-->
it is
-->
at 25%.
-->
So approximately after 3 it is taking
-->
in 1 right now.
-->
So you can modify these values.
-->
And to modify values you can also use this method.
-->
You can also say edit.
-->
You can also either open the yaml
-->
file or you can say edit.
-->
Deployment, deployment name,
-->
have no yaml. And you can modify
-->
the configurations.
-->
So for example I want to
-->
3 hat, I want to create more copies.
-->
I can also
-->
modify like this. Either open the yaml
-->
file or you can
-->
modify like this and then
-->
save like this.
-->
So like this we can make
-->
in the modifications.
-->
This is the rolling update.
-->
So you can define how many you want to
-->
unavailable that is 2.
-->
Like this we can mention numbers.
-->
Are we good?
-->
This is the yaml update.
-->
This is good.
-->
Sometimes you might have
-->
lose control
-->
but very rare.
-->
This is very good to use. So this is something
-->
recommended by kubernetes.
-->
Blue green is a strategy
-->
in which one is live
-->
other one is not live.
-->
So example this is green
-->
this is live. It means customer workloads
-->
is going to this v1.
-->
Now assume that
-->
the v1 version is getting expired.
-->
You have to move the application
-->
to a new version.
-->
So internally you create a v2
-->
version of application
-->
and then switch the user to v2.
-->
The v1 version is still there
-->
in the backend. It is not terminated.
-->
So something happens to v2
-->
you can switch back to v1.
-->
So blue green is something like this
-->
and you have 2 environments.
-->
In this the challenge is
-->
you need to deploy 2 of them.
-->
It means it is costly.
-->
And other one is
-->
you are not doing a live testing.
-->
You are assuming that it will work for
-->
v2 for the customer.
-->
You are not doing a live testing.
-->
You might get some errors.
-->
So if you are very confident then you can do
-->
but you are taking a risk. So in case
-->
you don't want to take a risk
-->
you can do a canary in which
-->
you would send traffic
-->
like 10% to the other side.
-->
Then increase from 10% to 20%
-->
like 30%.
-->
You keep on doing it.
-->
And for doing this
-->
traffic management,
-->
Kubernetes does not have the capability.
-->
So you have to use
-->
service mesh.
-->
Like we have linkerti, we have istio
-->
third party tools
-->
which you have to install it
-->
and you have to define the
-->
routes or the rules.
-->
So example like this.
-->
So you have to use tools like istio
-->
install it, configure
-->
with kubernetes and then you can mention
-->
that for version 1, 90%
-->
traffic. For version
-->
2, 10% traffic.
-->
We have to do something like this.
-->
This is good but
-->
this is complex here.
-->
A-B testing is also
-->
very important.
-->
So A-B testing is an example. If you
-->
access your Amazon consort from
-->
a mobile you see a different screen.
-->
If you see it from your laptop
-->
you see a different screen.
-->
So testing has to be done with Amazon
-->
to ensure that users are able to
-->
see the options properly on their
-->
different devices.
-->
While the user is logging from US
-->
you might want to see a different page
-->
in the login page. Something like that.
-->
So based on user preferences,
-->
user location, you want to do some testing.
-->
That is called A-B testing.
-->
So this is for one version.
-->
This is B-2 version.
-->
The last one which we can use is shadow testing.
-->
But in the user
-->
traffic also goes to the other
-->
version. But the user will still
-->
see the old screen.
-->
So internally the
-->
backend theme you would observe
-->
is the traffic going properly to the B-2 version.
-->
And then
-->
you can switch the user to B-2 version.
-->
So live traffic is
-->
going to the backend.
-->
Shadow, mirrored and dark we talk about.
-->
So these are different methods
-->
using which you can update applications
-->
in Kubernetes.
-->
So when you go for
-->
if you are looking for zero downtime,
-->
these are good. If you are talking about real traffic testing,
-->
these are good.
-->
If there are use cases
-->
very specific users, then A-B testing
-->
talking about. Cloud cost,
-->
this is more because we are talking about two environments.
-->
This is more because we are having
-->
two environments again.
-->
Rollback duration, impact,
-->
complexity.
-->
Are we clear?
-->
Any questions?
-->
Yes, no. Are we good team?
-->
If you have any questions you can ask me.
-->
Okay.
-->
So now in the
-->
labs
-->
we have seen this.
-->
This is an example of rolling update.
-->
So if you have
-->
you first create one version.
-->
You create
-->
one version.
-->
This is version one.
-->
Then you want to update to new version.
-->
The same image for example.
-->
Right now we have
-->
what you can do, you can either
-->
use edit method.
-->
The doctor will choose edit.
-->
The deployment name.
-->
Or open the YAML file and then apply it.
-->
With the new version.
-->
So modify the version and apply
-->
or edit.
-->
And see what happens.
-->
Going to play around with this, second one.
-->
The second lab yourself.
-->
Please.
-->
Lab two. Lab two please.
-->
Please find in your application
-->
lifecycle management which is module
-->
three in a kubernetes with lab two.
-->
Good. You are doing good.
-->
First version. Yes.
-->
Now try to modify.
-->
Instead of one make it two.
-->
In search mode.
-->
Press I.
-->
Press I and then
-->
instead of one make it two there.
-->
Yes. Escape colon.
-->
Save.
-->
Escape colon WQS.
-->
Now it will update automatically.
-->
Just do get deploy hyphen o byte.
-->
But apply.
-->
Apply. Apply.
-->
kubectl apply needs.
-->
Now you can check the version of deployment.
-->
You see it has gone to two version.
-->
But you can do the other method.
-->
Do edit method now.
-->
Instead of get.
-->
Do edit deploy.
-->
Do other method now.
-->
kubectl edit.
-->
I tell you kubectl edit.
-->
Yes. EDIIT.
-->
Yes.
-->
Yes. Deploy.
-->
Deploy.
-->
And give the name of the deployment.
-->
Hello hyphen dep.
-->
Enter. What happens.
-->
Blank. Yeah.
-->
So now in this now. Go down.
-->
And modify again to three.
-->
For example. Make it a three version.
-->
Now the line. The image line.
-->
Yes. Insert mode. Make it a three.
-->
Just escape colon save.
-->
Save it.
-->
Colon. Escape colon WQS.
-->
Let me check.
-->
Can you come out of this file again?
-->
Don't save it. Escape colon Q.
-->
Don't do W.
-->
Escape colon Q.
-->
And exclamation. Again go inside.
-->
Don't see. Yeah.
-->
OK.
-->
I think. Can you go down.
-->
I tell you how to do it. So I tell you what to do.
-->
Go down. Go to insert mode.
-->
Go to the line where the image line is there.
-->
Go up.
-->
Yes. Delete.
-->
One delete. One delete. Press the delete once.
-->
One second. That's fine.
-->
Go to starting the line.
-->
You made some errors.
-->
Yeah. Click on delete button once.
-->
Delete. Yes. Once more.
-->
Yes. Yes. Now save it.
-->
Escape colon WQS.
-->
Now. You could go ahead and see
-->
it will update to version 3. Do again
-->
deploying. No. Just see the version now.
-->
See that. So we can
-->
yeah. So we can either use
-->
the existing YAML. We can open it.
-->
Or we can do edit.
-->
Or get in a new YAML file
-->
and modify. These are different methods
-->
wherein you can update your configurations.
-->
Clear?
-->
Yeah. Yeah. Others
-->
Are we good? No. No. No.
-->
Okay. I'll tell you what to do.
-->
Press I.
-->
Press I. Insert mode.
-->
Yeah.
-->
Now good.
-->
Now go to that line.
-->
Go to that line. Use the apparel. Yes. Yeah.
-->
Colon. Colon.
-->
No. No. No. Okay. That's fine.
-->
3. Yeah. Now go to starting
-->
the line. Go to starting
-->
the line. Press delete
-->
once. Still back. Still back.
-->
Yeah. Delete once. Press delete once.
-->
Once more.
-->
Once more. Yes. No. No.
-->
Use your friend.
-->
Use the space bar.
-->
Press space bar once. Yes. Good.
-->
Escape colon WQ.
-->
Escape.
-->
See this file. That's it. Now check the deployment
-->
version now. Go to get deploy
-->
hyphen OY. Get deploy
-->
hyphen OY.
-->
And you see the version has changed
-->
too. Clear?
-->
So different
-->
methods using which you can update the
-->
configurations.
-->
Others. Are we good? Okay. Good. Good.
-->
Good. So now you're finding it.
-->
You like your billets now or you like
-->
containers? Yes. Which one is more interesting?
-->
Charles?
-->
Which one is interesting for you?
-->
Yesterday's topics or today's topics?
-->
Okay. Okay. Good.
-->
Okay. Now
-->
delete the deployment.
-->
Delete the deployment and see what happens.
-->
Everything will go. Go and check.
-->
You will not have any deployment.
-->
Replica set. Nothing would be there.
-->
Okay.
-->
Next topic.
-->
So what do you mean by health check?
-->
Have you heard the term health check?
-->
Or probing?
-->
Yes, Gene.
-->
You just told yes.
-->
I heard you. Yes. Try to answer it.
-->
You can try your best. Okay.
-->
Let me start from here. In kubernetes
-->
which component would do the health check of a
-->
pod? Who does the health check? Who does the health check
-->
of your pods? It is your
-->
cubelet. Clear?
-->
So cubelet
-->
does the health check. Let me now
-->
explain the example.
-->
Now let's consider
-->
you had
-->
this is your worker node
-->
and you have cubelet in every node.
-->
And you have the pod
-->
running inside
-->
this.
-->
And the pod one,
-->
pod two,
-->
and pod three.
-->
And this is running your application.
-->
Okay. So cubelet
-->
needs to check if
-->
it is working fine.
-->
So it has to go ahead
-->
and look into some important file.
-->
For example, for a front end
-->
could be index.html
-->
is very important file
-->
because this has the front end contents.
-->
If this is not
-->
responding, then there is some problem
-->
with your application.
-->
This type of probing what
-->
cubelet can do is called
-->
as liveness probes.
-->
So liveness probe means
-->
cubelet will check if the
-->
end point is responding properly.
-->
Is it coming up very
-->
soon? Is it slow? Those type of
-->
checks. And for doing
-->
this, it does a health check using a pod.
-->
So it uses a protocol like
-->
HTTP.
-->
It uses try to reaches using a port
-->
number 80. And this is the
-->
end point.
-->
So the protocol is HTTP.
-->
It will go like this.
-->
It will go to port 80
-->
for example.
-->
And under 80 it will try to reach the
-->
point index.html.
-->
This is your protocol.
-->
So you have to mention which port number
-->
and you have to mention the
-->
destination
-->
or end point or
-->
retort of path.
-->
It will use multiple names.
-->
And when must
-->
it do? So you mention interval
-->
name like interval 15
-->
seconds. So it does this
-->
checks every 15 seconds.
-->
Whenever it does, how much
-->
of time you want it to wait.
-->
That you mention under
-->
time mode like 5 seconds.
-->
And how does it know it is healthy?
-->
So you can say healthy
-->
threshold. And you can
-->
say 3. It means that
-->
if 3 times it is able to reach
-->
to this continuously
-->
3 times consecutively it will understand healthy.
-->
You can also say unhealthy
-->
threshold like 2 times.
-->
If this is not able to reach 2 times
-->
consecutively it will understand it is
-->
unhealthy.
-->
And whenever it is unhealthy
-->
after some time
-->
it will do a restart of the
-->
port. Thinking that
-->
if you restart the port it would
-->
become good.
-->
And hence whenever you see
-->
any restarts in your port
-->
it means there is some health checks defined
-->
inside it. So there are any issues
-->
in general very regularly
-->
cubelet would do a restart of the port.
-->
So this type of
-->
probing we are talking about the liveness probe.
-->
Now let us consider
-->
that your application did not
-->
come up at all. The port did not come.
-->
Then the liveness
-->
probe would fail. So you
-->
can also define one more probing called
-->
the start up probe.
-->
The start up probe would
-->
ensure that
-->
once your port
-->
or the application is running
-->
settle down then your
-->
liveness probe would get started.
-->
So first would be a start up probe
-->
and then a liveness probe.
-->
We also have
-->
something called readiness probe.
-->
The readiness probe means
-->
is your application
-->
ready to take new workloads.
-->
Can it take new workloads?
-->
Is it okay to run new workloads?
-->
We can do some checks.
-->
So we can do liveness probes
-->
to check in the status of application.
-->
Start up probe
-->
to ensure it is started.
-->
Readiness probe to check if it is
-->
ready to take in the workloads.
-->
And we can use different
-->
protocols for doing this health checks.
-->
So we are talking
-->
about oneness.
-->
We will talk about this basically after this.
-->
We can use HTTP
-->
or we can use TCP
-->
or we can use custom methods.
-->
And whenever the health
-->
check failed it says to restart.
-->
What is liveness? There is some problem.
-->
The application is getting hanged.
-->
So for these type of issues you have to
-->
understand the restart.
-->
Readiness probe and
-->
the start up probe are to ensure
-->
that these are ready or started.
-->
And we can use different protocols
-->
for the same.
-->
Have you got the concept clear?
-->
Let's do the
-->
module 4.
-->
Lab 4.
-->
Now what is 200?
-->
What is the code
-->
200 means?
-->
Code 200.
-->
HTTP. What is 200?
-->
What is 400? 200 means
-->
success or fail.
-->
Any code between 200
-->
and
-->
399
-->
it means
-->
success.
-->
Clear?
-->
Any code above 400
-->
is just normally an error message.
-->
I am sure you have seen this.
-->
When you access any website
-->
sometimes you see 401. Correct?
-->
We get some error messages.
-->
So the
-->
cubelet and
-->
the pod they communicate using
-->
these code languages.
-->
They use the status
-->
codes in the backend to understand
-->
whether the health check passed or
-->
failed.
-->
So now in this lab now
-->
we are going to do a HTTP check.
-->
So we are going to create a pod
-->
in which you are going to define a correct
-->
probing.
-->
And then we observe as a restart.
-->
Then we will make some error
-->
wantedly.
-->
And we will see if the container gets restarted.
-->
So this is your example.
-->
Now
-->
what is this path?
-->
What is this path?
-->
Would this linus check pass
-->
or fail?
-->
Would this pass or fail?
-->
Would this health check
-->
pass or fail?
-->
What is path root?
-->
Should every container have a
-->
root path? Yes?
-->
No? I am getting it.
-->
Would every container have a root path or not?
-->
Please confirm. The next container would have
-->
a root path. This would run.
-->
Because it will find the root path.
-->
All good.
-->
Now you tell me now would this run?
-->
The next one.
-->
Would this
-->
pass or fail?
-->
Testing. Does every default
-->
enginex would have example.txt?
-->
Do you agree? Would every container of enginex
-->
would have a path of example.txt?
-->
No? Correct?
-->
You will not have the default
-->
file. So it will not find the file.
-->
And it will
-->
restart the container. Are you getting it?
-->
Let's do the lab now.
-->
Let's do lab 4.
-->
So let's go ahead
-->
and try to create a pod.
-->
And we see the pod
-->
status.
-->
And observe restart column.
-->
And let's see whether it gets
-->
restarted the health check pass.
-->
So let's go ahead and
-->
do this.
-->
Do along with me. First one
-->
create yaml file.
-->
And then create
-->
a pod. And run this.
-->
Good.
-->
Now do a describe yourself.
-->
Do a describe of the pod everyone.
-->
Describe of the pod and check
-->
where is the health come. It says line
-->
which will update the health check. Go and check
-->
that. Go up. You see a line
-->
which says health check. Let's see.
-->
I wanted to observe that. In the describe command
-->
you will have a line with the health check. What does health check
-->
says? Yes.
-->
The right one. So after
-->
how many. I wanted to answer
-->
after how many times it will do a restart.
-->
After how many times does it do a restart
-->
in case the condition fails. Let me explain
-->
you this now.
-->
So it's got created now.
-->
So I'm going to say
-->
describe
-->
pod and the pod name.
-->
And now you see that it got
-->
created on worker 1.
-->
And this is health check.
-->
So now it is going to
-->
do a restart in case
-->
it fails after 3 times.
-->
This is the threshold.
-->
Success. So even though
-->
we did not mention these values
-->
these are default values we
-->
picked up. Timeout 1 second.
-->
So every time it does the check
-->
it will wait for 1 second.
-->
And every 5 seconds it will do a check.
-->
And initiate
-->
delay. First time before it does
-->
a check it will wait 15 seconds.
-->
So it is
-->
all going to reach because you have a root path.
-->
So now
-->
let's check what is happening.
-->
You see. No restarts.
-->
Now let's check the logs.
-->
Do kubectl
-->
logs and give the
-->
pod name. Type in kubectl
-->
logs and the pod
-->
name. Do you get output like this everyone?
-->
Please do this.
-->
Yes you are good. You can do this command
-->
kubectl logs and the pod name.
-->
kubectl
-->
no your command is wrong. kubectl logs
-->
you did not get full name.
-->
Charles
-->
logs
-->
nginx
-->
hyphen lightness give full name of
-->
yes. No no no.
-->
Lightness. No no. K
-->
just type it I am going to tell you.
-->
K space logs
-->
space
-->
logs
-->
logs
-->
ggs
-->
yes space
-->
nginx
-->
just name of it. Just copy and paste.
-->
nginx
-->
Charles paste the
-->
name of your pod.
-->
What is the pod name?
-->
nginx
-->
no I no I
-->
nginx
-->
hyphen
-->
lightness
-->
no space
-->
no space
-->
hyphen
-->
lightness enter.
-->
Ok.
-->
So now do you see the health check
-->
passing now? What error number are we getting?
-->
We are getting the messages 200.
-->
It means the health check
-->
is running every how many
-->
seconds? You have to answer this please.
-->
5 seconds.
-->
You see it has the date.
-->
It has the pod IP.
-->
It is running in.
-->
And the success code 200.
-->
It means it is successful.
-->
This is how we see the logs.
-->
So the checks are passing.
-->
So there is no restarts.
-->
Ok. So now this is our success.
-->
So now let's
-->
go ahead and do the next one
-->
which is wrong. So let's
-->
go ahead and see
-->
the live fail.
-->
So say
-->
say.n
-->
and
-->
the
-->
command.
-->
It is the same what we did for this
-->
and see what the log says.
-->
And observe the describe.
-->
Please observe everything.
-->
Ok. So now apply
-->
hyphen f
-->
and this.
-->
So now
-->
do a get pods hyphen o
-->
and white.
-->
You see it is
-->
Now do a describe of the pod.
-->
Describe of the pod.
-->
And engine
-->
x hyphen liveness fail.
-->
Now you see that
-->
it is going to fail because
-->
not have find the file.
-->
So wait for some time.
-->
You can also do a describe.
-->
And you see
-->
this. Again you describe.
-->
Wait for 10 or 15 seconds
-->
and do a describe again. You see liveness
-->
fail.
-->
Because not able to find it.
-->
So now you can
-->
do a logs.
-->
And you see restart
-->
happen once.
-->
Now do a logs
-->
of the pod. And you will see that
-->
it say the health check
-->
fail. So it will do at least 3
-->
or 4 times. And after that
-->
it will restart or it will
-->
become a crash loop back off.
-->
It will do a crash loop back off.
-->
So it will wait
-->
45 seconds every time, 5 times
-->
and then do a crash loop back off.
-->
So 2 times.
-->
So wait for some time and
-->
you will see the logs get failed.
-->
See 4 times.
-->
5 times.
-->
And after 5 times
-->
it will do a
-->
reboot.
-->
It will go crash loop back off.
-->
It will crash off.
-->
You see here
-->
it is trying.
-->
So it tried.
-->
This time
-->
keep on trying.
-->
Trying, trying,
-->
trying, 1044,
-->
1044, trying.
-->
It failed.
-->
It is gracefully shutting down.
-->
Now when you see this it will crash loop back off.
-->
Okay, are we good?
-->
This is one method.
-->
We can also use the other method
-->
in which we talk about TCP.
-->
So TCP is one more protocol
-->
which works on port 8080.
-->
So you can also do
-->
with port 8080.
-->
And it will work
-->
because the ports are number right.
-->
And in here
-->
we do a small example in which
-->
we are trying to make it a fail
-->
by giving a different port number 8090.
-->
This is wrong.
-->
So it will not be able to reach on
-->
port 8090 on your container.
-->
And hence
-->
the health check would fail.
-->
So like this we can either
-->
in actuals it will be the actual numbers
-->
actual location but
-->
quite difficult to replicate the actual data.
-->
So here just
-->
to show you how
-->
your health check fails and passes
-->
we are doing some small examples.
-->
Are we clear?
-->
Everyone?
-->
Any questions?
-->
Okay.
-->
Now we forgot the best practices
-->
let me go to best practices
-->
and also cron I think we will come back to here.
-->
So best practices when you work with
-->
the deployment is start always
-->
scanning the images.
-->
So whatever images you use
-->
always ensure that the images
-->
are secure, your private
-->
images which is tested
-->
and do regular scanning.
-->
Regularly update
-->
your updates.
-->
For example we do regularly we want to
-->
always add update.
-->
Post this in your contents because you always want to get
-->
the updated ones.
-->
Ensure that you use only authorized images.
-->
No access
-->
when you work in enterprises you will not
-->
get access to worker nodes.
-->
Any work must be
-->
done for the master.
-->
Define policies
-->
as to what resources can be communicated.
-->
Network
-->
Apply
-->
the privileges
-->
and everything
-->
log everything whatever you are doing.
-->
What is cron job?
-->
Yes no?
-->
So like in windows
-->
we have dot back schedulers
-->
we call them windows back schedulers.
-->
Similarly we have
-->
cron jobs for linux schedulers.
-->
You can go and see this.
-->
It looks something like this.
-->
So it is crontag.query
-->
in which you can go. For example
-->
I want to schedule a job in this time
-->
on this date.
-->
So if there is two asterisks
-->
in here it means
-->
it is going to every minute
-->
the first one is minute
-->
the second field is hour
-->
the third one is day
-->
like 28 numbers
-->
talk about. This is the month
-->
and this is the day.
-->
So example I can
-->
put five. It means every
-->
Friday. Now if I put
-->
in here fifth it means
-->
May we are talking about.
-->
And in here I can say
-->
25th on day of the month
-->
25.
-->
In here I can mention
-->
I can mention in here
-->
that
-->
So this is going to take
-->
exactly some work
-->
at 12 12 o'clock
-->
12 1 on May 25
-->
which is on Friday.
-->
Or you can just even give
-->
zero for example
-->
I am going to take it
-->
zero means Sunday
-->
So we can do something
-->
like this. We also have an object
-->
called as cront.
-->
So if you search for cront
-->
they are very good document. You can just go and search anything
-->
whatever you want.
-->
So cront job is an example.
-->
Ok what does this do?
-->
It can be louder
-->
no issues.
-->
It is going to run every minute.
-->
What is going to run every minute?
-->
Yes so this is
-->
going to get printed every minute.
-->
So you can apply this
-->
and then we can see the output.
-->
So let's try to do this play around.
-->
Let me give this.
-->
cront.yaml
-->
insert mode
-->
and paste the contents.
-->
So this is doing
-->
it is going inside
-->
your shell.
-->
Just printing it with this message.
-->
So let's save this.
-->
And apply.
-->
iPhone F
-->
cront.yaml
-->
So if we say
-->
get all example
-->
you see that or you can say
-->
get jobs.
-->
Also say cront job.
-->
Get cront job.
-->
And get pods.
-->
So it has got created one.
-->
So do a get cront job
-->
when you want to see what is there.
-->
You see get cront job. This is your job.
-->
And now get pods happen one.
-->
You see it is completed.
-->
Do logs of that pod.
-->
Do logs of that pod.
-->
And you will see the logs
-->
are printed.
-->
Hello from.
-->
Wait for one more minute.
-->
So it again created
-->
one more.
-->
38
-->
still not created.
-->
10 more seconds.
-->
And you will be seeing the
-->
output of that also.
-->
So go ahead and do a logs of this.
-->
You see the hello from cluster.
-->
So this is
-->
a simple example.
-->
So like this you can define some mapping.
-->
Like what is for empty directory
-->
some location or file. You can say
-->
copy the files to a specific location.
-->
Like a backup.
-->
Or some specific
-->
scripts to run.
-->
At that time.
-->
We can use a cront job.
-->
Any questions? So what have we learned
-->
in deployment? Let's summarize deployment.
-->
So we first learned about
-->
deployments. Deployments are very important.
-->
And this is what we use in enterprises.
-->
To create.
-->
So once we create a deployment.
-->
It first creates a deployment.
-->
That deployment creates a replica
-->
asset. And that replica asset
-->
creates your pods. This is what we use
-->
for releases and updates.
-->
So deployment to replica
-->
asset says clearly.
-->
And the pods will get created from your deployment.
-->
You can roll back.
-->
Scale up. Pause.
-->
For all we talk about kinder
-->
deployment. It's very very important.
-->
How do all these components get
-->
linked to each other? Use labels in the backends.
-->
Labels are tag
-->
names which we give. To identify
-->
what is the use of the
-->
particular components.
-->
How do we
-->
do some operations on it?
-->
For that we can use this.
-->
We can have multiple labels
-->
for a pod. We can filter it using selectors.
-->
So when you create a deployment. Request
-->
goes to API first.
-->
Then to controller manager.
-->
This will create your replica
-->
asset. And then the scheduler
-->
would come in. And
-->
it decides which node.
-->
And kubelet would create the pod
-->
on the particular nodes.
-->
And deployment normally does
-->
load balancing by default.
-->
So if you say that you want
-->
five pods. We create two in one.
-->
Three in one. Something like this.
-->
Replica asset remembers the current state.
-->
If anything is there
-->
it will again help to ensure that it is going
-->
to the current desired checkmatch match.
-->
Different methods to update.
-->
The default one is rolling update.
-->
You can roll back to previous versions by doing
-->
recording it.
-->
And you can also integrate with your CICD tools.
-->
Like Jenkins or TeamCity
-->
other tools. To make it
-->
much more easier.
-->
To update you create new replica asset.
-->
It removes all the new replica asset
-->
practices.
-->
So do you want to do some
-->
more topics or we are good?
-->
What do you say? What do you want to say?
-->
If we don't talk I will keep on talking.
-->
If we don't talk I will keep on talking myself.
-->
What do you want to do? Either you want to talk
-->
or you want to say yes or no.
-->
Keep on talking. What do you want to do?
-->
Yes Charles? Gene? Others?
-->
I want you to talk. What's the answer?
-->
Do you want to continue?
-->
Or we are good? I want to understand
-->
what's happening in your mind.
-->
It's quite difficult for me too.
-->
You're feeling hungry?
-->
We have
-->
topics. I think
-->
we are in the right phase.
-->
See I don't have any because
-->
I know the
-->
participants. I cannot decide
-->
which topic. For example
-->
some participants are very fast, some are slow.
-->
So based
-->
on the participants I
-->
map my schedule.
-->
Otherwise I will keep on
-->
it's very difficult to map. So the reason
-->
I always look into how are the participants
-->
how are they learning
-->
what is your learning speed
-->
and then I paste my topics.
-->
So what I feel is
-->
as per your speed
-->
I think we are good.
-->
We have done. We are good.
-->
We have done a lot today. We learned about
-->
Kubernetes. We installed Kubernetes.
-->
Namespaces in here.
-->
So if we are doing the same speed
-->
tomorrow we are good.
-->
But if you want I can still
-->
talk about. It all
-->
depends. Are you okay to continue?
-->
Are you able to take in more information?
-->
That's my question. Each one can give the opinion.
-->
We'll decide.
-->
How many wants to continue? Say yes
-->
in the chat or no in the chat. Anything is okay.
-->
Gene, we want to start. Let's start with you.
-->
Please. Say yes or no in the chat.
-->
Others? Fine. Let's continue.
-->
Next topic is
-->
networking. In networking
-->
we learned
-->
when you add in the CNI
-->
the CNI is what
-->
giving IP addresses.
-->
Allowing them to communicate.
-->
All the communication
-->
network. All these things. They get
-->
IP addresses, MAC addresses. All these
-->
because of the CNI which you
-->
added.
-->
Now WeaveNet
-->
or Calico
-->
or Flannel. All these
-->
provide networking features for the
-->
Kubernetes. That's what we learned.
-->
Now we have one more concept networking
-->
services.
-->
For example
-->
these are your back end
-->
pods.
-->
Now
-->
if the containers
-->
I cannot directly restart my
-->
pod.
-->
But I can, the back end start and
-->
stop my containers.
-->
So if I do a start and stop
-->
you see
-->
the IP changes.
-->
And if I'm a user, if I have
-->
set up some session
-->
that I have to use 192
-->
something. You see 192
-->
168
-->
2.32
-->
It will not work for me
-->
because the IP changed.
-->
Or this is not again trying to communicate
-->
with this IP. It will not work.
-->
So this is not very
-->
good. It might stop your
-->
working of some
-->
components or applications.
-->
And we cannot directly assign
-->
a static IP to this.
-->
So we have to use
-->
some middlemen.
-->
As per the service.
-->
So what we do.
-->
Example you create a blue deployment.
-->
You see blue color.
-->
With replicas 3.
-->
And you use a label.
-->
Like app equal to blue.
-->
Use this label. Now I want
-->
to map to a service. So I say
-->
kind service.
-->
And
-->
I would use the same label.
-->
App equal to blue. See.
-->
So since
-->
the label names are getting
-->
mapped. This and these
-->
are getting mapped.
-->
And this gets a public static IP.
-->
So user now
-->
first user hits it.
-->
He logs in using
-->
this IP. The traffic
-->
will go to this one. For example.
-->
If a second user
-->
tries to access it.
-->
The traffic will go to this.
-->
And then reaches the second one.
-->
Third user comes in.
-->
Hits it. The traffic
-->
will go to the third one. So instead of
-->
reaching directly you.
-->
The traffic will go via the static IP.
-->
Same for
-->
other application. Now other application.
-->
You create a deployment.
-->
For a pod. And map it to a
-->
service. You want to reach the application.
-->
It will reach to this. And then reaches
-->
here. I'm getting it.
-->
Similarly this wants to communicate to
-->
blue. It will go to
-->
this service.
-->
And this will send the traffic to either this
-->
or this or this. Any communication
-->
will be in the back end using services.
-->
And these are very important
-->
because the IP keeps on
-->
changing. And unless
-->
until you use a service.
-->
They may not be able to reach the
-->
back ends properly.
-->
And this is
-->
part of
-->
your cluster. So this could be your
-->
master. Would put your
-->
worker one and worker two.
-->
The services
-->
across the cluster. You see.
-->
It's common.
-->
Green or blue.
-->
It's a cluster service.
-->
It's called internet.
-->
What is internet?
-->
Now this is your application
-->
for example.
-->
And this is your database.
-->
Now this
-->
wants to communicate to this. So what it will do.
-->
It will go and hit
-->
the service. And that will send
-->
the traffic to this.
-->
So only if this want to communicate
-->
to database this. It will communicate to this.
-->
And reaches in here.
-->
And
-->
you have to use a kube proxy. Kube proxy
-->
network rules. You have to use a port number
-->
80 for kube proxy. And then
-->
it reaches the service.
-->
It reaches the service. And then reaches
-->
the back ends. This is for internet.
-->
Now the next one. Which is
-->
testers node port.
-->
Is used in your
-->
pre-prod
-->
or a cd.
-->
What is cd?
-->
What is staging?
-->
Testing area.
-->
Testing area.
-->
You all work on agile. You all work on releases.
-->
So enterprises
-->
you will work on dev environment.
-->
You work on test.
-->
And then you
-->
release it in pre-prod.
-->
Or a staging.
-->
And then use your prod.
-->
Do you agree? Production.
-->
So before we
-->
lie we have to do a staging.
-->
So now
-->
I am using node port
-->
in my staging area. How does
-->
it work? You need to
-->
mention a kind. Again
-->
as a service.
-->
And we can use any port number between
-->
30,000
-->
and 3276.
-->
Any port number you can mention.
-->
And the type would be
-->
node port. And the port number
-->
you can mention like 30,000.
-->
For example.
-->
If you do this the same
-->
port number would be exposed in all
-->
the nodes including a master. And if this is
-->
your web server you don't want to access
-->
the traffic could go
-->
so you are testing it.
-->
So you would use the public IP of this machine
-->
of like master public IP.
-->
The public IP of this machine.
-->
If you type in public
-->
IP of the master
-->
colon 30,000.
-->
It will go to this.
-->
Then it will go into this service
-->
and reaches to here.
-->
Now if I type in public
-->
IP of worker one. It will go
-->
to the node port
-->
of this machine. It goes to crew proxy.
-->
It goes to this and reaches it.
-->
If I type in public IP of this machine.
-->
I want to reach it. It goes to this.
-->
Put queue proxy. And then
-->
reaches in here.
-->
This is what is node port.
-->
We cannot expose the outside world
-->
because we cannot
-->
give public IP to the others.
-->
Let me give us
-->
different easier method
-->
to see this also easily.
-->
Please save this link at your end.
-->
Let's see this link. I paste this link
-->
in the chat.
-->
So other way to look
-->
around the node port is something like this.
-->
So you see here
-->
any traffic comes to crew proxy.
-->
Now if you see
-->
for node it is a node port.
-->
The traffic is coming from internet.
-->
It reaches the node port
-->
in here.
-->
So if you create a node port.
-->
It creates a cluster service.
-->
It also exposes the port on your
-->
external.
-->
The traffic comes like this.
-->
Reaches your cluster service.
-->
And then reaches in here.
-->
Traffic comes from outside.
-->
It reaches the node port number.
-->
Then reaches cluster service. Reaches in here.
-->
This is what is node port.
-->
And enterprises
-->
the DevOps engineer
-->
they play around by using node port.
-->
And then once it is good
-->
then they configure load balancer
-->
on top of this. Because
-->
the traffic, it can, more
-->
traffic can go into this.
-->
Less to this. Less to we need to have load balancer.
-->
So once you test this
-->
and then we go ahead and create load balancer
-->
on top of this.
-->
It could be your VMware load balancer
-->
we can use or F5 load balancer
-->
or AWS load balancers.
-->
Or we can use Ingress
-->
controllers. All these we
-->
can use instead of
-->
the default ones.
-->
So this is what is type node port.
-->
Now as I talked about this doesn't
-->
have much distribution
-->
workload. You have to use the load balancer type.
-->
For this we meant the type of
-->
is your load balancer.
-->
The traffic again goes to node port.
-->
And then reaches and reaches.
-->
Are we getting this? What are these
-->
three type of services?
-->
Cluster is internal.
-->
We are talking about node port
-->
external.
-->
And then we are talking about
-->
load balancer also external.
-->
Any questions? Any questions?
-->
So what I recommend do is
-->
we have learnt a lot today.
-->
For doing this hands on
-->
services you need to understand this
-->
very clearly. So I would
-->
request you to read through what we learnt.
-->
Just for 30 minutes
-->
at your home or wherever you are.
-->
So that is easier for you.
-->
And I think we will do
-->
the laps of this and the topics tomorrow.
-->
Is that ok? Any other questions?
-->
Before we close the session
-->
today. All the
-->
hands on we will do tomorrow.
-->
So we don't
-->
if you want we can do it now. If you can't we can do it now also.
-->
For load balancer
-->
there is a demo because we cannot do it
-->
load balancer.
-->
There is a demo. I will explain how to do it.
-->
But we will talk about
-->
ingress controller later.
-->
That time I will show you like this.
-->
Because
-->
you have to use ingress controllers.
-->
We use a lot and in this we will do an ingress controller.
-->
So these
-->
are the topics.
-->
Ok.
-->
Thank you team.
-->
See you all tomorrow.
-->
Welcome.
-->
Bye bye.