Book Image

Google Cloud Platform Cookbook

By : Legorie Rajan PS
Book Image

Google Cloud Platform Cookbook

By: Legorie Rajan PS

Overview of this book

Google Cloud Platform is a cloud computing platform that offers products and services to host applications using state-of-the art infrastructure and technology. You can build and host applications and websites, store data, and analyze data on Google's scalable infrastructure. This book follows a recipe-based approach, giving you hands-on experience to make the most of Google Cloud services. This book starts with practical recipes that explain how to utilize Google Cloud's common services. Then, you'll see how to make full use of Google Cloud components such as networking, security, management, and developer tools. Next, we'll deep dive into implementing core Google Cloud services into your organization, with practical recipes on App Engine, Compute Engine, Cloud Functions, virtual networks, and Cloud Storage. Later, we'll provide recipes on implementing authentication and security, Cloud APIs, command-line management, deployment management, and the Cloud SDK. Finally, we'll cover administration and troubleshooting tasks on applications with Compute services and we'll show how to monitor your organization's efficiency with best practices. By the end of this book, you'll have an overall understanding and hands-on implementation of Google Cloud services in your organization with ease.
Table of Contents (14 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Preface

Google Cloud Platform (GCP) is a strong contender to the incumbents Amazon Web Services and Azure as the most prominent cloud service provider in the startup and enterprise world. When you think big, when you think about global scale and when you think about state-of-the art technology, the GCP will not let you down. The software and hardware, and the services built on them, come from Google's homegrown research. Both start-ups and enterprises now benefit from the wide array of services provided by GCP.

With GCP, it is easy to perform your business as usual using IaaS, PaaS, and container services backed with strongly supported networking, database offerings, and storage. GCP provides some unique services that are not available with any other provider, especially in managing huge volumes of data, machine learning, and AI.

The book covers a broad range of recipes to give you a taste of the GCP. If you are an architect, you'll find some interesting features of GCP that you can build upon. If you are a developer, you'll get your hands dirty on most of the important services and how to manage them programmatically.

Who this book is for

This book aims at IT professionals, engineers, and developers who are looking at implementing Google Cloud in their organizations. Administrators and architects planning to make their organization more efficient using Google Cloud will also find this book useful. 

What this book covers

Chapter 1, Compute, contains recipes on the compute services of the GCP, namely Google Compute Engine, Google App Engine, Kubernetes Engine, and Google Cloud Functions.

Chapter 2, Storage and Databases, provides some recipes on Google Cloud Storage and some of the database options available (Cloud Spanner, Cloud BigQuery, Cloud Bigtable, and Cloud Datastore).

Chapter 3, Networking, provides a few advanced recipes on connecting two networks and handling traffic to websites.

Chapter 4, Security, discusses how to use some out-of-the-box security tools provided by the GCP and how GCP provides APIs to set up your own security systems.

Chapter 5, Machine Learning and Big Data, contains a few recipes that show the breadth of the big data offerings of GCP and some applied machine learning APIs, which will be directly consumed for our needs.

Chapter 6, Management Tools, shows us some recipes on the Stackdriver suite and the logging system to help us manage our Cloud Platform.

Chapter 7, Best Practices, covers some third-party tools and processes that can be used at the enterprise scale to derive the maximum benefit from the GCP.

To get the most out of this book

The readers should have a Linux VM, which is where the examples can be downloaded to and executed. The Linux VM will act as your development machine. Make sure that your development machine has enough space to handle the number of dependencies that will be installed along with the code. A basic understanding of cloud services and GCP is necessary.

Few recipes have simple configuration of services and others will require changes to source code. Hence, a familiarity with a programming language (Python/Node.js) and basic Linux knowledge will be beneficial.

Due to the rapid evolution of tools and dependencies, there is the possibility of commands and code breaking. Head over to the documentation if you need to modify the commands/code to suit your needs.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Google-Cloud-Platform-Cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/GoogleCloudPlatformCookbook_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "In the alpha-mgmt network, open the SSH port 22 to all servers with the network tag alpha-server."

A block of code is set as follows:

#! /bin/bash
apt-get update
apt-get install -y apache2
cat <<EOF > /var/www/html/index.html
<html><body><h1>Hello World</h1>
<p>Web server on the alpha and beta networks</p>
</body></html>
EOF

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

### Hardcoding tokens in a program is never a good idea. This can be used only for learning ###
access_token = ""
access_token_secret = ""
consumer_key = ""
consumer_secret = ""

Any command-line input or output is written as follows:

$ sudo echo "1 rt1" >> /etc/iproute2/rt_tables

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Choose the Automatic option under Subnet creation mode."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it..., How it works..., There's more..., and See also).

To give clear instructions on how to complete a recipe, use these sections as follows:

Getting ready

This section tells you what to expect in the recipe and describes how to set up any software or any preliminary settings required for the recipe.

How to do it...

This section contains the steps required to follow the recipe.

How it works...

This section usually consists of a detailed explanation of what happened in the previous section.

There's more...

This section consists of additional information about the recipe in order to make you more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected] and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.