Scaling Jenkins: Create & Configure Linux Slave Node via SSH | Scale on Cloud Using AWS EC2 Plugin
Scaling Jenkins: Create & Configure Linux Slave Node via SSH | Scale on Cloud Using AWS EC2 Plugin
In This “Scaling Jenkins: Create \u0026 Config Linux Slave Node via SSH | Scale Using AWS EC2 ”, you will learn 1) Create a Configure Slave Jenkins Node 2) Configure Master Node so that it can connect with Slave Node 3) Create a Jenkins Build Project and Run in Specific Linux Slave Node 4) Scale Jenkins on the Cloud With AWS EC2 using AWS EC2 Plugin
▬▬▬▬▬▬ Chapters With Timestamps ⏰ ▬▬▬▬▬▬ 0:00 Intro 0:54 Why We need Jenkins to Scale? 2:06 Create and configure AWS EC2 instance to add as a slave 4:31 Install Java into Slave node 5:19 Add linux-slave user for Jenkins slave node \u0026 verify the newly created user 6:04 Set new password for the new user, then add the user to sudo group and verify the same 6:20 Login as the new user and setup ssh certificates and complete necessary steps 8:43 Configuring Master node to add and connect with slave node 16:48 Create a Jenkins build project and run inside slave node 19:15 Scale Jenkins on AWS Cloud: Install and Configure Jenkins AWS EC2 Plugin 20:51 Add EC2 role access to master instance so that it can create necessary resources (Slave node) as required 23:46 Create and configure EC2 Keypair so that Jenkins Master can connect with newly created slave nodes via the private key 25:41 Getting AMI ID EASY WAY 28:17 Adding Lebel 28:30 Create and configure EC2 Security Group 30:53 Running build project in specific AWS Ec2 Cloud Node 32:59 Troubleshooting \u0026 Fix the SSH Access 34:08 Running Build Projects Successfully
► Jenkins Practical Beginners Course for DevOps | CI/CD Pipeline With Jenkins: • Jenkins Practical Beginners Course fo…
Note: “slave” word has been deprecated terminology since Jenkins 2, we should call it now “agent” only, from the next video tutorial onwards, instead of “Slave” we will refer it as an “agent”, during this video it was not considered.
► Disclaimer: This video is solely for educational purposes, use them with your own responsibility. This video might contain some minor mistakes so please take decisions based on your own research and findings. This video does not force anything on anyone, decisions are your own. Any credentials are shown in the video are temporary and already removed, don’t complain if those credentials do not work for you, please generate your own credentials for the test.
#jenkins #slave #config #aws #learnwithsandip
Content
0.32 -> hey everyone welcome to today's session
2.48 -> in today's session
3.52 -> we are going to learn about how to scale
5.2 -> jenkins that means
6.64 -> how to add additional working notes or
8.639 -> slave knows what you can you may call it
10.4 -> as you like and you can just run the
12.88 -> builds chops
13.92 -> instead of in masternode you can run the
15.599 -> filters in the slave node
17.359 -> that way you can scale jenkins now not
19.6 -> just that we'll be learning
20.88 -> also about how to automatically do that
23.519 -> first we will
24.32 -> do like manually and then we'll do
26.72 -> automatically using
27.84 -> aws easy to plugin now we'll be getting
30.88 -> started before that if you're not
32.32 -> subscribed the channel here do subscribe
33.76 -> the channel
34.559 -> i hope you have watched the last video
36.88 -> on jenkins practical beginner course
38.879 -> and i think that will produce it for
40.719 -> this tutorial if you didn't get a chance
42.719 -> to watch that video
44 -> do watch the video now the link will be
46.239 -> in the description
47.36 -> you can watch it and come back to the
48.64 -> session if you already seen it you're
50.32 -> good to go
51.44 -> now in the last session we have this
54.32 -> jenkins
55.039 -> up and running we run two project to to
57.52 -> see how it worked
58.719 -> now we are running the projects in a uh
61.6 -> ubuntu machine
62.719 -> and that is hosted on the ec2 but it's
64.879 -> the master node there's a main
66 -> installation
66.88 -> now instead of running all the jobs here
69.119 -> because if you run all the jobs and
70.88 -> this machine will get heavy isn't it and
73.04 -> will be like the longer
74.4 -> wait time the long the bigger problem is
76.64 -> right it may go out of memory and all
78.24 -> this kind of problem out there
79.68 -> how to solve that you can solve simply
81.84 -> that by adding the worker node or the
84 -> slave nodes
85.119 -> so how to do that i'll be going through
87.04 -> there are two ways to add it
88.56 -> uh one is that uh natively which will
91.759 -> show first and then by the aws plugin
95.04 -> now i will show you how to add jenkins
98.159 -> slave nodes natively it's like if you
101.04 -> have any kind of machine that
102.88 -> you can have anywhere in the cloud you
105.52 -> can simply bring that machine
107.6 -> as a jenkins worker node and add that
110.72 -> dinghy's worker node in the master node
112.159 -> okay
112.72 -> so we'll go through all step by step i
115.119 -> have already did an
116 -> article on it how to add that and i'll
118.64 -> be following the same step
119.84 -> and i'll be giving this article link to
121.52 -> the description section so that you can
123.36 -> also follow it okay
124.479 -> so let's do that now the first thing is
127.759 -> that
128.16 -> we need to start a machine of course so
129.759 -> we'll be starting with a simple ubuntu
131.52 -> instance
132.319 -> if you go to aws you will see a screen
134 -> like this now
135.44 -> i am creating this instant ec2 it might
137.92 -> be in
138.72 -> google cloud or azure the desktop accept
142.16 -> the creation of the instant the rest of
143.92 -> step will be same okay
145.28 -> so let's create it here go to ec2
149.2 -> and there we are going to launch an
151.36 -> instance so click on launch instance
156.959 -> and then let's select the ubuntu
160.16 -> okay it's like that and i think the
163.28 -> basic one will be good enough to getting
164.959 -> started
166.239 -> t2 now we will launch
169.68 -> and we need additional one more port for
172.4 -> 8080 remember that go down to security
174.56 -> part
175.12 -> security groups edit security group and
177.92 -> let's
178.319 -> create the security group newly added
180.959 -> rule
181.44 -> called port 8080
184.959 -> you can for advanced security we can
187.2 -> simply
188.159 -> uh like add that custom and then give
190.56 -> the security group name here
192.319 -> but for the simplicity we are going with
193.92 -> the anywhere okay
196.4 -> let's do it click on review and launch
199.28 -> and
200.08 -> just click on launch now we'll see the
202.879 -> option here select an existing key
204.64 -> player or
205.12 -> create a new key pair now if you don't
207.04 -> have any key pair you can just simply
208.56 -> click on create new
209.519 -> key pair and you will just enter the
211.68 -> name something
212.56 -> and download the keypair you can utilize
214.239 -> that key for logging into that ec2
216.56 -> uh the slave node because it will be
217.84 -> very much important to need that you
219.76 -> have to log into switch to install
221.68 -> something like java and other things
223.44 -> now if you already have any existing key
225.44 -> you can just simply use that one
226.799 -> i have existing key so i'll be using
228.319 -> that and launch the instance
230.48 -> so after the instance launch click on
232.48 -> the view instance let's say
234 -> here rename it jenkins
237.28 -> worker node okay
241.12 -> okay now we are going to
244.72 -> ssh into this particular newly created
247.28 -> ubuntu instance
248.239 -> okay just right click and click on the
250.799 -> connect
251.76 -> in there you will see the option example
253.599 -> how to do use the
254.959 -> ssh key that we have downloaded so
258.72 -> copy the example and we have like open
261.6 -> your
262.4 -> default ssh client now let's login
268.08 -> call yes now let's go one by one first
271.36 -> we'll be installing the java
273.12 -> again if you you know if you anytime you
275.28 -> feel that you need to
276.56 -> see how i mean you need to follow the
278.4 -> instructions the article link in the
280.16 -> description section
281.28 -> do follow the article as you like okay
283.759 -> first installing click on installing
285.28 -> linux
286.16 -> in that page you will find just go down
288.8 -> below
289.36 -> you will see the installation of java
291.44 -> instruction
292.479 -> simply first run sudo apd update
296.32 -> it will update the package list then
298.4 -> search for open jdk
300.24 -> now let's install the jdk 11
303.6 -> okay okay the java is now installed
306.479 -> let's check the java is running properly
308.08 -> or not
308.479 -> to do that we can simply run java
310.639 -> version
311.52 -> so let's do that you can see it here
314.24 -> java version it's showing properly
316.4 -> okay now let's go to the next step
319.84 -> now uh the next step just follow the
322.4 -> article
323.44 -> uh what i've said if you suppose you
325.12 -> didn't see the last video again you can
326.639 -> just
326.96 -> the last building also provided in the
328.639 -> article so you can go and watch it let's
330.88 -> start step by step first step is create
332.96 -> user along with the home directory
334.88 -> and the bash as default cell okay to do
338.16 -> that you have to run
339.039 -> sudo user at linux live uh now let's say
342.479 -> is the name
343.039 -> you can add any name if you want to
345.12 -> minus sorry dash
346.4 -> m that's s bin bash here we're seeing
349.12 -> the default bash
350 -> so let's do that copy and just run
354.639 -> now let's check the user created
356.72 -> properly or not
361.44 -> okay you can see the it's created
363.6 -> properly the step three
365.52 -> is to change the password of the newly
367.759 -> created user so let's do that
369.52 -> for that you have to run sudo password
372.8 -> linux live just run that is asking for
375.52 -> new password let's give a new password
377.28 -> okay
377.68 -> the password changed successfully now
379.6 -> the fourth step is to use the user mode
381.84 -> command to add the user as
383.36 -> in the pseudo group let's do that okay
386.24 -> it's added in the sudo group
388.24 -> now let's login as a linux slave user
391.68 -> okay now to do that run this command
394 -> let's do
397.28 -> okay now let's run pwt we are in the
400.72 -> proper directory and if you if we create
403.52 -> the certificate we'll
404.479 -> create this directory and say let's run
407.44 -> this one
408.16 -> so ssh key okay so the sixth step is to
410.56 -> generate the keys using this
412 -> kitchen command this private and public
414.24 -> keys will be created this took
415.759 -> this locations as mentioned so let's do
418.4 -> that
421.36 -> okay so the certificate created
424.4 -> let's go to dot ssh folder and let's see
428.96 -> okay so we have id uh rsa and id is that
432 -> pub is created
433.199 -> now you have to do one more change we
435.68 -> have to create one file
437.199 -> called authorized keys and there we have
440.08 -> to
440.479 -> store the public key let's do that so
444.56 -> see change the directory to research and
447.28 -> we have to make authorized key like this
449.68 -> so let's do that let's first see what is
453.12 -> our
453.84 -> public key
458.8 -> so this is our public key copy that
464.639 -> let's create
470.4 -> one file called this one
474.639 -> authorized keys okay but before that
478.319 -> don't forget to copy this one just run
481.84 -> it and save paste it
485.039 -> use it copied properly and just exit it
489.599 -> again just to verify you can simply run
491.36 -> cat authorize keys
493.52 -> and you will be able to do the exact
494.879 -> same thing okay just to verify it
496.96 -> properly or not exact same thing right
499.28 -> so let's play the screen
501.919 -> now make sure the jing okay provide
504.879 -> permission only to the owner that is a
506.4 -> young slave
507.36 -> ah to stop using these authorized keys
509.28 -> so let's change the permission level
510.639 -> properly
513.68 -> okay the permission is done now
517.599 -> let's okay so our worker node changes
520.959 -> are done
521.519 -> that's all you have to do nothing else
523.76 -> now we have to make changes in the
526.08 -> master node okay so do that let's go to
529.279 -> the ec2 again i'm running the
531.36 -> master node in the aws itself just as i
533.839 -> showed in the previous
534.72 -> video tutorial i'm using the same note
536.88 -> exact same thing
538.56 -> now to connect with this simply
542.399 -> click on connect and you will find the
544.56 -> connection here
546.24 -> the switch connect command you can run a
549.92 -> new
551.76 -> this thing and let's connect with this
554.88 -> master usb instance
559.519 -> so let's connect with the uh we have ssh
561.68 -> into the master
562.959 -> node now let's follow the article again
568 -> now first thing you have to do we have
570.64 -> to
571.04 -> uh make sure that the changes using the
573.279 -> master node
574.24 -> have the proper access and everything
575.839 -> okay it's created at least the user is
577.76 -> there or not that's very important to do
579.92 -> that we can run this simple command
582.64 -> okay let's run it okay just running the
585.68 -> command you can see
586.56 -> jenkins is there and everything is good
589.44 -> now
590.24 -> we have to make sure it's in the pseudo
592.56 -> group or not
593.279 -> so let's do that
596.399 -> just add it and let's just run group
599.6 -> jenkins
600.399 -> and you will find a command okay jenkins
602.24 -> in the pseudo group
603.6 -> now we're good now the jenkins user
606.72 -> default directory
608.32 -> in the master nodes is for liv jenkins
610.56 -> as a default shell in the
612.079 -> batch now let's login as a jinkins user
615.2 -> in the master instance and there we will
617.76 -> make some change
619.04 -> so let's run sudo su
622.64 -> dash then jenkins
626.399 -> okay so you might see it here pwd
629.519 -> and you will see we are in the default
631.92 -> jenkins
633.04 -> the var leaf jenkins directory now
636.88 -> we have to create a dot ssh directory
639.36 -> you can simply run this
641.04 -> and now you have the dot ssh directly
644.079 -> there
644.399 -> okay right now nothing is there okay now
646.88 -> we have created a
648.16 -> directory in the master node okay master
650.399 -> node jenkins default
651.68 -> uh directory link is user default
654 -> directory
654.88 -> now there we're gonna create one file
657.12 -> called known host okay
658.88 -> just so that it can it's a verified host
661.2 -> and the jenkins can easily connect to
663.279 -> the machine
663.92 -> that's how you're creating the uh the
666.56 -> this
666.959 -> known host file now let's copy this
670.48 -> command
671.519 -> the thing is ssh
676.48 -> key scan
679.839 -> that's h then
683.44 -> the pop you can skip private public i
685.68 -> will say for better production better
687.44 -> security
688.72 -> give the private ip so let's go with the
690.64 -> private ip
692.16 -> go to instances and this is the jinkins
693.839 -> worker node if you go to
695.6 -> here and you can see the private ip here
698.399 -> copy that now what's next
704.16 -> run that and you can see just to ls
707.6 -> cat known host and you'll see all that
710.959 -> you know public keys are added in this
712.48 -> file okay now simply now let's
715.04 -> make sure that this file's owner is
716.8 -> jenkins user in the master
718.48 -> node and it has all the access that
720.48 -> required okay only to
721.839 -> that particular jenkins user now let's
725.279 -> do that
726 -> simply simply just making make that
728.56 -> files owner to jenkins
730.32 -> that's what i'm doing here just copy and
732.8 -> just run the command
734.72 -> okay now it become and again change the
738.079 -> mode of that file that is the permission
740.72 -> level of the
741.36 -> file only to jenkins so jenkins user
744.48 -> can read write and execute this file
746.959 -> make sure to do that okay
748.399 -> copy and just run it
751.519 -> now just to make sure you can run ls
753.2 -> command ls minus
754.639 -> so we have run the ls minus l command to
757.279 -> make sure
758.16 -> what is the just just you're confirming
759.839 -> that what is access you can see known
761.36 -> host
762 -> access only to the jenkins user read
764.8 -> right executable access okay
766.24 -> make sure you do that now we have it all
768.8 -> the details and everything
770.959 -> now we have to add the credential we
773.92 -> have created in the worker node earlier
776.8 -> in this one to the master instance okay
779.76 -> so master nodes okay
780.88 -> configuration now how to do that do ls
784.16 -> and you'll see three file there id i say
786.56 -> there's a
787.2 -> private file id recep dot pop that's
790.56 -> a public file that we have automatically
792.72 -> getting added in the
794 -> machine and the authorized keys which is
796.24 -> authorized to be publicly accessible
798.399 -> okay
799.12 -> that we have all did now you have to add
801.68 -> that id rsvp file
803.279 -> in the jenkins master node so that
806 -> jinkies must node
807.519 -> can connect with the worker node or
809.519 -> slave node okay
810.72 -> so let's add the id rsa so
814.72 -> and do that we'll find the key here just
817.839 -> copy that
820.959 -> copy and
827.44 -> just then nick who am i
833.76 -> okay the next name just to make sure you
835.44 -> remember the username
836.8 -> and the secret key now come back to the
839.199 -> jenkins
840.16 -> click on manage jenkins manage nodes and
842.88 -> the clouds click on that
844.639 -> you can see this new node option click
846.32 -> on the new node let's call it
848.48 -> linux live okay and it's a permanent
851.279 -> agent so
852.32 -> mark is a permanent agent click on ok
855.44 -> in the description you can just give it
857.36 -> linux
859.279 -> slav okay uh number executed as much as
863.12 -> you want at the root directory
864.8 -> you can again run here pwt present
866.72 -> working directory
867.839 -> is this one okay copy that
871.36 -> and paste it here the levels levels are
874.16 -> like
874.48 -> the expression or you can just target
876.32 -> using the levels so you can target a
878.32 -> build and say
879.68 -> this bill should run on this particular
882 -> agents or agent
883.6 -> using level you can target that
886.079 -> particular wheel to run on this
887.279 -> particular region so levels are
888.72 -> important in that case
890.079 -> let's mark it as a linux uh let's say
892.48 -> the linux
893.44 -> level so that when you start the build
896.24 -> we just add
896.959 -> the expiration matches be linear so that
898.8 -> that particular build will run in this
900.72 -> particular news newsletter instance
902.56 -> we'll do that okay
904.399 -> now the launch method gonna be the
906.8 -> launch via
907.68 -> ssh okay now host part again you can
910.88 -> just simply come here
912.32 -> and copy the private ip since you have
914.56 -> added private ip in the known host
916.399 -> that's why so let's do that and come
919.519 -> here
921.12 -> in the credentials let's add the
922.72 -> credential so click on dinkins
925.44 -> and it will be the username with the
927.6 -> private key
929.04 -> and in the description section you don't
931.6 -> have to give anything the username
933.12 -> importantly give the username of the
936.48 -> slave machine that you have created
938.72 -> and in the private key add it
942.32 -> simply again if you don't know just do
944.639 -> ls
945.759 -> make sure that id ilc file is there
949.04 -> and just get it now
952.88 -> we have it here copy the file content
957.04 -> and paste it here that's it
960.24 -> go down add it and that's it in the down
964.079 -> we'll see that linux live
967.199 -> and i think you're all good now okay see
970.24 -> the known host file verification
971.759 -> strategy is already there you can
972.959 -> utilize the same thing
974.72 -> okay now let's click on the save you see
977.44 -> that's
978.079 -> like this but wait for a few second it
979.6 -> will start working now let's
981.6 -> left linux live notes is now ready let's
984.639 -> try to run a sample project but before
986.48 -> that i want to show you how the logs
988.48 -> okay so click on this next clip node and
990.8 -> if you click on the logs
992.079 -> you will see all the installation of the
994.16 -> things and the logs you'll find it or
995.759 -> everything here okay
996.88 -> so if you see any problem happening you
998.32 -> can always come to this uh particular
1000.24 -> log and check it
1001.12 -> let's go back now let's
1004.32 -> now go back to the node list now we have
1006.639 -> master node we have slab node now we'll
1008.32 -> what we'll do is we
1009.36 -> will run one project in a slave node let
1012.24 -> me show you how
1013.04 -> you can do that so go back to dashboard
1015.92 -> there
1016.48 -> click on new item and let's call it
1020.48 -> uh slave node demo okay note
1026.16 -> demo now select as a freestyle project
1029.76 -> click on ok in description call it
1034.16 -> a demo to test
1037.28 -> slave node just for example and go all
1040.799 -> back to down
1041.839 -> in a build select execute shell
1045.76 -> and we'll call it eco
1049.76 -> running success
1053.2 -> fully that's all we will do just simply
1055.2 -> run and check
1056.24 -> and save it okay we'll come to the
1059.84 -> project demo and in the left side you
1062.08 -> will see an option called build now
1063.679 -> click on you can see build schedule and
1067.039 -> the build will come here
1068.24 -> in the build history it came and you can
1070.24 -> see success also
1071.44 -> if you come the build number just like i
1073.2 -> did and you can click on console output
1076 -> you will see running successfully and
1078.24 -> you can see here
1079.679 -> the another slab now it's because the
1082.08 -> slave node is available
1083.28 -> how can we make sure that it's always
1085.039 -> run on slip node let me show you that
1087.2 -> so go back to the project
1090.24 -> and uh in the config this is optional
1092.96 -> configure click on that
1094.96 -> so now i will show how you can
1096.72 -> forcefully run on the always on the
1098.24 -> slave node
1098.96 -> so if you come to this project details
1101.12 -> uh you will see general tab
1102.4 -> and there is this option called restrict
1104.559 -> where this pre can be run
1106 -> click on that and you will see the
1107.52 -> option level expression simply press the
1109.52 -> level you have set
1110.48 -> in the slapped note and that exact level
1114.16 -> you just entered here
1115.52 -> and just simply go down and save it
1119.44 -> and if you click on the build now you'll
1122.48 -> see another build here
1124.88 -> built to and it it's it will always run
1128.08 -> on the slave round okay that's how you
1130.16 -> can set it up if you go to console note
1132 -> you can see
1132.64 -> we'll remove you on the linux live and
1134.88 -> in workspace and that's all that i mean
1136.88 -> it's running successfully
1137.919 -> so that's how you can like if it's
1139.44 -> available you cannot automatically go to
1141.28 -> the wireless available
1142.88 -> and uh to know to offload uh its task
1145.919 -> and if some if you mention that using
1148.559 -> the x
1149.2 -> labels then it will always run on the
1151.44 -> target so let know that you are
1152.72 -> specified
1153.36 -> make sure to understand okay now that i
1156.32 -> have shown you
1157.12 -> how to add a slave node manually let me
1160.16 -> show you how to do that automatically
1162.32 -> like for example here we'll be using aws
1165.44 -> uh cloud
1166.24 -> where we'll be increasing the number of
1168.48 -> instances as the
1169.6 -> number of billion to run or as per the
1171.919 -> load you can run it okay
1174.08 -> that's like you don't have to manually
1175.6 -> everything do all these lift and shifts
1177.44 -> nothing
1178.08 -> just install a plugin and configure it
1180.88 -> properly and that's
1181.679 -> it that's all you have to do so let's do
1183.679 -> that we'll do that one by one
1185.52 -> very stable step so even if you don't
1187.76 -> know about the aws
1188.88 -> it'll be very easy it will be still very
1190.88 -> easy so you can follow up
1192.32 -> so let's do that but to do that let's
1194.96 -> first
1195.36 -> install our aws plugin so click on
1197.76 -> manage in games
1199.12 -> then manage plugins in the
1202.32 -> available tab search for aws
1207.12 -> you'll find easy to click on that
1210.159 -> and you'll see option install without
1212.32 -> restart do that
1216.08 -> it will wait for few seconds
1221.84 -> okay so the plugin is installed now
1225.52 -> let's go back to the dashboard and
1228.4 -> managing gains
1229.919 -> then you'll see the option called manage
1231.28 -> nodes and clouds click on that
1233.44 -> you can see the option configure cloud
1235.36 -> so click on configure clouds
1238.72 -> you will see the option called add a new
1240.4 -> cloud there is three options
1242.32 -> amazon ec2 or whatever other plugins you
1244.88 -> i mean plugins you have
1246 -> let's select on the easy two and
1249.84 -> wait for that okay it came now in the
1252.559 -> name section
1253.84 -> we should give it you can give any name
1255.919 -> so we are giving aws okay
1258.32 -> and easy to credential for that you can
1260.64 -> create im user
1262.32 -> and uh add that details let's say
1265.36 -> and select here uh the aws credentials
1269.28 -> where you typically have the access key
1271.76 -> id and the secret key
1273.44 -> but that's not secure to be honest the
1276.4 -> more secure way
1277.6 -> is to use roles let me show you how to
1280.32 -> use roles
1282 -> go to aws so if you log into aws
1286.08 -> you will see a screen similar to this
1288.72 -> search for the im
1290.48 -> so im guessing
1293.84 -> i need indie identity and access
1295.84 -> management
1296.88 -> there you will see a option called close
1299.52 -> click on that
1301.6 -> you have to click on the create role
1304.88 -> and there is a common use case is easy
1307.6 -> to
1308 -> click on the ecd because we are going to
1309.44 -> add this role to easy resistance
1311.28 -> that's why we have to select ecd click
1313.76 -> on that
1314.559 -> see next permissions and let it load
1319.84 -> loaded you need to give easy to access
1322.64 -> okay
1323.2 -> so search for easy to you will get
1325.84 -> option ec to full access you need to
1327.44 -> give that
1328.64 -> now next tags and review
1332.159 -> let's call it jenkins
1336.4 -> access for ec2
1340 -> okay jenkins accessory c2 let's create
1342.559 -> the role
1346.4 -> now let's go to the ec2
1352.88 -> and select the master node
1356.559 -> this is the master node just right click
1358.4 -> on it in the security
1360.48 -> then the modifying rules click on that
1363.039 -> and look for
1364.08 -> jenkins okay jenkins
1369.919 -> you can see jenkins access for ec2
1373.12 -> so let's select that and save it
1378.32 -> done now let's go back to dashboard
1381.2 -> again
1382.24 -> and we can see here this instant should
1385.76 -> have the
1387.44 -> am role attached okay
1390.72 -> you can see it here i am roll it
1392.88 -> actually jenkins easy to
1394.32 -> you can cross check it make sure that it
1397.28 -> has the easy to full access okay
1399.36 -> it has it now come back to the configure
1403.28 -> cloud there you need to take this one
1406.48 -> use ec2 instance profile to obtain
1408.32 -> credential that's what you needed
1410.64 -> and alternate receipt you don't need to
1412.24 -> give any the region the default region
1414.64 -> we are utilizing here is
1416.32 -> usb s2 i'll be selecting that one but
1418.96 -> for your case it might be different and
1420.72 -> it's okay to have his different
1422.08 -> select accordingly so us question
1427.2 -> now come to the easy to keep here that
1429.2 -> will be utilizing here
1430.72 -> so again go back to easy to go
1433.84 -> very left and then go down is optional
1436.48 -> key pairs
1437.679 -> so let's create a key pair let's call it
1440.88 -> e jenkins
1444.24 -> ec2 key pair okay
1447.919 -> and spam file because for use with open
1450.48 -> ssh
1451.44 -> let's create the key pair and save it
1456.48 -> we need the file here so open that file
1459.52 -> and uh just let's copy that file here
1463.52 -> so we can just get the content of this
1464.96 -> file we can utilize it
1466.96 -> copy and come back
1470.08 -> here see in the it's saying work easy to
1472.32 -> keep your private key
1474.08 -> giving these options so we will add it
1480.4 -> in this kind select ssh username with
1484 -> private key
1486.4 -> and in the description give easy
1490.24 -> to user now username is very important
1493.52 -> here
1494.159 -> if you are using ubuntu that will be
1495.679 -> ubuntu uh
1497.2 -> based on aws uh instance login names
1500.64 -> you should be using that one and uh make
1503.52 -> sure you enter the proper one so
1505.279 -> for us i will be using utilizing amazon
1508 -> linux easy to do
1509.12 -> so that's why it will be easy to
1512.88 -> user okay and the passphrase
1517.36 -> just in the enter the key and click on
1519.919 -> the add
1520.72 -> and the paste the id here okay that we
1523.279 -> have generated from the console
1525.12 -> this this screen now come here and add
1528.32 -> it
1530.4 -> if you go down you'll see the option ect
1533.12 -> user
1534.96 -> and this option called test connection
1537.52 -> click on it
1538.96 -> and it success all working okay now
1542.159 -> let's add the amis so click on that
1547.6 -> now so the ami part description give it
1550.4 -> easy to
1551.84 -> uh automatically aws linux
1555.36 -> amis okay just for the reference now go
1558.08 -> back to ec2 again
1560.72 -> i'll show you how to select the ami id
1563.679 -> and then
1565.279 -> launch instance see
1568.48 -> here once you come here you will see the
1570.799 -> emi id
1571.52 -> here and copy the ami id see amazon
1575.039 -> linux easy to simply copy this id
1578.32 -> that's all you have to do amaid
1582.64 -> you don't need to give any owner we'll
1584.64 -> be going with the t2 small
1587.679 -> it's okay just for the demo right
1589.6 -> average zone you don't have to give
1590.72 -> anything
1591.679 -> uh remote fs root uh here
1595.2 -> uh you can give user
1599.279 -> say home ec to
1604.159 -> user okay
1608.64 -> the remote user will be ec2
1612 -> user i think okay
1615.679 -> just again just if you are not sure you
1617.76 -> can always come
1620.4 -> and you can see default
1624.559 -> uh username
1628.48 -> for aws linux
1633.6 -> yes this one next to ami
1643.679 -> you can by default user the ami uh that
1646.32 -> is easy to user
1647.919 -> just click on that this url
1651.919 -> and you will find the connection
1653.2 -> requisite here
1655.2 -> you'll see all the information
1662.72 -> so it's easy to user okay
1667.6 -> so linux 2 is easy to use make sure that
1670 -> you use proper one see
1671.76 -> for centos essentials for debian is
1673.919 -> admin for fedora it's easy to user
1676.48 -> for suse and ubuntu for example so you
1679.44 -> make sure
1680.48 -> that you select properly so for us it's
1683.2 -> easy to user
1684.159 -> we're simply going with that and
1687.2 -> we are good now
1690.24 -> in the amite ami type use the unix
1693.679 -> and for the remote ssh it's 22
1697.279 -> okay and in the levels let's call it
1700.72 -> aws
1706.08 -> okay i think we are all good here
1710.32 -> but there is one more thing you have to
1712.24 -> add click on the advanced
1716.96 -> and let's find the security group
1720.96 -> okay this is the one security group make
1723.52 -> sure to enter the security group very
1725.2 -> well
1725.6 -> otherwise you might see issues so again
1727.36 -> go back and go to aws
1732.24 -> there click on ec2 and in the very left
1736 -> side
1736.399 -> you will see security groups let's click
1738.88 -> on that
1739.76 -> and let's click on the create security
1741.2 -> group let's call it
1743.039 -> my jenkins
1747.12 -> cloud security okay
1750.799 -> security group you can say now
1753.919 -> and copy the same thing here created
1758.08 -> you can add more data if you want to
1759.76 -> it's up to you
1762.799 -> make sure the vpc is default vpc or
1764.64 -> whatever views your particular targeting
1766.88 -> inbound rule uh we want port we need to
1770.08 -> be it we need to be
1771.44 -> allowed for all if you want you can make
1774.08 -> it more secure by
1775.279 -> uh particularly custom the target with
1777.36 -> with custom targeting
1779.12 -> with the the security group of the
1781.919 -> master
1782.64 -> master node you can do that or the ip of
1785.6 -> the master node
1787.12 -> for our use case just for this java part
1789.84 -> we are going with anywhere
1791.679 -> you need one more port to be open this
1793.919 -> port 8080
1795.44 -> and again i'm opening for everyone but
1798.32 -> again if you want to have more security
1799.6 -> you can just drag it to particular that
1801.279 -> security group of the
1802.399 -> mass node and you are good here
1805.76 -> okay and then in the outbound make sure
1808.559 -> all traffic
1810.24 -> is alarmed anywhere okay
1814 -> now i think all good here we just copy
1817.679 -> the
1818.159 -> name because we'll be utilizing that
1820.559 -> let's create the security group
1823.919 -> obviously exist so go back and say
1827.44 -> look uh my jenkins secretary of new
1830.64 -> because i maybe have it for the last
1832.399 -> demo so we just go with the new
1834.32 -> and just make sure it's all is there and
1837.279 -> create the security group
1839.52 -> and all security groups and rules
1840.88 -> created now copy that
1842.96 -> come in this screen and here enter the
1846.88 -> the the group name here okay and you're
1849.52 -> all set
1851.36 -> let's save it
1855.6 -> okay now if you come to the
1859.6 -> manage nodes and clouds you'll see right
1862 -> now that last then the last one we have
1863.919 -> added manually that is there
1865.44 -> and there is configure cloud and you can
1867.76 -> always come and change the options here
1869.679 -> as you want okay it's up to you now
1872.96 -> let's try to run something and see how
1875.279 -> that works
1876.64 -> so let's go to the uh build projects and
1879.679 -> there we have done the slave node demo
1882.32 -> now let's target this
1883.84 -> to run particular one wheel in the
1887.12 -> uh in the particular aws cloud not in
1890.32 -> the
1890.72 -> the one that manually added but it
1892.399 -> should be all automatic
1893.76 -> so let's do that so go
1896.88 -> click on the configure and you can see
1899.039 -> it here
1900.48 -> the rest required to be done let's click
1902.64 -> on enter aws
1904.32 -> you can see level aws matches no notes
1907.84 -> only one cloud because right now no
1910 -> notes is running on
1911.2 -> and it's the cloud only we're
1912.48 -> referencing and it will create the node
1914.08 -> automatically when you run it
1915.44 -> so save it and click on the bill now
1922.72 -> see the pending all nodes are labeled it
1926 -> is offline
1926.799 -> so if you come here in aws ec2 console
1930.24 -> and go to ec2 instances
1936.24 -> and maybe just could easy to dashboard
1938.24 -> and see the running one only
1940.08 -> just to refresh and see
1943.2 -> within few seconds a new node will get a
1945.84 -> new instance will running let's go
1948.96 -> and dashboard
1953.679 -> and then go to the managing gains
1958.08 -> and the manage nodes and this
1961.12 -> you'll see the new ones linux emis
1964.159 -> is launching state so it will be soon be
1967.039 -> coming here
1967.919 -> just to make sure and there it is
1971.2 -> you can see it's automatically created
1972.559 -> too small that we have mentioned
1974.64 -> and it's like in here i sing when it's
1977.12 -> up you'll be able to see it here
1979.44 -> if you want to see the logs and
1980.72 -> everything you can
1982.559 -> come here for the logs
1985.84 -> okay okay yeah
1988.88 -> we think we forget to one important
1991.279 -> thing
1992 -> okay i know what is gone wrong so we can
1994.24 -> just simply
1995.12 -> come to that uh managing gains
1998.48 -> and then the manage nodes
2001.6 -> and then the cloud configure cloud there
2005.039 -> we need to give there one more important
2007.519 -> thing click on advanced
2009.12 -> go down and there is an option
2012.799 -> called this one accept new so it will be
2016 -> automatically accept new ones
2018 -> because we cannot manually add it every
2019.6 -> time right so save it
2022.559 -> and then let's come back to jenkins
2026.72 -> and then manage nodes and clouds we can
2030.84 -> simply relaunch the agent
2034.159 -> let's see now it's connecting
2037.36 -> it's connected and everything getting
2038.799 -> installed and all so you have to make
2040.48 -> sure that you
2041.2 -> uh enter the of that properly otherwise
2043.919 -> you will see issues okay
2046.159 -> i think all are good okay looks like
2048.72 -> it's working
2050.079 -> and if you go back and our project slave
2053.04 -> node demo
2054.24 -> and you can see the build 3 it run
2057.359 -> perfectly fine if you can see this
2058.72 -> console output
2060.639 -> yes running fine here so it worked so
2063.359 -> you can see
2064.24 -> the the newly created ec2 is now working
2067.839 -> fine
2068.399 -> and if you go to the dashboard and then
2070.96 -> the project vs we have run
2073.359 -> there and you can see the build three
2075.28 -> working fine again if you want to
2077.2 -> run just you know configure make some
2079.52 -> changes
2080.56 -> and let's say that's actually v2 just to
2083.28 -> make changes working or not
2085.2 -> and let's build now
2088.56 -> you can see here it will be on pending
2090.8 -> say build 4 and it's already run
2092.48 -> success so if you can just go to console
2094.8 -> output
2095.76 -> and you can see it run on amazon ec2
2098.8 -> here aws flag aws level is there
2102.079 -> and was running successfully so that's
2104.56 -> how we
2105.119 -> able to configure the uh you know you
2107.76 -> have
2108.32 -> infinite scalability ultimately you can
2110.64 -> run as many as worker node
2112.32 -> if you want prop uh if you want so guys
2115.28 -> if you like this video
2116.64 -> do make sure to subscribe the channel
2118.96 -> and click on the bell icon
2120.8 -> and share this video with others as well
2123.119 -> this knowledge is very required if you
2124.72 -> want to work as a devops engineer or in
2126.64 -> jenkins projects
2127.68 -> so make sure to practice this very
2129.2 -> properly i know
2130.72 -> i forgot to tell you that i have started
2133.04 -> the
2133.92 -> membership program simply go to the
2135.76 -> click on the join option you will see
2137.04 -> all the options here
2138.24 -> and you can choose according to whatever
2139.839 -> you want okay thank you thank you very