0:03 [Music]
0:06 hi everyone Welcome to Cloud Sprint in
0:07 this video we are going to start the
0:09 series on compute options
0:12 gcp compute is driven better for cloud
0:14 Engineers so it really makes sense to
0:17 understand compute in detail because
0:19 while working on TCB Cloud you'll be
0:21 working on managing compute scaling
0:24 descaling most of the time will be
0:25 you'll be spending with compute engine
0:27 from the exam perspective also this is
0:29 really important topic this video we
0:32 will understand that what is gcp compute
0:34 how to use it what options we have of
0:37 compute major Focus will be on compute
0:39 engine let's go ahead and check it out
0:42 first we need to understand what is how
0:44 many gcp compute offerings we have the
0:46 first one is compute engine which is
0:48 General virtual machines which you also
0:51 use on your on-premises so it is okay
0:54 you can you can rent some VMS over gcp
0:57 by just few clicks second is GK which is
1:01 managed Google kubernetes engine you can
1:02 just provision a gke cluster in few
1:05 clicks third option is app engine where
1:07 you get the managed platform which is
1:09 platform as a service which you get the
1:10 manage platform where you can run your
1:13 code directly you can deploy new
1:15 versions you can scale these scale shift
1:17 traffic you don't have to manage the
1:19 platform basically you just do the
1:22 deployment rate fourth one is cloud run
1:24 with Cloud run is more like running your
1:26 containers uh on the platform provided
1:28 by Google you just have to deploy a
1:30 container and it will find out the
1:32 resources to run
1:34 fifth is cloud function which is mainly
1:37 used for event based uh architecture on
1:39 when you need compute for some specific
1:41 minute on demand kind of architecture
1:43 Cloud function is used for so these five
1:45 options we have the more left side
1:47 options you choose you'll have more control
1:48 control
1:51 the more right side you go it will be
1:54 managed in the backbone gcp compute
1:57 engine will run but for us it becomes
2:00 managed service if you want control over
2:03 your infrastructure like what kind of
2:05 vmc you want to give how much memory you
2:07 want to allocate how much CPU you want
2:09 to allocate you should go ahead with
2:11 compute engine because that's where you
2:14 get the most control in GK also you can
2:15 control how many type of nodes you want
2:18 to give what will be your child nodes
2:21 how you want to run them what are the
2:22 things you want to install you can
2:24 definitely control that coming to app
2:27 engine again it's a platform Cloud run
2:29 is a platform Cloud function is mostly a
2:30 platform so you don't control what you
2:32 want to install but you can just deploy
2:34 and leverage the benefit you cannot
2:36 control the environment but in these two
2:38 cases you can control the environment
2:40 that's the difference this video is all
2:43 about compute engine I'll be covering
2:46 all these five compute options because
2:48 all these five topics are really
2:50 important for the exam and I'll be
2:51 covering all the topics required for the
2:53 exam while covering it I'll also be
2:56 covering that when to choose what in
2:58 which situation you will be going ahead
2:59 with compute in which situation you'll
3:01 be going ahead with app engine going to
3:04 use cloud function this is what our
3:06 Cloud engineer's job is mainly to find
3:08 the right candidate for the nature of
3:10 the workload if you want to run a
3:12 container a simple container you may go
3:14 ahead with Cloud run you want to manage
3:17 all the resources allocated with that
3:19 and you also want to orchestrate those
3:21 uh those containers you might not go
3:22 ahead with GK I'll be covering these
3:25 kind of examples use cases so you get to
3:28 know it so today let's focus on compute
3:30 engine Google compute engine GCE is an
3:32 infrastructure as a service offering
3:34 that allows clients to run workload on
3:36 Google's physical infrastructure Google
3:38 is already running Google search engine
3:41 Gmail YouTube and other services using GCE
3:42 GCE
3:45 it enables users to launch virtual
3:47 machines on demand depending on your
3:50 need how much memory how much CPU you
3:52 can just allocate create it on demand
3:54 and use it for your daily this is an
3:56 option which allows you to run something
3:59 on Google's physical infrastructure
4:02 directly sitting at your desktop and you
4:05 will be paying for the uh time you are
4:07 running it if you're running it for one
4:09 hour you pay for one hour if you run it
4:11 for 24 hour you pay for 24 hours Google
4:14 also offers some generous discounts if
4:16 you are using it on a regular basis the
4:18 first and foremost thing after starting
4:20 compute engine is to understand what is
4:22 the reason Amazons all the blue one you
4:25 see are reasons and there are data
4:26 centers within those regions are called
4:29 zones okay the blue ones are have three
4:33 plus three plus uh data centers which is
4:34 called zones
4:36 so you while designing your application
4:39 you just need to ensure that you are
4:41 provisioning resources within your uh
4:43 region rather than anything else for
4:45 example if you have customers from Delhi
4:48 and you provision your VMS in Toronto
4:51 you will have a link okay you'll have
4:53 latency your user experience will vanish
4:56 so it always makes sense to while
4:58 provisioning your infrastructure always
5:00 be much more closer to your customers
5:02 for better experience a general thinking
5:04 is to go ahead with the cheapest option
5:07 okay but that's not always how it works
5:08 because if you choose the cheapest
5:10 option suppose U.S Central one is the
5:12 cheapest option for now and your
5:15 customers are in Tokyo Julie paying much
5:18 more on network throughput for a very
5:21 bad experience customer experience so as
5:22 a cloud engineer it's your job is to
5:25 find the best optimal solution which
5:28 serves the cost latency and better user
5:30 experience so while designing the system
5:32 you make sure most of your clients are
5:34 from which location and you provision
5:36 your resources in those locations so
5:39 they don't face the latency so if your
5:41 customers are from India and you
5:43 provision your servers in U.S for the
5:45 cheaper option you'll be paying more for
5:46 Network traffic
5:48 it definitely makes sense to provision
5:51 your infrastructure in India if you have
5:53 from both the reasons you should have
5:56 your resources in both the reasons and
5:57 then you can balance using a load
6:00 balancer balance the traffic a law
6:03 okay so this map really helps you to
6:05 understand which is the nearest location
6:08 and how to choose it let's understand
6:10 the options we have in this example Asia
6:14 is1 is one of the reason okay and it has
6:17 three zones so you can have one cluster
6:19 in each Zone and then serve your
6:21 customers very well so a better customer
6:24 experience across Asia that's how you
6:26 can control your reason and Zone
6:29 customers and if even a Zone goes out
6:30 you can serve your customer from
6:32 different zones that is how it is
6:35 segregated to simplify it for you the
6:37 reasons are collection of zones zones
6:39 have high bandwidth low latency Network
6:41 and other zones in the same reason
6:43 in order to deploy fault tolerant
6:45 application High ability Google
6:48 recommends deployment applications
6:49 across multiple Zone and multiple
6:52 reasons a zone is deployment area within
6:54 that region which can also be known as
6:56 the data center it's a fully qualified
7:00 name such as U.S Central 1A
7:02 so the reason is use Central One your
7:05 central one A1 b1c is your zones okay
7:07 let's go ahead and understand how to use
7:10 compute any compute is created inside a
7:13 gcp project so in this case I want to
7:14 create compute inside inside data
7:17 science Dev
7:19 I'll click on compute engine
7:22 once you click on compute engine
7:24 you will see it's asking you to enable
7:27 the API because by default this API is
7:29 not enabled what will happen once you
7:30 click on enable
7:34 let me show you that if you come to vbc
7:38 you'll see there is no VPC Network okay
7:41 when you come to IM there is no compute
7:44 service account okay system managed so
7:48 once you click on a enable API in the
7:49 background what it is doing it is
7:53 creating a VPC it is creating a subnet
7:56 in all the reasons so I can easily go
7:59 ahead and create a compute it is also
8:00 creating service account providing
8:02 permission so basically in a nutshell it
8:06 is doing everything needed for me to use
8:08 compute engine API and always remember
8:10 very important point the first thing you
8:13 need to do for using compute engine is
8:16 enable API anything comes later so just
8:19 the first step to do it so we have
8:21 clicked on enabled let's see what it does
8:28 perfect so it enabled the
8:30 compute engine
8:33 API now let's go ahead and check these
8:34 two locations which I just asked you to
8:37 verify you can see it has created a
8:40 default service account a random name
8:42 number compute and
8:45 service account okay compute engine
8:48 default service account rule is editor
8:50 then it also created a Google service
8:52 API service agent and a role is given editor
8:54 editor
8:56 while working with production of course
8:58 we don't use these service accounts we
9:00 will cover that later but for learning
9:02 purpose these are good to go
9:05 now let's go ahead and check at the
9:08 network label what all it has done for
9:11 me over the network okay now you can see
9:13 there's a network called default Network
9:16 okay insert this default Network it has
9:19 created it all subnets for me okay and
9:21 in all the reasons that's how create
9:23 while learning you can create all the
9:25 compute I don't face any problem that's
9:28 how it's called enabling the uh compute
9:30 engine API let's go ahead and try to
9:33 create a VM this is how uh UI looks like
9:36 you can just again uh choose what you
9:37 want to see what you don't want to see
9:41 you can remove it from here okay okay
9:48 you can create instance from here you
9:50 can start stop delete
9:53 you can check metrics from here you can
9:55 show info panel if you want to see some
9:57 more information
10:00 now let's try to create instance for
10:03 creating an instance for a VM I need to
10:06 create click on create instance
10:09 once you open it you will be asked that
10:10 what you want to do you want to create a
10:13 VM you want to create it from template
10:15 or machine image or directly from Marketplace
10:16 Marketplace
10:18 we already have covered Marketplace in
10:21 one of the video you can use this also
10:24 for now I'm just interested in UVM so
10:26 the first thing it is asking me to
10:29 provide a name name I'll say
10:33 close print Dash VM okay now I have to
10:35 choose the most important thing which is
10:38 reason and Zone okay always remember
10:40 these things are permanent you're not
10:41 gonna change once you create in this region
10:42 region
10:45 now suppose my customers are mostly in
10:49 Asia okay and I want them to be served
10:51 from Delhi now this reason has three
10:55 zone so I'll choose that okay this Zone
10:56 this particular Zone I want to use
10:59 because this I feel it's the nearest
11:02 okay that's how you choose your reason
11:04 and job
11:06 once you choose your reason and Zone the
11:08 second important decision you have to
11:10 make is choosing the machine configuration
11:11 configuration
11:13 you want to use it for general purpose
11:15 you want it for compute optimized memory
11:18 optimized or the gpus
11:21 we'll go ahead and create this
11:23 N1 standard one which is probably the
11:25 lowest one The Chosen One standard one
11:27 okay once you have made decision on
11:29 reason soon
11:32 your machine type
11:36 okay you confidentially you know I don't
11:38 want to deploy any container for now
11:40 boot disk is good
11:43 okay which image you want to use this is
11:46 the third thing you need to ensure
11:48 all options you have you can choose from
11:50 Debian Centos
11:53 okay if you want to use Windows you can
11:56 choose Windows over here okay
11:59 that's that's the thing which you need
12:00 to choose but for now we will just go
12:02 ahead with Debian and we'll say that
12:04 okay the
12:07 version 10 is good for us any boot disk
12:11 yes I want to take the boot disk select
12:14 now the fourth part is once you've done
12:17 with the image and the boot disk now
12:19 you're choosing the operating system the
12:20 fourth decision you need to make is
12:23 identity and API access you remember I
12:26 shown you in the iron that it has
12:29 created once you initialize the API it
12:31 has created one default service account
12:35 so this is the one service account
12:37 by default it is using if you don't
12:39 change it it will be using by default
12:42 one okay for now we're just going to
12:45 keep it allow default access or firewall
12:48 rule Advance option let's check you can
12:51 also change the network tags network but
12:53 I'm not changing anything I'm just
12:55 keeping it default which is default default
13:01 talking about disk I'm not adding any
13:04 this I'm not changing anything in the
13:05 management also I'm not giving any
13:10 startup script okay so uh after these
13:12 four decisions I will review that how
13:13 much money I am shelling out with this
13:16 so uh for for this particular
13:20 configuration I need to pay 30 dollar
13:23 per month so this is a monthly estimate
13:25 so for this particular VM I have to pay
13:27 30 dollars per month
13:31 running 24 7. it will also give me a
13:34 generous discount of 12 dollars
13:36 once I'm done with all these steps I'll
13:41 once you click on create it will start
13:45 creating the VM and within a few minutes
13:56 yes the VM is available okay the name
13:58 which you have given is cloud Sprint dot
14:05 the creation date is here machine type
14:08 and if you want to see something more
14:10 uh if you want me to remove something
14:12 you can do that here also okay Network
14:15 tags and all okay that's that's how your
14:17 VM is created but uh
14:19 there are many ways to correct it I can
14:23 directly click on SSH or I can do it via
14:25 out shell session or I can connect it
14:28 via downloading the credential or
14:30 authenticating myself for now let's
14:33 click directly on SSH and try to log in
14:36 once you click on this VM it will be
14:39 transfer your SSH keys to the VM which
14:40 will enable this session for you and you
14:43 can directly login through IAP now it is
14:45 asking my permission to enable iaptcp
14:48 connection I'll say Okay authorize now
14:50 it will ask me for details like my
14:52 username and password to ensure that I
14:57 am the one who is trying to uh you know
14:58 I'll click on next
15:00 next
15:03 okay e-cloud data see the email address
15:05 okay I'll allow that as well and click
15:07 on continue yeah
15:08 yeah
15:13 perfect so here is my VM once I close it
15:16 again click on SSH this time it should
15:20 be pretty straightforward because it has
15:22 it already have my connection
15:28 yes
15:30 that's how you create a VM you can just
15:32 go ahead and check your
15:36 your operating system okay the name of
15:38 it that's how you create a way if you
15:40 want to see that what it it did when you
15:42 when you click the SSH for that you need
15:45 to click here and uh
15:47 just come down you can see all the
15:49 properties here okay you can also go
15:51 ahead and see that
15:53 what is the post boot disk storage look
15:55 at this so whatever you had allocated
15:59 while creating it also the SSH key
16:03 the SSH key is already added here which
16:04 which would be just transferred by
16:07 authorizing yourself okay that's what it
16:11 is now if you want to delete it okay
16:13 this these are the options here you can
16:16 stop it stop is means you're just
16:18 stopping it for now once you start the
16:21 VM it will again start from there itself
16:25 yes you can see the instance is stopped
16:28 once the instance is stopped you are not
16:29 paying for that
16:32 particular hours whenever it is stopped
16:34 you only pay a nominal fee for disk and
16:36 all otherwise you don't pay for the
16:39 resources if you want to start it you
16:41 can again click on start it will start
16:43 the VM again
16:46 and it will run all the startup script
16:49 and all you can get yes you can see your
16:50 instance is started now you can again
16:53 connect so the third thing you would
16:55 want to delete it how to delete you just
16:58 select the VM click on the options click
17:00 on delete
17:03 okay this will also delete the boot disk
17:06 I'll click on okay confirm delete
17:10 and within seconds this VM will also go away
17:15 perfect so you can see instance is
17:18 deleted now so that's how you create it
17:21 you start stop delete suspend that's how
17:24 you play with him from the next videos
17:27 we are going to do all the use cases
17:30 around that how to use what when to use
17:32 what how do you create custom machines
17:35 so subscribe to the channel and see you
17:37 in the next video so hit the like button
17:39 subscribe to the channel and see you in