Please enable JavaScript.
Coggle requires JavaScript to display documents.
GCP_1_3_Instance_groups_and_LB, Forkflow here - Coggle Diagram
GCP_1_3_Instance_groups_and_LB
Instance Group
Unmanaged
don't offer autoscaling, auto healing and other services
different instances incide. Not recomeneden until we need different instances
Might be Zonal or Regional
Managed Instance Group (MIG):
Features
Auto healing (health check) - detect application failure, if instance crashes - create another one
managed releases - ability to roll out with zero down time
provide rolling update - update one by one
provide canary deployment - test X instances and then update all
AutoScaling - increase and decrease based on load
Maintain certain instances
We can LB to distribute load
can create instances in diff zones and regions
same mashine family and types
Created by Instance Template
State
Statefull - DBs, may retain state
Stateless - web services
Managed Instance group is regional. One Instance group == one region. But MIG can distribute traffic across few zones
Definition: group of VM instances managed as single entity
LB
Features
AutoScaling
Global LB with anywise (the same) ID
Health check of instances
Enables
High Availability
AutoScaling
Resileinsly - can distribute across multiple zones and regions
To set up a load balancer with a Compute Engine backend, your VMs need to be in an instance group. The managed instance group provides VMs running the backend servers of an external HTTP load balancer
Communication layer
Transport Layer (TCP TLS UDP) - ensure that bit and bytes transferred properly?
TLS - as TCP -but Secured
UDP - Perf over Resilience' we can skip it
TCP - Resilielbce and then performance - no data loos
Network Layer (IP) - send bits and bytes
IP is unreliable
Application layer - HTTp HTTPS SMTP - make REST calls or send the email
HTTPS
SMTP
HTTP
FTP
Remember
all layers uses protocols under it
Most applications uses app layer, but some prefer Transfer layer for high throughput and lower latency
Definition
Distribute trafic across zones or regions
fully distributed
software defined managed service
LB GCP points - (Part of Network menu)
We can create TCP (Layer 4)
Internal or external
Single or multy region
and Layer (7) Http(s)LB in GCP
Internal or external
Single or multy region
There is a two versions: classic and with additional features to manage trafic
Glossary and Terminology
Frontend - iP adress of LB - Entry point
Host and path rules (for HTTP(s)) - ability to route trafic after LB
Backend - instance group under LB. One mService == one instance group
UDP (Layer 4) (rely on SSL)
Single region
Internal or external
Pattern - secured connection
Client to LB: HTTPs / TLS
LB to instance (inside Google private network): HTTP / TCP
Types level:
Global or Regional
External ir Internal
Path thrur or Proxy(only UDP - path thrue)
Http (s), TCP with SSL(TLS), TCP, UDP
UDP can't be global
LB with High Availability
Global HTTP(s) LB may distribute traffic across difrent REGIONS. For each region we need separate MIG
LB redirects user to closer region. It provide low latency (it is Global Routing). We need a Premier Network Tier for it
If MIG nodes are failed - LB send trafic to another Region
LB access is across single IP accrues the world
Region LB can distribute trafic to different zones in the region
Architecture
Security
Avoid external IP address
use Sole tenant nodes
Create a custom image which is customised for security enterprise
Add Firewall rules to restrict traffic
Perf
Use GPU and TPU
create custom image with right perf settings
Chose right machine family
Costs
Committed use discount
we can get up to 70% discount if we commit to use
Not apply for Dataflow or AppEngine instances
action required - buy commitment
Need to purchase the commitment: 1 or 3 years
Sustainable discount - make instance enabled and use for a liong time
Not apply for some machine types
Not apply for Dataflow or AppEngine instances
Applies for GCE and Kubernet
no action required
Instance creating configuration
Autohealing
Initial delay before we put the traffic
There is ability to set health check criteria
autoscaling metrics
cool-down period
Scale in controls (time and % of instances)
CPU utilisation
LB utilisation and cloud metrics
Predictable load - we can enable based on previous history
min/max of instances
Rolling update - update instances within the new template
When the update should happen - immediately or later
How the update should happened
Maxim surge: how many can be added on one time
how many can be offline
Set Canary template - update only Y instances from Z. It is for testing needs
Rolling restart/Replace - no template update - just restart
Forkflow here
Create Instance Group Template
Create Instance Group from Template
Create LB where we assign LB backend(One microservise) to Backend Services(many MIG in different regions)