google cloud platform special training
TRANSCRIPT
Google Cloud PlatformSimon Su @ GCPUG.TW
http://goo.gl/3dNWgb
2GCPUG.TW
3
Compute Engine
4
GCE basics
● Region and zones● Persistence disk & IOPS● Default permissions● Image and snapshot● Auto migration & auto restart● Preemptable VM
5
Network, Routing & Firewall
Network
● Default network vs. new network
Routing
● Control internal routing
Firewall
● Only allow rules
6
Load Balancer
● TCP, UDP Load Balancer● HTTP(S) Load Balancer● Auto Scale
○ Instance group○ Instance template○ Health check
7
Cloud Launcher
https://console.cloud.google.com/launcher
8
Others
Resources control & Audit
● GCE Quota & Apply● Operation log● GCE usage export
Metadata
● Start / Shutdown script● SSH key● Project environment use
99
LAB1 - Scheduled backup your instance disk using snapshot
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
11
Cloud Storage
12
Basic operation
● Bucket create and delete● Object create, update and delete● Object with path
13
Object ACL
● Bucket permission● Object permission● Object default permission
14
Website bucket
gsutil web set -m index.html -e 404.html gs://gsweb.micloud.tw
index page file
error page file
1515
LAB2: Backup mysql dump data every day
16
Answer
Hint
● gsutil cp $BK_DIR/$name-$(date +"%Y-%m-%d").sql.gz gs://ewant-db-backup/
17
Cloud SQL
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
1919
LAB3: Backup CloudSQL db file to GCS
20
Answer
Hint
● gcloud sql instances export --help
21
Cloud Monitoring
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.
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
24
Persistence logs
● Log export to Google services○ Cloud Storage○ Cloud PubSub○ BigQuery
2525
LAB4: Enable your cloud logging and customize your monitor dashboard
26
Answer
Hint
● https://cloud.google.com/logging/docs/agent/installation
27
Cloud DNS
28
Basic Cloud DNS concept
● Managing DNS records in Cloud DNS zones● 100% Availability and Low Latency● Automatic Scaling● Record update transaction
2929
LAB5: Create a subdomain using Cloud DNS and try to use traction for add records
30
Answer
Hint
● https://cloud.google.com/dns/records/json-record
● Using nslookup for test
31
Deployment Manager
32
Basic Concept
● Immutable deployment scope● Repeatable deployment process● Best practice - Cloud Launcher
3333
LAB6: Create and deploy a vm instance using deployment manager
34
Answer
Hint
● gcloud deployment-manager deployments create [your-deployment-name] --config [deploy-yaml-file]
35
Learning Resources
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/
●
3737
Q&A