Get quick hands-on experience with Google Cloud. This cookbook provides a variety of self-contained recipes that show you how to use Google Cloud services for your enterprise application. Whether you're looking for practical ways to apply microservices, AI, analytics, security, or networking solutions, these recipes take you step-by-step through the process and provide discussions that explain how and why the recipes work.
Ideal for system engineers and administrators, developers, network and database administrators, and data analysts, this cookbook helps you get started with Google Cloud regardless of your level of experience. Google veterans Rui Costa and Drew Hodun also cover advanced-level Google Cloud services for those who have appreciable experience with the platform.
• Learn how to get started with Google Cloud
• Understand the depth of services Google Cloud provides
• Gain hands-on experience using practical examples and labs
• Explore topics that include BigQuery, Cloud Run, and Kubernetes
• Build and run mobile and web applications on Google Cloud
• Examine ways to build your cloud applications for scale
• Build a minimum viable product (MVP) app to use in production
• Learn data platform and pipeline skills
Author(s): Rui Costa, Drew Hodun
Edition: 1
Publisher: O'Reilly Media
Year: 2021
Language: English
Commentary: Vector PDF
Pages: 284
City: Sebastopol, CA
Tags: Google Cloud Platform; Cloud Computing; Security; Networking; Data Warehouse; Google App Engine; VPN; Container Orchestration; Google BigQuery; Virtual Private Cloud; Google Cloud Functions; Google Cloud Run; Google Cloud Compute Engine; Google Cloud Kubernetes Engine
Copyright
Table of Contents
Preface
Who Should Read This Book
Why I Wrote This Book
Rui Costa
Drew Hodun
Navigating This Book
Chapter 1, “Introduction”
Chapter 2, “Cloud Functions”
Chapter 3, “Google Cloud Run”
Chapter 4, “Google App Engine”
Chapter 5, “Google Cloud Compute Engine”
Chapter 6, “Google Cloud Kubernetes Engine”
Chapter 7, “Working with Data”
Chapter 8, “BigQuery and Data Warehousing”
Chapter 9, “Data Processing Tools”
Chapter 10, “AI/ML”
Chapter 11, “Google Cloud Security and Access”
Chapter 12, “Google Cloud Networking”
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
Rui Costa
Drew Hodun
Chapter 1. Introduction
Overview
Projects
Cloud Console
gCloud Command-Line Tool
Other gcloud Tools
Cloud Shell
Client Libraries
Billing
Pricing
Cloud Code (IDE Extensions)
Moving from Another Cloud
This Cookbook
Chapter 2. Cloud Functions
2.1 Creating a Public HTTP Google Cloud Function
Problem
Solution
Discussion
2.2 Authenticating an HTTP Google Cloud Function
Problem
Solution
Discussion
2.3 Accessing Environment Variables at Runtime
Problem
Solution
Discussion
2.4 Sending Emails from Cloud Functions with SendGrid
Problem
Solution
Discussion
2.5 Deploying Cloud Functions with a GitLab CI/CD Pipeline
Problem
Solution
Discussion
2.6 Responding to SMS Messages with Twilio and Cloud Functions
Problem
Solution
Discussion
2.7 Unit Testing with GitLab and Cloud Functions
Problem
Solution
Discussion
2.8 Building an API Gateway to Gather Telemetry Data
Problem
Solution
Discussion
Chapter 3. Google Cloud Run
3.1 Deploying a Prebuilt Hello World Container
Problem
Solution
Discussion
3.2 Building Your Own Hello World Container
Problem
Solution
Discussion
3.3 Using Cloud Run with a Custom Domain
Problem
Solution
Discussion
3.4 Triggering a Cloud Run from Cloud Pub/Sub
Problem
Solution
Discussion
3.5 Deploying a Web Application to Cloud Run
Problem
Solution
Discussion
3.6 Rolling Back a Cloud Run Service Deployment
Problem
Solution
Discussion
3.7 Deploying Cloud Run Services in a Gradual Rollout
Problem
Solution
Discussion
3.8 Cloud Run Configuration Parameters
Problem
Solution
Chapter 4. Google App Engine
4.1 Deploying a Hello World to App Engine (Standard)
Problem
Solution
Discussion
4.2 Deploying a Hello World to App Engine (Flexible)
Problem
Solution
Discussion
4.3 Securing Your Application with Identity-Aware Proxy
Problem
Solution
Discussion
4.4 Mapping Custom Domains with App Engine
Problem
Solution
Discussion
4.5 Using the Google Cloud Translation Machine Learning APIs with App Engine
Problem
Solution
Discussion
4.6 Building User Interfaces for Viewing Charts and Graphs
Problem
Solution
Discussion
4.7 Debugging an Instance
Problem
Solution
Discussion
4.8 Using CI/CD
Problem
Solution
Discussion
Chapter 5. Google Cloud Compute Engine
5.1 Creating a Windows Virtual Machine
Problem
Solution
Discussion
5.2 Creating a Linux Virtual Machine and Installing NGINX
Problem
Solution
Discussion
5.3 Connecting to Your Windows Virtual Machines with Identity-Aware Proxy TCP Forwarding
Problem
Solution
Discussion
5.4 Securing Your Virtual Machine Logins with Two-Step Verification
Problem
Solution
Discussion
5.5 Running Startup Scripts
Problem
Solution
Discussion
5.6 Creating a Group of NGINX Web Servers with a Managed Instance Group
Problem
Solution
Discussion
5.7 Deploying Containers to Managed Instance Groups
Problem
Solution
Discussion
5.8 Transferring Files to Your Virtual Machine
Problem
Solution
Discussion
5.9 Using VM Manager for Patch Management
Problem
Solution
Discussion
5.10 Backing Up Your Virtual Machine
Problem
Solution
Discussion
Chapter 6. Google Cloud Kubernetes Engine
6.1 Creating a Zonal Cluster
Problem
Solution
Prerequisites
Discussion
6.2 Creating a Regional Cluster
Problem
Solution
Discussion
6.3 Resizing a Cluster
Problem
Solution
Prerequisites
Discussion
6.4 Automatically Routing Traffic to the Nearest Cluster with Multi-Cluster Ingress
Problem
Solution
Prerequisites
Discussion
6.5 Deploying a Spring Boot Java Application
Problem
Solution
Discussion
6.6 Deploying a Java Application to Kubernetes, Using Skaffold
Problem
Solution
Discussion
6.7 Using GKE Autopilot for Running an Application You Don’t Have to Manage
Problem
Solution
Discussion
Chapter 7. Working with Data
7.1 Speeding Up Cloud Storage Bulk Transfers by Multiprocessing
Problem
Solution
Discussion
7.2 Speeding Up GCS Transfers for Large Files with Parallel Composite Uploads
Problem
Solution
Discussion
7.3 Mounting GCS as a Filesystem
Problem
Solution
Discussion
7.4 Automatically Archiving and Deleting GCS Objects
Problem
Solution
Discussion
7.5 Creating and Restoring from Persistent Disk Snapshots in GCE
Problem
Solution
Discussion
7.6 Using Interleaved Tables in Your Cloud Spanner Database
Problem
Solution
Discussion
7.7 Locking Down Firestore Database So a User Can Edit Only Their Data
Problem
Solution
Discussion
Chapter 8. BigQuery and Data Warehousing
8.1 Using Cloud Console to Run a BigQuery Query
Problem
Solution
Discussion
8.2 Loading Data to BigQuery from CSV
Problem
Solution
Discussion
8.3 Building a Pivot Table in BigQuery
Problem
Solution
Discussion
8.4 Adding Partitioned and Clustered Columns to an Existing Table
Problem
Solution
Discussion
8.5 Adding Clustering to a Table That Can’t or Shouldn’t Be Partitioned
Problem
Solution
Discussion
8.6 Selecting the Top-1 Result
Problem
Solution
Discussion
8.7 Merging Tables in BigQuery Without Duplicates
Problem
Solution
Discussion
8.8 Deduplicating Rows in BigQuery with Timestamps
Problem
Solution
Discussion
8.9 Undeleting a Table in BigQuery
Problem
Solution
Discussion
8.10 Streaming JSON or Avro Data into BigQuery with a Dataflow Template
Problem
Solution
Discussion
Chapter 9. Data Processing Tools
9.1 Cleaning Data Using the Data Fusion GUI
Problem
Solution
Discussion
9.2 Running a Simple Python Dataflow Pipeline
Problem
Solution
Discussion
9.3 Building a Streaming Pipeline in Dataflow SQL
Problem
Solution
Discussion
9.4 Querying BigQuery from a Dataproc Job
Problem
Solution
Discussion
9.5 Adding Event Timestamps to Pub/Sub
Problem
Solution
Discussion
9.6 Inferring and Using Schemas in Dataflow
Problem
Solution
Discussion
9.7 Mini-batching and Streaming Dataflow Data to BigQuery Using Filters
Problem
Solution
Discussion
9.8 Triggering a Dataflow Job Automatically from a GCS Upload
Problem
Solution
Discussion
Chapter 10. AI/ML
10.1 Creating a Vertex AI Notebook
Problem
Solution
Discussion
10.2 Training a Python ML Model Serverlessly
Problem
Solution
Discussion
10.3 Making Serverless Predictions with a Python Model
Problem
Solution
Discussion
10.4 Creating a Custom Notebook Environment
Problem
Solution
Discussion
10.5 Extracting Data from BigQuery to Pandas for Model Training
Problem
Solution
Discussion
10.6 Training a Model in SQL with BQML
Problem
Solution
Discussion
Chapter 11. Google Cloud Security and Access
11.1 Creating a Service Account
Problem
Solution
Discussion
11.2 Creating Custom Roles to Access a Cloud Storage Bucket
Problem
Solution
Discussion
11.3 Authenticating an Application Running on Kubernetes Engine
Problem
Solution
Prerequisites
Discussion
11.4 Retrieving the Authenticated User’s Identity
Problem
Solution
Discussion
11.5 Authenticating a Java Application Using a Service Account
Problem
Solution
Discussion
11.6 Building Reports Using the Cloud Asset API
Problem
Solution
Discussion
11.7 Allowing a List of IP Addresses to Access Your Application
Problem
Solution
Discussion
Chapter 12. Google Cloud Networking
12.1 Creating a Custom Mode VPC Network
Problem
Solution
Discussion
12.2 Creating a Static External IP Address
Problem
Solution
Discussion
12.3 Create a Firewall Rule
Problem
Solution
Discussion
12.4 Serving Content for Users in a Specific Region
Problem
Solution
Discussion
12.5 Configuring VPC Network Peering
Problem
Solution
Discussion
12.6 Creating VPN Gateways with Cloud Routers
Problem
Solution
Discussion
12.7 Deployments of Networks Using Terraform
Problem
Solution
Discussion
12.8 Limiting Access to Only Authorized Networks with VPC Service Controls
Problem
Solution
Discussion
Index
About the Authors