GCP ACE LectureSlides
GCP ACE LectureSlides
Self motivation
Scenario - Bowtie Inc.
Bowtie Inc.
Offices Sales
Showroom
Stores
Los Angeles • POS system
London • Website Sales
• Inventory Updates
• Email & File Access
• Voip phone & chat
• Sales Predictions
https://www.linkedin.com/in/antonitzavelas/
@antoniscloud
[email protected]
Course Community
Slack Community https://techstudyslack.com
1000’s of students
#general #google #google-ace
Social learning
Share all the things
What is Cloud Computing?
What is Cloud Computing?
What is Cloud Computing?
What is Cloud Computing?
Resource Pooling
Pooled resources to support a multi-tenant
model allowing multiple customers to share
the same applications or the same physical
infrastructure
The 5 Characteristics of Cloud
Rapid Elasticity
Rapidly provision and de-provision
any of the cloud computing resources
The 5 Characteristics of Cloud
Measured Service
Resource usage can be monitored,
controlled and reported using
metering capabilities
The 5 Characteristics of Cloud
Hybrid
Anthos
AWS Outposts
XaaS
Cloud Service Model Concepts
Traditional
On-premises
APPLICATION
DATA
RUNTIME
CONTAINER
OPERATING SYSTEM
VIRTUALIZATION
PHYSICAL SERVERS
DATA CENTER
Cloud Service Model Concepts
Traditional
On-premises
APPLICATION
Infrastructure Stack
DATA
OPERATING SYSTEM
Parts managed by the vendor
VIRTUALIZATION
Priced by unit of consumption
PHYSICAL SERVERS
DATA CENTER
Cloud Service Model Concepts
Traditional
On-premises DC Hosted
APPLICATION APPLICATION
DATA DATA
RUNTIME RUNTIME
CONTAINER CONTAINER
VIRTUALIZATION VIRTUALIZATION
NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE
OPERATING SYSTEM OPERATING SYSTEM OPERATING SYSTEM OPERATING SYSTEM OPERATING SYSTEM
PHYSICAL SERVERS PHYSICAL SERVERS PHYSICAL SERVERS PHYSICAL SERVERS PHYSICAL SERVERS
NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE
DATA CENTER DATA CENTER DATA CENTER DATA CENTER DATA CENTER
OPERATING SYSTEM OPERATING SYSTEM OPERATING SYSTEM OPERATING SYSTEM OPERATING SYSTEM
PHYSICAL SERVERS PHYSICAL SERVERS PHYSICAL SERVERS PHYSICAL SERVERS PHYSICAL SERVERS
NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE NETWORK & STORAGE
DATA CENTER DATA CENTER DATA CENTER DATA CENTER DATA CENTER
Current Network
Points of Presence
Google Cloud Global Infrastructure
Current Network
Points of Presence
13 Subsea Cables
Hundreds of thousands of miles of fiber cables
Google Cloud Global Infrastructure
24 regions 73 zones
144 network edge locations 200+ countries and territories
Google Cloud Global Infrastructure
Google Cloud Global Infrastructure
Response Response
Request Request
POP Google Data
Point of Presence
(edge network) Center
Geography and Regions
Zone Region Multi-Region
us-east4-a
us-east4-b
us-east4-c
nam3
us-east4 N Virginia/ USA
S Carolina
Geography and Regions
us-east4-a
Zone
A zone is a deployment area for Google
Cloud resources within a region. The
us-east4-b
smallest entity in Google’s global network
us-east4-c
A single failure domain within a region
Deploy closer to users for optimal latency
Geography and Regions
Zone Region Multi-Region
us-east4-a
us-east4-b
us-east4-c
nam3
us-east4 N Virginia/ USA
S Carolina
Geography and Regions
Region
Regions are independent geographic
areas that are sub-divided into zones
us-east4-a
us-east4-b
us-east4-c
nam3
us-east4 N Virginia/ USA
S Carolina
Geography and Regions
Multi-Region
Multi-Regions are large geographic
areas, that contain two or more
regions
Allows Google services to maximize
redundancy and distribution within and
nam3 across regions
N Virginia/ High availability (geo-redundant)
S Carolina
Geography and Regions
Zone Region Multi-Region
us-east4-a
us-east4-b
us-east4-c
nam3
us-east4 N Virginia/ USA
S Carolina
Geography and Regions
Zone - A zone is a deployment area for Google Cloud
resources within a region. The smallest entity of Google’s
global infrastructure.
Region - Regions are independent geographic areas
that are sub-divided into zones
Multi-Region - Multi-Regions are large geographic areas,
that contains two or more regions
Jane Lark
Tony
Lisa Izzy
Compute Service Options
Compute Service Options
Options
Complete control and Flexibility
Flexible container technology
Managed application platform
Serverless Environments
Compute Service Options
You decide the operating system and the software you decid
Cloud Storage
Cloud Storage
Consistent, scalable, large-capacity, highly durable
object storage
11 9’s Durability (99.999999999%)
Unlimited storage with no minimum object size
Use Cloud Storage for content delivery, data lakes, and bac
= region
Storage Options
Storage Options
Filestore
Filestore
Fully managed NFS file server
NFSv3 compliant
Store data from running applications
Use with VM instances and Kubernetes clusters
Filestore
Fully managed NFS file server
Use with VM instances and Kubernetes clusters
Storage Options
Storage Options
Persistent Disks
Persistent Disks
Durable block storage for instances
SQL / Relational
SQL / Relational Options
NoSQL
NoSQL Options
Distributing Workloads
across multiple instances
Load Balancing
Google Cloud
DNS
Publish and maintain DNS records by
using the same infrastructure that
Google uses.
Service Level
Resource Hierarchy
Configure and grant access to the various resources
Account Level
Resource Hierarchy
Configure and grant access to the various resources
relationship
Team 1 Team 2
Payments Billing
Dept A Dept B Dept C
Profile Account
Folders
• Grouping mechanism and
Account-level Team 1 Team 2
Owns isolation boundary
Pays For
Cloud Product X Product Y
Resources
Project
Labels
Projects
Project X Project Y
• Core organizational component
Labels Resource
Labels Resources
VMs Storage
• Categorize resources Service-level
• Any service-level resource
Resource Hierarchy
bowtieinc.co
Domain (cloud level)
Folders
• Grouping mechanism and
Account-level Team 1 Team 2
isolation boundary
Owns
Cloud Product X Product Y
Resources
Project
Labels
Projects
Project X Project Y
• Core organizational component
Labels Resource Resource
Labels
VMs Storage s
• Categorize resources Service-level
• Any service-level resource
Resource Hierarchy
Bowtie Inc
Team 1 Team 2
Product X Product Y
Project X Project Y
VMs Storage
Resource Hierarchy
Bowtie Inc
Team 1 Team 2
Product X Product Y
Project X Project Y
VMs Storage
Resource Hierarchy
Bowtie Inc
Team 1 Team 2
Product X Product Y
Project X Project Y
VMs Storage
Resource Hierarchy
Bowtie Inc
Team 1 Team 2
Product X Product Y
Project X Project Y
VMs Storage
Resource Hierarchy
Bowtie Inc
Team 1 Team 2
Product X Product Y
Project X Project Y
VMs Storage
Resource Hierarchy
Bowtie Inc
Team 1 Team 2
Product X Product Y
Project X Project Y
VMs Storage
Jane Lark
Tony
Lisa Laura
Create a Free Tier Account
Create a Free Tier Account
Google Cloud
Free Tier
Create a Free Tier Account
What’s needed
Fresh new gmail address
Google Cloud Credit card (for verification)
Private Browsing Session
Free Tier • Chrome - Incognito Session
• Firefox - Private Browsing
• Edge - InPrivate
https://console.cloud.google.com/freetrial
DEMO
Securing your GCP Account
Securing your Google Account
Username + Password
GCP Account
[email protected]
******
Securing your Google Account
Username + Password
EASY TO BYPASS
GCP Account
******
2 Step Verification
Know Have
2 Step Verification
1234 5678
1234 5678
1234 5678
1234 5678
Securing your Google Account
GCP Account
[email protected]
******
2SV
2FA
******
Securing your Google Account
GCP Account
******
2SV
DEMO
https://console.cloud.google.com
GCP Console Overview
DEMO
Cloud Billing
Resource Hierarchy
bowtieinc.co
Domain (cloud level)
Payments Billing
Dept A Dept B Dept C
Profile Account
Folders
• Grouping mechanism and
Account-level Team 1 Team 2
Owns isolation boundary
Pays For
Cloud Product X Product Y
Resources
Project
Labels
Projects
Project X Project Y
• Core organizational component
Labels Resource
Labels Resources
VMs Storage
• Categorize resources Service-level
• Any resource created in GCP
Billing Account and Payment Profile
Google-level Cloud-level
Payments
Billing Account
Profile
Project X Project Y
Linked to
Pays For
Cloud
Resources
Billing Account
Defines who pays for a given set Google-level
Payments
Cloud-level
Billing
Linked to
Linked to
Payments
Billing Account
Profile
Project X Project Y
Linked to
Pays For
Cloud
Resources
Payments Profile
Processes payments for all Google-level
Payments
Cloud-level
Billing
Google services
Profile Account
Payments
Billing Account
Profile
Roles Needed
Billing Account User
Admin user
Setting up an Admin account
• gcloud
• gsutil
• bq
• kubectl
Do everything
….and more
Infrastructure as Code
Autocompletion
Powershell
Cloud SDK
user account service account
single machine google account
best practice multiple machines
Resource
Protection Countable
Management
Monitoring and alerting on quotas
Quotas
429
ResourceExhausted
Viewing your quota
DEMO
Cloud IAM
Principle of Least Privilege
A user, program, or process should have only the bare
minimum privileges necessary to perform its function
storage.objects.create
storage.objects.get
storage.objects.delete
storage.objects.list
Identity and Access Management (IAM)
G Suite Domain
Google Accounts that have been created in an organization's G Suite account
AllAuthenticatedUsers
A special identifier that represents all service accounts and all users on the internet who have
authenticated with a Google Account
AllUsers
A special identifier that represents anyone who is on the internet, including authenticated and
unauthenticated users
Roles
compute.instances.list
service resource verb
Roles
Collection of permissions
You cannot grant a permission to the user directly
You grant a role to a user and all the permissions that the role
contains.
Role
Permissions
compute.instances.list
Example compute.instances.get
compute.instances.start
compute.instances.stop
compute.instances.setMachineType
compute.instances.delete
Roles
Primitive Predefined Custom
Roles historically Finer-grained access Tailor permissions to
available in the Google control than the primitive the needs of your
Cloud roles organization
Owner
Editor
Viewer
Avoid using these roles if
possible
Launch Stages
alpha beta ga
in testing tested and awaiting generally
approval available
Conditions
Policy Inheritance
Dept A Dept B Dept C
Folders
• Grouping mechanism and
Team 1 Team 2
isolation boundary
Owns
Cloud Product X Product Y
Resources
Projects
Project X Project Y
• Core organizational component
Resource
VMs Storage s
• Any service-level resource
Jane Lark
Tony Federlagen
Bowtie
Lisa Laura
Deelightful
Policies and Constraints
Policy Architecture
bindings:
- members:
- serviceAccount:[email protected]
role: roles/compute.serviceAgent
- members:
- serviceAccount:[email protected]
- serviceAccount:[email protected]
role: roles/editor
- members:
- user:[email protected]
role: roles/owner
etag: BwWtFEMmKL0=
version: 1
Policy Statement
tonybowtieace@cloudshell:~ (project-tony-286016)$ gcloud projects get-iam-policy project-tony-286016
bindings:
- members:
- serviceAccount:[email protected]
role: roles/compute.serviceAgent
- members:
- serviceAccount:[email protected]
- serviceAccount:[email protected]
role: roles/editor
- members:
- user:[email protected]
role: roles/owner
etag: BwWtFEMmKL0=
version: 1
- user: [email protected]
role: roles/storage.admin
- members:
- user: [email protected]
condition:
etag: BeEEja0YfWJ=
version: 3
Policy Limitations
1 policy per resource (including organizations, folders, projects)
1500 members or 250 Google groups per policy
Up to 7 minutes for policy changes to fully propagate across GCP
Limit of 100 conditional role bindings per policy
Conditions
Condition attributes are either based on resource or based on
details about the request (timestamp, originating/destination IP
address)
bindings:
- members:
- user: [email protected]
role: roles/storage.admin
- members:
- user: [email protected]
role: roles/storage.objectViewer
condition:
title: expirable access
description: Do not grant access after Jan 2021
expression: request.time < timestamp('2021-01-01T00:00:00.000Z')
etag: BeEEja0YfWJ=
version: 3
Time based conditions
bindings:
- members:
- user: [email protected]
role: roles/storage.admin
- members:
- user: [email protected]
role: roles/storage.objectViewer
condition:
title: Business_hours_access
description: Business hours access Monday-Friday
expression: request.time.getHours(“America/Toronto") >= 9 &&
request.time.getHours("America/Toronto") <= 17 &&
// Days of the week range from 0 to 6, where 0 == Sunday and 6 == Saturday.
request.time.getDayOfWeek("America/Toronto") >= 1 &&
request.time.getDayOfWeek(“America/Toronto”) <= 5
etag: BeEEja0YfWJ=
version: 3
Resource based conditions
bindings:
- members:
- user:[email protected]
role: roles/owner
- members:
- group:[email protected]
role: roles/compute.instanceAdmin
condition:
title: Dev_only_access
description: Only access to development* VMs
expression: (resource.type == 'compute.googleapis.com/Disk' &&
resource.name.startsWith('projects/project-cat-bowties/regions/us-central1/disks/development')) ||
(resource.type == 'compute.googleapis.com/Instance' &&
resource.name.startsWith('projects/project-cat-bowties/zones/us-central1-a/instances/development')) ||
(resource.type != 'compute.googleapis.com/Instance' &&
resource.type != 'compute.googleapis.com/Disk')
etag: BwWEmjveluK=
version: 3
Condition Limitations
Limited to specific services
Primitive roles are unsupported
Members cannot be allUsers or allAuthenticatedUsers
Limit of 100 conditional role bindings per policy
20 role bindings for same role and same member
AuditConfig Logs
auditConfigs:
- auditLogConfigs:
- logType: DATA_READ
- logType: ADMIN_READ
- logType: DATA_WRITE
service: allServices
- auditLogConfigs:
- exemptedMembers:
- [email protected]
logType: ADMIN_READ
service: storage.googleapis.com
Service Accounts
Service Accounts
Google Cloud
VPC
Project A
Project B Project C
Web App
service account
Service Account types
User-managed [email protected]
Default [email protected]
[email protected]
Service Account Keys
Google Cloud
VPC
Project-redbt
Editor
Viewer
Legacy method
Binding
Impersonation
Attach to
resource
Best Practices
Audit service accounts and keys using either
the serviceAccount.keys.list() method or the Logs Viewer page in the console.
Grant the service account only the minimum set of permissions required to
achieve their goal
Create service accounts for each service with only the permissions required for
that service
Take advantage of the IAM service account API to implement key rotation
Cloud Identity
Cloud Identity
Security
Single Sign-on
(SSO)
Reporting
Directory Management
Device Management
Security
App A
App B
App C
Reporting
Audit Logs
Directory Management
Azure AD
GCDS
Active Directory
Google Cloud Directory Sync (GCDS)
On-premises environment Google Cloud
bowtieinc.co bowtieinc.co
AD Forest
bowtieinc.co
bowtieinc.co One way sync
Google Cloud
AD Domain Organization
GCDS
Cloud Identity
bowtieinc.co Single sign-on Other Google
AD FS services
Third-party
Corporate
SaaS apps
Jane Lark
Tony
Lisa Izzy
IAM Best Practices
Least Privilege
Apply only the minimal access level required for what’s needed
Set policies at the organization level and at the project level rather than at the resour
Grant roles for users or groups at the folder level instead of setting it at the project
level, if spanning across multiple projects
Service Accounts
When using service accounts, treat each app as a separate trust boundary
Do not delete service accounts that are in use by running services
Role logging.viewer
Policy Management
Organization-level policy
Role
Permissions
compute.instances.get
compute.instances.start
Policy Management
To grant access to all projects in your Organization, use an organization-level
policy
Grant roles to a Google group instead of individual users where possible
Application
Presentation
Session
Transport
Network
Data Link
Physical
OSI Model
Protocol
HTTP - HTTPS - DHCP - DNS
Application SSH - Telnet
Presentation
Session
Data Link
Physical
OSI Model
Protocol
HTTP - HTTPS - DHCP - DNS
Application SSH - Telnet
Presentation
Session
Data Link
Physical
Internet Protocol - IP
Dotted decimal
192.168.255.255
octet
4,294,967,296
IPv4 Classful Addressing
0.0.0.0 - 127.255.255.255
A 2,147,483,648 addresses
4,294,967,296
128 networks
128.0.0.0 - 191.255.255.255
B 1,073,741,824 addresses
16,384 networks
192.0.0.0 - 223.255.255.255
C 536,870,912 addresses
2,097,152 networks
D
E
Private IP addresses
Defined by standard RFC1918
Single Class A
10.0.0.0 – 10.255.255.255
16,777,216 addresses
16 Class B
172.16.0.0 – 172.31.255.255
1,048,576 addresses
256 Class C
192.168.0.0 – 192.168.255.255
65,536 addresses
Classless Inter-Domain Routing (CIDR)
192.168.0.0/16
Network address Prefix
Classless Inter-Domain Routing (CIDR)
192.168.0.0/16
65,536
addresses
192.168.0.0 - 192.168.255.255
Classless Inter-Domain Routing (CIDR)
192.168.0.0/18 192.168.128.0/18
16,384 addresses 192.168.0.0 - 192.168.128.0 - 16,384 addresses
192.168.63.255 192.168.191.255
192.168.64.0 - 192.168.192.0 -
192.168.127.255 192.168.255.255
192.168.64.0/18 192.168.192.0/18
16,384 addresses 16,384 addresses
Networking Refresher Part 2
Classless Inter-Domain Routing (CIDR)
192.168.0.0/16
Dotted decimal notation Prefix
Classless Inter-Domain Routing (CIDR)
192.168.0.0/16
Dotted decimal notation Prefix
Helpful Reference
192.168.0.0/8 16+ million IP addresses
Presentation
Session
Data Link
Physical
IP Version 6
Octet
192.168.0.250
Dotted decimal notation
Hextet
1452:0db8:0000:0000:0000:fe02:0042:8452
Hexadecimal notation
1452:0db8:0:0:0:fe02:0042:8452
1452:0db8::fe02:0042:8452
Shortened
IP Version 6
2001:de3::/64
Network address Prefix
2001:de3:0000:0000:0000:0000:0000:0000
Start address
2001:de3:0000:0000:ffff:ffff:ffff:ffff
End address
Presentation
Session
Data Link
Physical
IP - TCP/UDP
IP Packet
Source IP Address Destination IP Address
Presentation
Session
Data Link
Physical
Application Layer
Project Internet
us-east1
us-central1
europe-west1
asia-east1
australia-southeast1
southamerica-east1
northamerica-northeast1
Default VPC
10.128.0.0/9
Project /20 subnet in each region
Route to Default Internet Gateway
Default
10.142.0.0/20 us-east1
10.128.0.0/20 us-central1
10.132.0.0/20 europe-west1
10.140.0.0/20 asia-east1
10.152.0.0/20 australia-southeast1
10.158.0.0/20 southamerica-east1
10.162.0.0/20 northamerica-northeast1
DEMO
Virtual Private Cloud (VPC)
Project
Network
/20 /16
Reserved IP Addresses
System-generated
Default
Subnet Route
Custom Routes
Static Route
Dynamic Route
Routing Types
System-generated
Default
Subnet Route
Default Route
Path to the Internet
Path for Private Google Access
Can be deleted only by replacing with custom route
Lowest priority
Subnet Route
Routes that define paths to each subnet in the VPC
Each subnet has at least one subnet route whose
destination matches the primary IP range of the subnet
When a subnet is created, a corresponding subnet route is
created for both primary and secondary IP range
Cannot delete a subnet route unless you modify or delete
the subnet
Routing Types
Custom Routes
Static Route
Dynamic Route
Static Route
Can use the next hop feature
Can be created manually
Static routes for the remote traffic selectors are created
automatically when creating Cloud VPN tunnels
Static Route parameters
Special Routes
Project
Network
subnet-1
subnet-2
Private Google Access
Internet
Traffic to Google
APIs and Services Google APIs
Other Private Access
and Services
Traffic to the Internet
Public IP addresses
Options
Internal subnet route
Project
Private Google Access
Network Internet gateway
for on-premises hosts
VPC routing
Private Services Access
Region: us-west1 Region: us-central1
VM1 VM2
10.30.0.5 192.168.2.7 + Public IP
IP Addressing
IP Addressing
IP Address
Decision starts here
OPTIONAL
PROMOTE TO STATIC
Custom VPC
Alias IP Auto Custom must be selected manually
OPTIONAL PROMOTE TO STATIC
OPTIONAL
PROMOTE TO STATIC
Only resources with an external IP address can send and receive Ephemeral Static
traffic directly to and from outside the network.
PROMOTE TO STATIC
Automatically assigned
IP addresses are
released when stopping
and restarting or deleting Assigns the IP address to your project
until you explicitly release it
Unreserved Reserved
In use 2B. Create reserved In use
internal IP Address
10.12.4.3
External IP address reservation
1. Reserve a new static external IP address and then assign it to a resource
2. Specify an ephemeral external IP address for a resource and then promote
the address
Regional IP address
gcloud compute addresses create ADDRESS_NAME \ --region REGION
Global IP address
gcloud compute addresses create ADDRESS_NAME \ --global \ --ip-version [IPV4 | IPV6]
IP Addressing
IP Address
OPTIONAL
PROMOTE TO STATIC
incoming OR outgoing
Project NOT BOTH
Network
subnet-1
subnet-2 protocol
ports
sources
destinations
target
Implied and pre-populated rules
TCP, UDP, ICMP, GRE
Metadata Server:
169.254.169.254 TCP: PORT 25
DHCP
DNS
Instance Metadata
Implied Rules
NTP
allow egress deny ingress
Firewall rule characteristics
OR
BOTH
IPv4
OR
BOTH
Firewall rule components
The VPC network
Numerical priority
Source IP
Source Tags
Source Service account
Traffic to Google
APIs and Services
Cloud Storage
Traffic to the Internet
VPC routing
private-instance public-instance
10.0.5.x 10.0.0.x + Public IP
Custom VPC w/ Private Google
Access Internet
Cloud Storage
Traffic to the Internet
Project
VPC routing
Cloud Storage
Traffic to the Internet
VPC routing
private-instance public-instance
10.0.5.x 10.0.0.x + Public IP
DEMO
VPC Peering
VPC Peering
Private connectivity across two VPC networks (RFC 1918)
Peer across the same or different projects and
organizations
Reduces network latency
Increases network security
Reduces network costs
VPC Peering
network-b
network-a network-c
subnet-b 10.0.0.0/20
Transitive peering is NOT supported subnet-c 10.3.0.0/20
Internal
DNS
To allow ingress traffic from VM instances in a peer network, you must create ingress allow firewall
rules. By default, ingress traffic to VMs is blocked by the implied deny ingress rule.
VPC Peering Demo
bowtieinc project-tony-286016
bowtieinc-a bowtieinc-b
VM1 VM2
Standalone Project
Project
Host project OR
Network
Service project
cannot be both Host Project
Region: us-west1
Dev-A Service Project Dev-B Service Project Prod-A Service Project Prod-B Service Project
Customer VPN
Gateway
Host Project
Internet
Two-tier web service
Host Project
Region: us-west1
bowtieinc-a
Pod
ServiceDetails
Service
service_name
service_namespace
Sample Log
Sample Log
compute.googleapis.com%2Fvpc_flows }
DNS Fundamentals
What is DNS?
www.google.com 172.217.164.196
What is DNS?
www.google.com 172.217.164.196
query reply
google.com
www 172.217.164.196
ZONE FILE
DNS Record Nameserver
Why DNS
Organization
Domain Name Structure
A dynamic system
antonit.com.
ROOT
DNS Structure
IANA
Root domain
13 root servers
Root
zone
. a.root-servers.net (a-m)
Root Root
hints hints
Authoritative name
server for
www.google.com
DNS Record Types
SOA
NS CNAME
NS
Name Server (NS)
Root domain
. Records for .co
root zone
co
TLD name servers bowtieinc.co NS ns-cloud-d1.googledomains.com
bowtieinc.co NS ns-cloud-d2.googledomains.com
.co zone
bowtieinc.co zone
A
AAAA
A and AAAA records
IPv4
bowtie
www A 52.54.92.195
www AAAA 2001:4860:4802:32::a
bowtieinc.co zone
IPv6
CNAME
CNAME records
bowtieinc.co A 52.54.92.195
bowtie
bowtieinc.co zone
TXT
TXT records
bowtieinc.co zone
TXT
TXT records
You’re good to
go!
bowtieinc.co zone
MX
MX records
domain name
MX query
MX 5 mail
MX 10 ASPMX.L.GOOGLE.COM. [email protected]
priority
bowtieinc.co zone
SOA
PTR records
bowtieinc
www A 52.54.92.195
Pointer record 195.92.54.52.in-addr.arpa PTR bowtieinc.co
bowtieinc.co zone
SOA
SOA records
bowtieinc.co
origin = ns-cloud-b1.googledomains.com
bowtieinc mail addr = cloud-dns-hostmaster.google.com
serial = 3
refresh = 21600
retry = 3600
expire = 259200
minimum = 300
bowtieinc.co zone
Network Address Translation (NAT)
Network Address Translation - NAT
Translates local private IP(s) to public IP(s) before transferring packets
Types of NAT
Packets are generated with the The source address in the packet 54.5.4.9
private source IP and the public is translated from a private IP to a
192.168.0.15 destination IP in the header TRANSLATION public IP and the source in the
packet is delivered as a public IP
192.168.0.15 73.6.2.33
SRC IP: 192.168.0.15 SRC IP: 73.6.2.33
DEST IP: 54.5.4.9 DEST IP: 54.5.4.9
Public
x1337 Phone Number
514-555-8437
Laura George
Internal/
Private
Dynamic NAT
Source = SRC Destination = DEST
TRANSLATION bowterest
Private IPs Public IP Pool
192.168.0.37 73.6.2.33
192.168.0.13 73.6.2.34 54.5.4.9
192.168.0.37
Internal/ Private Public
x1336
George
Internal/
x1337 Private
Port Address Translation - PAT
Source = SRC Destination = DEST
The NAT device records the source IP and source port in a NAT table
ource IP is replaced with a public IP and public source port are allocated from a pool that allows overloading -
Telephone Analogy for PAT
x8844 514-555-8437
Internal/ Private
Jane Lark
Tony
Lisa Izzy
Cloud DNS
Cloud DNS
Host authoritative name servers and allow authoritative
DNS lookups (DNS as a Service)
100% SLA - Globally Resilient
Host zones through managed name servers
• Public Zone - visible to the internet
Records
Record Sets
DEMO
Virtualization Fundamentals
What is Virtualization?
Lark
Kernel
User Mode
Application
Or SYSTEM CALL
Non Privileged Mode
Operating System
Kernel Mode
Or
Privileged Mode
Hardware
used unused
What is Virtualization?
Kernel Kernel
used unused
What is Virtualization?
Kernel Kernel
Unstable
What is Virtualization?
Web App Database
Application
unused
Operating System
Hypervisor (VMM)
used
Hardware
Application
Virtual Machines
(guest) Operating System
Host Hardware
Para-virtualization
Web App Database
Application
Virtual Machines
Modified
(guest)
Operating System
HYPERCALL
Hypervisor (VMM)
Host Hardware
Hardware-assisted Virtualization
Web App Database
Application
Virtual Machines
(guest) Operating System
Can access the
underlying hardware Hypervisor (VMM)
Host Hardware
Virtualization-aware
Kernel Level Virtualization
VM VM VM
Operating System
Hypervisor
Application
(Nested Virtualization)
Operating System
Host Hardware
Compute Engine
Compute Engine
Virtual machine = Instance (IaaS)
Multiple instance sizes and types
Per second billing
Launched in a VPC network
Host is available in a Zone
Multi-tenant host or Sole-tenant node
Machine Configuration
Cores (vCPU)
Predefined Custom
Memory
Operating
Public Image Custom Image Marketplace System
Cores (vCPU)
Predefined Custom
Memory
Cores (vCPU)
Predefined Custom
Memory
Operating
Public Image Custom Image Marketplace System
Operating
Public Image Custom Image Marketplace System
Cores (vCPU)
Predefined Custom
Memory
Operating
Public Image Custom Image Marketplace System
Performance vs Cost
Standard - Spinning Hard Drive
Balanced - Solid State Drive (alternative to SSD)
SSD - Solid State Drive
Local SSD - Physically attached (swap disk)
Machine Configuration
Cores (vCPU)
Predefined Custom
Memory
Operating
Public Image Custom Image Marketplace System
Cores (vCPU)
Predefined Custom
Memory
Operating
Public Image Custom Image Marketplace System
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Standard
NVIDIA Tesla K80
High-memory
NVIDIA Tesla P4
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
Machine Types
Generation
Type
Series
e2-standard-32 vCPU’s
E2 1 64
standard
2 80
N2
highmem 4 96
N2D 8 128
GPU’s only available highcpu
N1 + GPU 16 160
for N1 series 30 208
M1 ultramem 32 224
M2 40 416
megamem
C2 48
F1 medium 60
G1 small
micro
Predefined machine type families
Available for custom
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Standard
NVIDIA Tesla K80
High-memory
NVIDIA Tesla P4
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
Standard machine type
Available for custom
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Standard
NVIDIA Tesla K80
NVIDIA Tesla P4
High-memory High memory to CPU ratio
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
High-CPU machine type
Available for custom
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Standard
NVIDIA Tesla K80
NVIDIA Tesla P4
High-memory High CPU to memory ratio
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
General-purpose machine family
Available for custom
e2-micro
e2-small General-purpose Day-to-day computing at a lower cost
e2-medium
Web serving
E2
Shared core N1 App serving
f1-micro N2 Back office applications
g1-small N2D
Small-medium databases
Microservices
GPU
Standard Virtual desktops
NVIDIA Tesla K80
High-memory
NVIDIA Tesla P4 Development environments
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
General-purpose
min
vCPU’s Memory
2 0.5
e2-standard-32 2 4 8 16 32
max 32 128 E2 standard
highmem 2 4 8 16
highcpu 2 4 8 16 32
Medium-large databases
GPU Cache
Standard
NVIDIA Tesla K80 Media/streaming
High-memory
NVIDIA Tesla P4
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
General-purpose
min
vCPU’s Memory
2 0.95
n1-standard-32 2 4 8 16 32 48
max 96 624 N1 + GPU standard
64 80 96
TPU
highmem 2 4 8 16 32 48
64 80 96
highcpu 2 4 8 16 32 48
64 80 96
min
vCPU’s Memory
2 0.5
n2-standard-32 2 4 8 16 32 48
max 80 640 N2 standard
64 80
highmem 2 4 8 16 32 48
64 80
highcpu 2 4 8 16 32 48
64 80
min
vCPU’s Memory
2 0.5
n2d-standard-32 2 4 8 16 32 48
max 224 896 N2D standard
64 80 96 128 224
highmem 2 4 8 16 32 48
64 80
highcpu 2 4 8 16 32 48
64 80 96 128 224
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Ultra high performance for compute-intensive workloads
NVIDIA Tesla K80
Standard
HPC
High-memory
NVIDIA Tesla P4 Electronic Design Automation (EDA)
High-CPU
NVIDIA Tesla T4 Gaming
NVIDIA Tesla V100
Single-threaded applications
NVIDIA Tesla P100
Compute-optimised
min
vCPU’s Memory
4 16
c2-standard-32
max 60 240 C2 standard 4 8 16 30 60
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Standard
NVIDIA Tesla K80 Ultra high-memory workloads
High-memory
NVIDIA Tesla P4
High-CPU Large in-memory databases like SAP HANA In-
NVIDIA Tesla T4
memory analytics
NVIDIA Tesla V100
NVIDIA Tesla P100
Memory-optimised
M1
min
vCPU’s Memory
40 32
m1-ultramem-40
max 160 3844 M1 ultramem 40 80 160
megamem 96
M2 vCPU’s Memory
min 40 32 M2 ultramem 208 416
max 160 11,776 416
megamem
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Burstable workloads, cost-effective,
Standard
non-resource
NVIDIA Tesla intensive
K80 applications
High-memory
NVIDIA Tesla P4
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
Shared Core
e2-small 2
E2 micro
vCPU’s Memory
small 2
min 2 1
medium 2
max 2 4
N1 f1-micro 1
g1-small 1
custom 2 48 224
E2 standard
4 64
N2 highmem 8 80
N2D 16 96
+ GPU highcpu 32 128
N1
Predefined machine categories
Available for custom
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Graphics-intensive workloads
Ultra-memory
GPU
Standard
NVIDIA Tesla K80
High-memory
NVIDIA Tesla P4
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
Predefined machine categories
Available for custom
e2-micro
e2-small General-purpose Compute-optimised Memory-optimised
e2-medium
E2 C2 M1
Shared core N1 M2
f1-micro N2
Standard
g1-small N2D
Mega memory
Ultra-memory
GPU
Standard
NVIDIA Tesla K80 1 2 4 8 16 30 32 40 48
High-memory
NVIDIA Tesla P4 60 64 80 96 128 160 208 224 416
High-CPU
NVIDIA Tesla T4
NVIDIA Tesla V100
NVIDIA Tesla P100
Managing Instances
Instance Lifecycle
Resume Suspend
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Instance Lifecycle
Resume Suspend
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Suspend Stopping $$: static IPs, disks Terminated $$: static IPs, disks
Instance Lifecycle
Resume Suspend
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Staging State
Staging
internal IP
external IP
system
image
Boot
Shielded VM’s
Shielded VM’s
Boot Process
Virtual Trusted
Integrity
Secure Boot Platform Module
Monitoring
(vTPM)
Measured
Boot
Running State
Running
SSH | RDP
Export system
image
Modify/Repair
Snapshot
persistent disk
Live Migrate
Migrate instance
to different zone
Metadata
Project Bowtie
Linux and
Windows
scripts
Guest environment
curl http://metadata.google.internal/computeMetadata/v1/project/
curl http://metadata.google.internal/computeMetadata/v1/instance/
Running State
Running
SSH | RDP
Export system
image
Modify/Repair
Snapshot
persistent disk
Live Migrate
Migrate instance
to different zone
VM access
SSH RDP
Requires firewall rule Requires firewall rule
allow - tcp:22 allow - tcp:3389
Google Cloud console Connect using RDP
Cloudshell Powershell terminal
using CloudSDK Requires setting Windows
OS Login (use 2SV) password
Manually creating SSH key pair RDP Chrome extension
3rd party RDP client
Running State
Running
SSH | RDP
Export system
image
Modify/Repair
Snapshot
persistent disk
Live Migrate
Migrate instance
to different zone
Live Migration
Project Bowtie
Network A
Region: us-west1
us-west1-a us-west1-b
subnet-1 10.0.2.0/24
bowtievm bowtievm
Reset
SSH | RDP
Root disk Export system
Persistent disk
system
image Terminated Delete
image
Modify/Repair
Additional Disks
Boot Snapshot
persistent disk
Live Migrate
Migrate instance to
different zone
Compute Engine Billing
Compute Engine Pricing
Each individual vCPU and each GB of memory is
billed separately - resource based
25% - 50% 80% of base rate 25% - 50% 86.78% of base rate
50% - 75% 60% of base rate 50% - 75% 73.3% of base rate
75% - 100% 40% of base rate 75% - 100% 60% of base rate
= vCPU
n1-standard-4+12
n1-standard-4
Upgrade instance
Discount for 4vCPU’s
10% 20% 30%
80% cheaper
Fixed pricing
Within 24 hours
No charge if <10min
2
DATA ID
METADATA
1 6
7 12 3 8
11 4 9 10 5
Block Storage
11 4 9 10 5
File Storage
NFSv3
Network File System
Directory tree structure
Mountable
Not bootable
Object Storage
Unstructured data
Infinitely scalable
DATA ID
METADATA Not mountable
Not bootable
Cloud Storage
Storage Performance Terms
I/O I/O queue depth IOPS Throughput Latency
4kb
256kb
4mb
I/O operations/s MB/s ms
Performance
Persistent Disk Snapshots
Persistent Disk Snapshots
Backup and restore of persistent disks
Global resources
Support for zonal and regional PDs
Incremental and automatically compressed
Snapshots are stored in Cloud Storage
Stored in regional or multi-regional location
Creating Snapshots
Bowtie-disk
Snapshot 2
REFERENCE
from snapshot 1
Blocks that are different than snapshot 1
INCREMENTAL
Snapshot 3 REFERENCE
from snapshot 2
Blocks that are different than snapshot 2
Deleting Snapshots
Bowtie-disk
Snapshot DELETED
2
REFERENCE
REFERENCE
fromfrom
snapshot 1
snapshot 1
Blocks that are different than snapshot 1
INCREMENTAL
Snapshot 3 REFERENCE
from snapshot 2
Blocks that are different than snapshot 2
Scheduled Snapshots
Snapshot schedules
• Best practice for backups
Retention policy
options Source disk deletion rule
Managing Snapshots
1 snapshot = 10min
Create regular schedules
Eliminate excessive snapshots images
Set schedule to off-peak hours
Windows - create VSS snapshots
Deployment Manager
Configuration
3 Components
Name
Type
Properties
Configuration
name
Name
User-defined string name: larks-instance-dont-touch
Configuration
base type
Type
Base type type: [API].[VERSION].[RESOURCE]
properties
Properties
Parameters for the resource type
zone, machineType, boot, sourceImage
Templates
Jinja Python
Templates
Template property
Deployment
manifest
manifest
External HTTP(S) SSL Proxy Load TCP Proxy Load TCP/UDP Network
External
Load Balancing Balancing Balancing Load Balancing
Session Affinity
Service Timeout
Traffic Distribution
Backends
IPv6 IPv4
us-west2-b us-east1-b europe-west6-a backend service: static backend service: video backend service: images
Reverse proxy load balancer that distributes SSL traffic coming from the internet to VMs
TCP Proxy
Laura in California Lark in New York
Reverse proxy load balancer that distributes TCP traffic coming from the internet to VMs
Network Load Balancer
Laura in California Lark in New York Not a proxy
Responses from backend go directly to client
Regional and external
Network Load
Balancer
Network Load
Balancer
Network TCP/UDP Supports either TCP or UDP; not both
LB provides regional
Direct load balancing
server Support traffic on ports that are not supported by TCP
return proxy and SSL proxy
SSL decrypted by backends not by load balancer
Traffic distributed by protocol, scheme and scope
bowtieapproved.com bowtieinc.co
No TLS offloading or proxying
us-west2 us-east1
Multiple forwarding rules reference one target pool
Compute Compute
Engine Engine Other protocols use target instances
Self managed SSL certificates
Pass-through load balancer that distributes TCP and UDP traffic to VMs
Internal Load Balancer
Laura in California Lark in New York
bowtie-network
Supports either TCP or UDP; not both
VPC Routing
Balances internal traffic between instances
us-west2 us-east1 us-west2 Cannot be used to balance internet traffic
Web Frontend Web Frontend Web Frontend Traffic sent to backend directly; does not terminate
client connections
Instance Instance Instance
Group Group Group
When using forwarding rules
subnet-1 subnet-1 subnet-1 You must specify at least one and up to 5 ports by
Internal Load Internal Load Internal Load number
Balancer Balancer Balancer
Pass-through load balancer that distributes TCP and UDP traffic to VMs
Load Balancer Types
Instance Group
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Managed Instance Groups (MIGs)
Autohealing
STATELESS
High AvailabilityKeeps VMs in RUNNING state
Regional (multi-zone)
Recreate VMs not in RUNNING state
STATELESS
Load Balancing
Application-based autohealing BATCH
Scalability
Recreate VMs when app is frozen or has crashed
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Managed Instance Groups (MIGs)
Autohealing
STATELESS
High Availability
Regional (multi-zone)
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Load balancing can use instance groups to serve traffic
Autoscaling STATEFUL
Work together to know how much traffic can be handled WORKLOADS
Updates
LB health checks do not Auto-updating
send traffic to unhealthy instances
Managed Instance Groups (MIGs)
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Dynamically add or remove instances
Updates Auto-updating from the MIG
Scale up to meet load demands
Shrink as the load decreases to reduce costs
Managed Instance Groups (MIGs)
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Preemptible Instances
Containers
Network and Subnet
Unmanaged Instance Groups
Autohealing
STATELESS
High Availability
Regional (multi-zone)
STATELESS
Load Balancing BATCH
Scalability
Autoscaling STATEFUL
WORKLOADS
Updates Auto-updating
Instance Templates
VM VM VM VM
App A App A App A App A
Runtime Runtime Runtime Runtime
Container Engine
Hypervisor
Host Operating System
Infrastructure Infrastructure
Abstracted OS
Container
Docker Image breakdown
FROM ubuntu:12.04
Dockerfile
Container
Image Container Registry
Docker Hosts
GKE and Kubernetes Concepts
What is Kubernetes?
Orchestration platform for containers
Cluster
What is GKE?
Cluster
kube scheduler
kube controller
manager
kubectl
cloud controller kubelet kubelet
manager kube-proxy kube-proxy
Network connectivity
runtime runtime
etcd Runs containers
Node Node
GKE Abstraction
API
cluster
server
IP
kube scheduler
kube controller
manager
cloud controller
kubectl manager
etcd
kubelet kubelet
kube-proxy kube-proxy
runtime runtime
Node Node
Node Pools
bowtie-vpc
cotton-cluster
vpc
Control
peering Plane
Node Node Node
internet
Cluster Version
Release Channel
Rapid Regular (default) Stable Specific Version
Several weeks 2-3 months after 2-3 months after Use a specific supported
after upstream releasing in Rapid releasing in Regular version of Kubernetes for
open source GA a given workload
Kubernetes Components
API server
kube scheduler
kube controller
manager
cloud controller
kubectl manager
etcd
kubelet kubelet
kube-proxy kube-proxy
runtime runtime
Node Node
GKE Cluster and Node Management
Node Pools
bowtie-vpc
cotton-cluster cotton-cluster
vpc
Control
peering
Node Node Node Plane
internet
Cluster Version
Release Channel
Rapid Regular (default) Stable Specific Version
Several weeks 2-3 months after 2-3 months after Use a specific supported
after upstream releasing in Rapid releasing in Regular version of Kubernetes for
open source GA a given workload
Cluster upgrades
Control plane and nodes do not always run the same version
at all times
A control plane is always upgraded before its nodes
• Zonal - Cannot launch or edit workloads during upgrade
• Regional - Each control plane is upgraded one by one
Auto-upgrade enabled by default - best practice
Manual upgrade - cannot upgrade control plane more than
one minor version at a time
• Maintenance window and exclusions available
Node and Node pool upgrades
Auto-upgrade enabled by default - best practice
Manual upgrade available
• Maintenance window and exclusions available
Pods scheduled to run on another node during upgrade
Upgrade is complete only when
• All nodes have been recreated
• Cluster is in the desired state
Surge Upgrades
Control the number of nodes GKE can upgrade at a time
Use surge upgrade parameters
max-surge-upgrade max-unavailable-upgrade
Num of additional nodes added to the Num of nodes that can be simultaneously
node pool during an upgrade unavailable during an upgrade
During upgrades, GKE brings down at most the sum of (max-surge-upgrade + max-unavailable-upgrade)
Pods and Object Management
Kubernetes Objects
Kubernetes Object
persistent entity
Object spec Object status
Pod
container container
Replicas
Pod concepts
Node
Remains on the node until:
The pod’s process is complete
shared networking
Namespaces
Version of the Kubernetes API
The kind of object you want to create
default
kube-system
kube-public
kube-node-lease
Labels
unknown failed
Ephemeral
State =
What is a service?
Service
What is a service?
Persistent single IP
Service
Load balancing
Scaling
Service Service
Service components
services.yaml deployment.yaml
bowtie-cluster selector:
app: inventory
Service
10.176.133.7 80
192.168.2.1 192.168.7.1
192.168.2.15 80 80 192.168.2.41
labels: Node
labels: 2
Nginx app: inventory Nginx app: shop
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
Service Types
bowtie-cluster
Service
10.176.133.7 80 port
192.168.2.1 192.168.7.1
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
ClusterIP
bowtie-cluster
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
NodePort
bowtie-cluster
Service
10.176.133.7 80 port
192.168.2.1 192.168.7.1
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
LoadBalancer
bowtie-cluster
Service
10.176.133.7 9752 80 ports
192.168.2.1 192.168.7.1
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
Multi-port Services
bowtie-sql2.bowtieinc.private
bowtie-cluster
Service
10.176.133.7 80
192.168.2.1 192.168.7.1
192.168.2.15 80 80 192.168.2.41
Node 2
Nginx Nginx
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
ExternalName
Internal DNS
name
External DNS
name redirect
Headless
bowtie-cluster
Service
DNS: private-bowtie 80 port
192.168.2.1 192.168.7.1
Service Type
Service Types
Ingress
/products /discontinued
bowtie-cluster
Service Service
80 port 80
192.168.2.1 192.168.7.1
bowtieinc-pod-1 bowtieinc-pod-2
80
Node 1 Node 2
Ingress
products-service.yaml
ingress.yaml
discontinued-service.yaml
Network Endpoint Group (NEG)
Global Load
IP Address Balancer
traffic
Forwarding Rule
Pod
PodIP
PodIP
IP
Pod
PodIP
PodIP
IP kind: Service
Health Checks
Default and inferred parameters are used if there are no specified health check par
Self-managed
Google-managed Self-managed
as Secrets
• Completely managed by • Managed and shared with • Provision your own
Google Google Cloud certificates
Cloud SQL Cloud Spanner Datastore Filestore Cloud Storage Persistent Disk
Docker Storage
Pod
container
Volumes
Filesystem can be shared amongst
other containers Memory
docker area
Kubernetes Storage Abstractions
Ingress
Volumes
Basic storage unit that
decouples the storage from the
container and tie it to the pod
Service
ReplicaSet
Volume Persistent
Ephemeral Volume
Storage Pod Pod Pod
Durable
Storage
Persistent Volume
Claim
ConfigMap Secret
Persistent Volume
Volumes
created when the Pod is created
terminated when pod is terminated or deleted
Pod
Container
Pod spec
how directory is created
storage medium used
directory's initial contents
Volume
Types of volumes
emptyDir
• empty directory that containers in the Pod can read and write from
ConfigMap
• provides a way to inject configuration data into Pods
Secret
• used to make sensitive data available to applications
Downward API
• used to make Downward API data available to applications
PersistentVolumeClaim
• provision durable storage to be used by applications
Persistent Volume
Ingress
Service
ReplicaSet
Requests:
Persistent Volume Specific size
Claim Access Mode
Storage Class
Persistent Disk
persist independently Persistent Volume
dynamically provisioned
Storage Classes
StorageClass resources
Service
ReplicaSet
Persistent Volume
Set reclaim policy to Claim
RETAIN
to prevent persistent
volume deletion
Persistent Volume
Persistent Volume Access
Access Modes
Interface 0
Regional External IP
on-premises network
bowtie-project
bowtie-network us-east1
On-premises VPN
Classic Cloud VPN
Gateway Gateway
Internet 36.91.33.7
bowtie-network
Cloud Router
router-a
(ASN 65001)
on-premises subnets
and resources
(ASN 65002)
BGP BGP
External IP
and BGP IP
Interface 1
Regional External IP
When to use Cloud VPN
Public internet access is needed
Peering location is not available
Budget constraints
High speeds/ low latency not needed
Outgoing traffic (egress) from GCP
Cloud Interconnect
Cloud Interconnect
Low latency, highly available connection between your on-
premises and Google Cloud VPC networks
Directly accessible internal IP addresses - Private Google Access
Does not traverse the public internet
Dedicated connection
Not encrypted
Expensive
Dedicated Interconnect
On-premises network
bti-interconnect (bowtieinc)
us-east1: 10.68.0.0/20
Zone 1
On-premises
Cloud Router Router
Compute Google Peering
Link-local address: Edge Link-local address:
10.68.0.7 162.76.13.37 162.76.13.38 192.168.0.16
bowtie-network
us-east1
Compute
10.68.0.7 192.168.0.16
Colocation facility
App Engine
Standard Flexible
Apps run in sandbox environment Apps run in docker containers
Specific versions of runtimes used Any version of runtimes used
Run for free or at very low cost No free quota available
Designed for sudden and Designed for consistent traffic
extreme spikes of traffic
Pricing based on VM resources
Pricing based on instance hours
Managed VMs
Deploying an application
gcloud app deploy Top level
One or more services
Application
Loosely-coupled
Service 1 Service 2
Versions of the service logical components
Manual scaling
Service
Version 1 Version 2
Service
Version 1 Version 2
trigger
How Cloud Functions work
event data
stateless
trigger
Cloud Functions
Cloud Storage
Cloud Storage
Consistent, scalable, large-capacity, highly durable
object storage - not file or block
Worldwide accessibility and worldwide storage locations
Use for data files, text files, pictures, videos
Excels for content delivery, big data sets and backups
Buckets and Objects
Cloud Storage buckets
Object
Bucket
object data metadata name:value
properties
name, storage class, etc
flat namespace
/bowties/spring2021/plaidbowtie.jpg
Storage Classes
Hot data Cold data
Signed URLs
Access an object using the URL for the duration of time you specify
Object
generation
metageneration current version
v4
immutable Bucket
v3
objects are never edited in place
v2
always replaced with a new version
v1
replacement is marked as end of object
lifecycle and beginning of a new one
Object Lifecycle Management
Use cases
Downgrade the storage class of objects older than 365 days to Coldline Storage
Delete objects created before January 1, 2020
Keep only the 3 most recent versions of each object in a bucket with versioning enabled
Object Lifecycle Management
Age
CreatedBefore
Example > delete object > condition met > delete object
> change storage > condition met
class
us-east1
us-east1-b
Local connection
Replication
Primary Instance
External
Cloud SQL Read Replica
Cross-region
Read Replica
Read Replica
read-only
us-east1 europe-west3
us-east1 europe-west3
Promote to primary
High Availability
Client application
us-east1
us-east1-b us-east1-d
IP Address X
Regional
Persistent Disk
us-east1
us-east1-b us-east1-d
IP Address X
Regional
Persistent Disk
us-east1
us-east1-b us-east1-d
IP Address X
Regional
Persistent Disk
Types of backups
us-east1 us-west-3
On-demand
Create at any time
us-east1-b Persist until you delete them
us-east1
Nodes
Instance
us-east1
Nodes
us-east1-b us-east1-c us-east1-d
Instance
Fully managed, highly scalable NoSQL document database built for automatic scaling,
high performance, and ease of application development
Firestore for Firebase
Serverless
Fully Managed Document Multi-region replication
Data
Flexibility
Collection Expressive querying
Realtime updates
Offline support
Realtime Database
Simpler version of Firestore
Flexible, scalable NoSQL cloud database to store and sync data for client and
server-side development
Firebase
A mobile app development platform that provides tools and cloud services to help
enable developers to develop apps faster and more easily
Memorystore
Fully Managed
Fully managed
High Availability
Scale as needed
Secure
Use cases
Always up to date
Caching
Stream processing
Fully managed service for either Redis or Memcached in-memory data store to build
application caches
NoSQL Databases
Big Data Overview
What is Big Data?
Massive amounts of data that would typically be too
expensive to store, manage, and analyze using
traditional database systems.
Big Query
Big Query
Fully managed, petabyte scale, low cost analytics data
warehouse
Serverless
Real-time analytics insertion
Use Standard SQL for querying
Process external data
• Dataproc, Dataflow, Cloud Storage, Big Table, Cloud SQL,
Google Drive
• Parquet, ORC, Google sheets
Big Query
AutoML
Fully Managed suite of
machine learning
products
Operations Suite ( Formerly Stackdriver)
Operations Suite
Available for GCP and AWS
VM monitoring with agents
Available for on-premises environments
Google Cloud native integration
ERROR
Collects latency data from App Engine, HTTPS load balancers and applications
Profiler