37
Google Cloud Platform Simon Su @ GCPUG.TW http://goo.gl/3dNWgb

Google Cloud Platform Special Training

Embed Size (px)

Citation preview

Page 1: Google Cloud Platform Special Training

Google Cloud PlatformSimon Su @ GCPUG.TW

http://goo.gl/3dNWgb

Page 2: Google Cloud Platform Special Training

2GCPUG.TW

Page 3: Google Cloud Platform Special Training

3

Compute Engine

Page 4: Google Cloud Platform Special Training

4

GCE basics

● Region and zones● Persistence disk & IOPS● Default permissions● Image and snapshot● Auto migration & auto restart● Preemptable VM

Page 5: Google Cloud Platform Special Training

5

Network, Routing & Firewall

Network

● Default network vs. new network

Routing

● Control internal routing

Firewall

● Only allow rules

Page 6: Google Cloud Platform Special Training

6

Load Balancer

● TCP, UDP Load Balancer● HTTP(S) Load Balancer● Auto Scale

○ Instance group○ Instance template○ Health check

Page 7: Google Cloud Platform Special Training

7

Cloud Launcher

https://console.cloud.google.com/launcher

Page 8: Google Cloud Platform Special Training

8

Others

Resources control & Audit

● GCE Quota & Apply● Operation log● GCE usage export

Metadata

● Start / Shutdown script● SSH key● Project environment use

Page 9: Google Cloud Platform Special Training

99

LAB1 - Scheduled backup your instance disk using snapshot

Page 10: Google Cloud Platform Special Training

10

Answer

Hint:

● gcloud compute disks snapshot $name --snapshot-name snap-$name-v$DT --zone $zone

● gcloud compute snapshots delete snap-$name-v$DT2 -q

Page 11: Google Cloud Platform Special Training

11

Cloud Storage

Page 12: Google Cloud Platform Special Training

12

Basic operation

● Bucket create and delete● Object create, update and delete● Object with path

Page 13: Google Cloud Platform Special Training

13

Object ACL

● Bucket permission● Object permission● Object default permission

Page 14: Google Cloud Platform Special Training

14

Website bucket

gsutil web set -m index.html -e 404.html gs://gsweb.micloud.tw

index page file

error page file

Page 15: Google Cloud Platform Special Training

1515

LAB2: Backup mysql dump data every day

Page 16: Google Cloud Platform Special Training

16

Answer

Hint

● gsutil cp $BK_DIR/$name-$(date +"%Y-%m-%d").sql.gz gs://ewant-db-backup/

Page 17: Google Cloud Platform Special Training

17

Cloud SQL

Page 18: Google Cloud Platform Special Training

18

Cloud SQL basic

● Create instances○ 1st vs 2nd generation○ Instance types

● Daily backup● Dump and import● Security control● Horizontal scale - Read only replication● Vertical scale - Instance scale up

Page 19: Google Cloud Platform Special Training

1919

LAB3: Backup CloudSQL db file to GCS

Page 20: Google Cloud Platform Special Training

20

Answer

Hint

● gcloud sql instances export --help

Page 21: Google Cloud Platform Special Training

21

Cloud Monitoring

Page 22: Google Cloud Platform Special Training

22

Basic Monitoring

● Free tier○ 5GB for free per project per month○ Project audit logs○ 7 days retention

● Premium tier○ Logging and monitoring for Amazon Web Services†.○ All the features of Stackdriver Monitoring, Logging, Error Reporting,

Trace, and Debugger.○ A larger allotment of logs, custom metrics, and logs-based metrics.○ A longer log retention period.

Page 23: Google Cloud Platform Special Training

23@kubernetesio @bretmcg @_askcarter

● Fluentd implemented agent● Default configured for all kinds of log type● Outside datacenter data collection

○ fluentd forward, secure_forward, http(s)...

Enabling Cloud Logging Agent

Step 1:

curl -sSO

https://dl.google.com/cloudage

nts/install-logging-agent.sh

Step 2:

sudo bash

install-logging-agent.sh

Page 24: Google Cloud Platform Special Training

24

Persistence logs

● Log export to Google services○ Cloud Storage○ Cloud PubSub○ BigQuery

Page 25: Google Cloud Platform Special Training

2525

LAB4: Enable your cloud logging and customize your monitor dashboard

Page 26: Google Cloud Platform Special Training

26

Answer

Hint

● https://cloud.google.com/logging/docs/agent/installation

Page 27: Google Cloud Platform Special Training

27

Cloud DNS

Page 28: Google Cloud Platform Special Training

28

Basic Cloud DNS concept

● Managing DNS records in Cloud DNS zones● 100% Availability and Low Latency● Automatic Scaling● Record update transaction

Page 29: Google Cloud Platform Special Training

2929

LAB5: Create a subdomain using Cloud DNS and try to use traction for add records

Page 30: Google Cloud Platform Special Training

30

Answer

Hint

● https://cloud.google.com/dns/records/json-record

● Using nslookup for test

Page 31: Google Cloud Platform Special Training

31

Deployment Manager

Page 32: Google Cloud Platform Special Training

32

Basic Concept

● Immutable deployment scope● Repeatable deployment process● Best practice - Cloud Launcher

Page 33: Google Cloud Platform Special Training

3333

LAB6: Create and deploy a vm instance using deployment manager

Page 34: Google Cloud Platform Special Training

34

Answer

Hint

● gcloud deployment-manager deployments create [your-deployment-name] --config [deploy-yaml-file]

Page 35: Google Cloud Platform Special Training

35

Learning Resources

Page 36: Google Cloud Platform Special Training

36

Official Document & Resources

● GCP Official documents: http://cloud.google.com/docs

● GCP Blog: http://googlecloudplatform.blogspot.com/http://googlecloudplatform.blogspot.com/

● GCP Podcast: https://www.gcppodcast.com/

Page 37: Google Cloud Platform Special Training

3737

Q&A