gcloud config list
all the configrations that have been set
To see all the settings which includes the default settings
gcloud config list --all
app engine is platform as a service option
its serverless and largely ops free
compute engine is the Iaas - fully controllable down to os
container engine - the cluster of machines running kubernetes and hosting containers
case study-
hosting a website
1. static , no ssl
for this all we need is just the storage
2. ssl , cdn
needs https serving , content delivering , release management etc
3. load balancing or scaling
will be useful if we have a large amount of traffic coming in.
Get vms
4. lot of dependencies
might be we have gone for a microservice architecture.
Deployment is painful .. create containers , manage clusters
5. the abouve still might be difficult to manage so next level we have
heroku and engine yard
on these just focus on the code nd forget the rest
we will study each in detail
1. for storage we use google cloud storage
we need to use cloud storage bucket
upload html
can even handle uses cases where visitor of our website needs to upload something media etc
2. for https serving .. we can use firebase hosting
3. load balancing and scaling
for this we need Iaas
4. cloud launcher can help u with things like wordpress out of the box, and can also tell rough estimates of expenses before the deployment
types of storage in g cloud
1. cloud storage buckets
2. standard persistent disks
3. ssd
4. local ssd (attached to vm instances)
compute engine also gives me control over load balancing options
some of the optional things used for management
1. compute engine
pupper , chef , salt , anisble
2. automated build
jenkins, packer , kubernetes
3. continuous delivery - Travis ci
4. managing deployment with spinnaker
each project can have upto 5 virtual private network (vpc)
each instance will belong to one of the vpc
instances in the same vpc communicate via lan whereas instances across vpc communicate over internet
Preemptible instances
much much cheaper than regular compute engine
but might be terminated any time if compute engine needs the resources
so we have a fault tolerant system, then u can use this
-- they will definitely be terminated after running for 24 hrs
so dont use for long running jobs
how the preemption happends
step1 : compute engine sends a soft off signal
step2 : you are now left with 30 secs to clean up before the system shuts down
step3: so read that signal and stut down otherwise it will be forced shut down
storage option
Each instance comes with a small root persistent disck containing the os
we get to add additional storage options
- persistent disks
-standard
-ssds
-local ssds (not persistent and attached to machine instance)
- cloud storage
persistant disk both standard and ssds are abstractions and there will redundancy
local ssds are actually attached to system and not redundent but they are extremely fast
in terms of cost --> cloud storage is the cheapest
how to handle the fact the google may take down my machine any time for maintainance
there is option in settings which says for host maintenance either .. 1. migrate vm instance or shut down .. if we choose migration .. it will ensure uninteruppted processing
we can edit and change machine congiration .. and if we need to change the machine type then it will need to be restarted
we can also label our resources .. this is esp helpful in grouping and that is esp useful to see billing details etcs
at the end of gui we where we had set up the config .. we see equivalent of rest or command line
one thing we cannot change is the zone
command to create instance
gcloud compute instances create name --zone
to speed up we can set some default config
and when we create new instance if will be same as the default
if our default zone is at a differnet zone than instance , then we need to explicity specify the zone parameter
to ssh
gcloud compute ssh instance_name
what is the necessary condition under which a persistent disk has to be created before it has to be attached to a vm instance
command to create disk
gcloud compute discks create test-disk --size=100GN --zone us-central1-f
the persistnat disk has to be in the same zone as the instance
disks cannot be used unless we format them
then we need to attach it .
can be easily done in gui
command
glcoud compute instance attach-disk test-instance --disk test-disk --zone us-central1-f
one problem with container is that unlike the normal compute engine where nothing used to gets lost if we had a persistent disk. ... everything will get lost in the cotainer if the container crashes or restarts .. for this we need to use gcePersistentDisk abstraction
kubernetes -- node pool
subset of machines within a cluster that all have same config
useful for customizing instance profiles in your cluster
we can run multiple kubernetes node versions on each node pull in our cluster , update each node pool independently , and target each different node pools for specific deployments
container builders
tool that exe utes cotainer image builds on google cloud platforms infrastructure
working
import source code from a variety of repos or cloud storage space
execute a build to the specifications
produce artifacts such as docker cotainers or java engines
container registry
private registry for docker images
push pull or manage containers from any system whether its a compute engine or own hardware
autoscaling
for automatic resizing od clusters with cluster autoscalers
will periodically check whether there are any pods waiting , resizes cluster if needs
also monitors usage of nodes and deletes nodes if all its pods be scheduled elsewhere
Autoscaling is not an option that was available under compute engine
so app engine and cluster engine can support autoscaling
all the configrations that have been set
To see all the settings which includes the default settings
gcloud config list --all
app engine is platform as a service option
its serverless and largely ops free
compute engine is the Iaas - fully controllable down to os
container engine - the cluster of machines running kubernetes and hosting containers
case study-
hosting a website
1. static , no ssl
for this all we need is just the storage
2. ssl , cdn
needs https serving , content delivering , release management etc
3. load balancing or scaling
will be useful if we have a large amount of traffic coming in.
Get vms
4. lot of dependencies
might be we have gone for a microservice architecture.
Deployment is painful .. create containers , manage clusters
5. the abouve still might be difficult to manage so next level we have
heroku and engine yard
on these just focus on the code nd forget the rest
we will study each in detail
1. for storage we use google cloud storage
we need to use cloud storage bucket
upload html
can even handle uses cases where visitor of our website needs to upload something media etc
2. for https serving .. we can use firebase hosting
3. load balancing and scaling
for this we need Iaas
4. cloud launcher can help u with things like wordpress out of the box, and can also tell rough estimates of expenses before the deployment
types of storage in g cloud
1. cloud storage buckets
2. standard persistent disks
3. ssd
4. local ssd (attached to vm instances)
compute engine also gives me control over load balancing options
some of the optional things used for management
1. compute engine
pupper , chef , salt , anisble
2. automated build
jenkins, packer , kubernetes
3. continuous delivery - Travis ci
4. managing deployment with spinnaker
each project can have upto 5 virtual private network (vpc)
each instance will belong to one of the vpc
instances in the same vpc communicate via lan whereas instances across vpc communicate over internet
Preemptible instances
much much cheaper than regular compute engine
but might be terminated any time if compute engine needs the resources
so we have a fault tolerant system, then u can use this
-- they will definitely be terminated after running for 24 hrs
so dont use for long running jobs
how the preemption happends
step1 : compute engine sends a soft off signal
step2 : you are now left with 30 secs to clean up before the system shuts down
step3: so read that signal and stut down otherwise it will be forced shut down
storage option
Each instance comes with a small root persistent disck containing the os
we get to add additional storage options
- persistent disks
-standard
-ssds
-local ssds (not persistent and attached to machine instance)
- cloud storage
persistant disk both standard and ssds are abstractions and there will redundancy
local ssds are actually attached to system and not redundent but they are extremely fast
in terms of cost --> cloud storage is the cheapest
how to handle the fact the google may take down my machine any time for maintainance
there is option in settings which says for host maintenance either .. 1. migrate vm instance or shut down .. if we choose migration .. it will ensure uninteruppted processing
we can edit and change machine congiration .. and if we need to change the machine type then it will need to be restarted
we can also label our resources .. this is esp helpful in grouping and that is esp useful to see billing details etcs
at the end of gui we where we had set up the config .. we see equivalent of rest or command line
one thing we cannot change is the zone
command to create instance
gcloud compute instances create name --zone
to speed up we can set some default config
and when we create new instance if will be same as the default
if our default zone is at a differnet zone than instance , then we need to explicity specify the zone parameter
to ssh
gcloud compute ssh instance_name
what is the necessary condition under which a persistent disk has to be created before it has to be attached to a vm instance
command to create disk
gcloud compute discks create test-disk --size=100GN --zone us-central1-f
the persistnat disk has to be in the same zone as the instance
disks cannot be used unless we format them
then we need to attach it .
can be easily done in gui
command
glcoud compute instance attach-disk test-instance --disk test-disk --zone us-central1-f
one problem with container is that unlike the normal compute engine where nothing used to gets lost if we had a persistent disk. ... everything will get lost in the cotainer if the container crashes or restarts .. for this we need to use gcePersistentDisk abstraction
kubernetes -- node pool
subset of machines within a cluster that all have same config
useful for customizing instance profiles in your cluster
we can run multiple kubernetes node versions on each node pull in our cluster , update each node pool independently , and target each different node pools for specific deployments
container builders
tool that exe utes cotainer image builds on google cloud platforms infrastructure
working
import source code from a variety of repos or cloud storage space
execute a build to the specifications
produce artifacts such as docker cotainers or java engines
container registry
private registry for docker images
push pull or manage containers from any system whether its a compute engine or own hardware
autoscaling
for automatic resizing od clusters with cluster autoscalers
will periodically check whether there are any pods waiting , resizes cluster if needs
also monitors usage of nodes and deletes nodes if all its pods be scheduled elsewhere
Autoscaling is not an option that was available under compute engine
so app engine and cluster engine can support autoscaling
Comments
Post a Comment