Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Google Cloud Platform Administration
Google Cloud Platform Administration

Google Cloud Platform Administration: Design highly available, scalable, and secure cloud solutions on GCP

By Ranjit Singh Thakurratan
€14.99 per month
Book Sep 2018 230 pages 1st Edition
eBook
€28.99
Print
€37.99
Subscription
€14.99 Monthly
eBook
€28.99
Print
€37.99
Subscription
€14.99 Monthly

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Google Cloud Platform Administration

Introduction to Google Cloud Platform

This chapter begins with a brief introduction to cloud computing. We then introduce the Google Cloud Platform (GCP) with an overview of its history and its concepts. We will then look into some of its concepts, tools, and services. We will also map and compare how Amazon Web Services (AWS) and Microsoft Azure public clouds match up to GCP products. Lastly, we will set up an account in GCP using the free tier that allows you a 12-month, $300 free trial of all GCP products.

In this chapter, we will cover the following:

  • Introduction to cloud computing
  • Introduction to GCP
  • GCP services
  • Data centers and regions
  • AWS and Azure in comparison to GCP
  • Exploring GCP

Introduction to cloud computing

In the simplest terms, cloud computing is the practice of delivering computing services such as servers, storage, networking, databases, and applications over the internet. In such a delivery model, the consumer, typically a business or an enterprise, only pays for the resources they use without having to pay for the capital investment cost of building and maintaining the data centers.

There are both financial and technological benefits for adopting a cloud computing approach. Companies transform their capital costs to operational costs and are able to pay for what they use rather than pay for idle infrastructure. Cloud computing also eliminates the cost of purchasing and maintaining expensive hardware and data center space. The pay-as-you-go model allows for increasing or decreasing resource consumption without having to pre-purchase hardware.

Companies can also focus on rapid innovation without having to worry about the backend infrastructure's ability to support it. Cloud companies are rapidly introducing new services on high performance hardware platforms that can be consumed on-demand by end users. Typically, companies either migrate entirely to the cloud or use a hybrid model of connecting their on-premise infrastructure to a cloud provider and migrate workloads as needed.

Some good initial use cases for the cloud include development and testing environments, data archiving, data mining, and disaster recovery. All these cases will help reduce capital costs and the speed of deployment and consumption makes cloud computing an ideal platform for these use cases.

Most cloud computing services fall into three broad categories: Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).

With IaaS, you rent the IT infrastructure, which includes servers, virtual machines, networks, storage, and operating systems, on a pay-as-you-go basis. With PaaS, you are given access to an on-demand environment that allows you to quickly deploy, test, and develop your application without having to worry about the underlying IT infrastructure. PaaS is ideal for developers who only care about quickly deploying their application and not worrying about the server, compute, or its storage.

SaaS is a way of delivering software applications over the internet on a subscription model. A good example of SaaS is your Gmail email account. You are subscribed to your email by signing up for it and use the email software that is written, maintained, secured, and managed by Google.

Introducing GCP

GCP's initial release was on October 6, 2011. Since then it has become one of the most used public cloud platforms and is continuing to grow. GCP offers a suite of cloud services that run on the same infrastructure that Google uses to host their end-user products such as Google search, Gmail, and YouTube. This makes it important because Google not only continues to innovate for its customers but also benefits from its own investment into the platform. Google began operations by launching its Google App engine back in 2008. Since then we have seen multiple other services introduced and the list keeps on growing.

GCP services

While GCP services are many, we can broadly categorize them into four different services. They are compute services, storage services, networking services, and big data services. Apart from these, there are other cloud services such as identity and security management, management tools, data transfer, and machine learning.

Compute services

GCP offers you a wide variety of computing services that allow you complete flexibility as to how you want to manage your computing assets. Depending on your application and its requirements, you can choose to deploy a traditional custom virtual machine or use Google's App Engine to run the application:

  • Compute engine: Allows you to deploy and run high-performance virtual machines in Google data centers. You can deploy either a pre-configured virtual machine or customize the resources as per your requirements.
  • Apps engine: Allows you to deploy your application on a fully managed platform which is completely supported by Google. This allows you to simply deploy your application and have it running without you having to worry about the underlying infrastructure.
  • Kubernetes engine: This service allows you to run containers on GCP. This means your containerized applications can be deployed on GCP using the Kubernetes engine service without you having to manage the underlying cluster yourself. Google's Site Reliability Engineers (SREs) constantly monitor the cluster, which relieves you of that responsibility.
  • Cloud Functions: This service allows you to run code and respond to events on the fly in a true serverless model. This means allowing code to respond to events is determined by you. This also means you will be billed only if your code runs, making it very cost effective.

Storage services

The following are the types of storage services:

  • Cloud storage: An object storage that can be used for a variety of use cases and is accessible via a REST API. This offering allows geo-redundancy with its multi-regional capability and can be used for both high performance storage requirements to archival storage.
  • Cloud SQL: A fully managed (replicated and backed-up) database service that allows you to easily get started with your MySQL and PostgreSQL databases in the cloud. The offering also comes with a standard API and also built-in migration tools to migrate your current databases to the cloud.
  • Cloud BigTable: Cloud BigTable is the database for all your NoSQL database requirements. The service can scale to hundreds of petabytes easily, which makes it suitable for enterprise data analysis. BigTable also integrates easily with other big data tools such as Hadoop.
  • Cloud Spanner: Cloud Spanner is a relational database service that aims at providing highly scalable and strongly consistent database service for the cloud. This is a fully managed service that can offer transactional consistency and synchronous replication of databases across multiple geographies.
  • Cloud Datastore: Cloud Datastore is another service set apart from Cloud BigTable that is suitable for your key-value pair NoSQL database requirements. The services comes with other features such as sharding and replication.
  • Persistent Disk: Persistent Disk is persistent high performance block storage that can be attached to your Google compute engine instance or Google Kubernetes engine. The service allows you to resize storage without any downtime and is offered in both HDD and SSD formats. You can also mount one disk on multiple machine instances allowing multi-reader capability.

Networking services

These are the networking services:

  • Virtual Private Cloud (VPC): Virtual private cloud allows you to connect multiple GCP resources together or create internal isolated resources that can be managed easily. You can also deploy firewalls, Virtual Private Networks (VPNs), routes, and custom IP ranges.
  • Cloud load balancing: This service allows you to distribute your incoming traffic across multiple Google Compute Engines. Cloud load balancing also lets you do autoscaling and can scale your backend instances depending on the incoming traffic load.
  • Cloud CDN: Google's cloud delivery network allows you to distribute your content for lower latency and faster access. Google has over 90 edge points globally spread across multiple continents that make it easy for you to decrease your serving costs.
  • Cloud interconnect: This service allows you to directly connect your on-premises data center to Google's network. You can either peer with Google or interconnect depending on your bandwidth requirements and peering capabilities.
  • Cloud DNS: This is Google's highly available global DNS network and comes with an API to allow management of records and zones.

Big data

The following are the big data services:

  • BigQuery: BigQuery is an enterprise data warehouse that allows you to store and query massive datasets by enabling fast SQL queries using Google's underlying infrastructure.
  • Cloud dataflow: A fully managed service that allows real-time batch and stream data processing. The service also integrates with Stackdriver, Google's unified logging and monitoring solution, letting you monitor and troubleshoot issues as they happen.
  • Cloud dataproc: Cloud dataproc is a fully managed cloud service to run Apache spark and Apache Hadoop clusters.
  • Cloud datalab: A powerful tool that allows you to explore and visualize large datasets.
  • Cloud dataprep: A service that helps in structured and unstructured data analysis by means of visually exploring and cleaning it.
  • Cloud pub/sub: A service built for stream analytics that allows you to publish and subscribe to data streams for big data analysis.
  • Google genomics: A service that allows you to query the genomic information of large research projects.
  • Google DataStudio: Allows you to turn your data into informative dashboards.

We will look at all services in greater detail in the following chapters.

Data centers and regions

GCP services are located across North and South America, Europe, Asia, and Australia. These locations are further divided into regions and zones. A region is an independent geographic area that consists of one or more zones. In total, Google has about 17 regions, 52 zones, and over 100 points of presence (points of presence is a local access point for an ISP). Each zone is identified by a letter, for example, zone a in the US-Central region is named us-central1-a.

When you deploy a cloud resource, they get deployed in a specific region and in a specific zone within that region. Any resource deployed in a single zone will not be redundant—if the zone fails, so will the resource. If you need fault tolerance and high availability, you must deploy the resource in multiple zones within that region to protect against unexpected failures. A disaster recovery plan will be needed in order to protect your entire application against a regional failure.

All regions are expected to have a minimum of three zones:

Note that not all regions and zones provide all GCP services. For example, the Oregon region has three regions within it and does not offer Google App Engine services. So it is critical to understand your application requirements and place it in the appropriate region that supports it.

The roundtrip latency of networks between zones within a region is less than 5 ms:

Current regions and number of zones

Oregon, Los Angeles, Iowa, South Carolina, North Virginia, Montreal, Sao Paolo, Netherlands, London, Belgium, Frankfurt, Mumbai, Finland, Singapore, Sydney, Taiwan, Tokyo

Future regions and number of zones

Hong Kong, Osaka, Zurich

Relating AWS and Azure to GCP

If you are familiar with Amazon's AWS or Microsoft's Azure, then this table will help you relate their associated services to what GCP has to offer. Only a few services are shown in the table:

Amazon Web Services

Microsoft Azure

Google Cloud Platform

Amazon EC2

Azure Virtual Machines

Google Compute Engine

AWS Elastic Beanstalk

Azure App Services

Google App Engine

Amazon EC2 Container Service

Azure Container Service

Google Kubernetes Engine

Amazon DynamoDB

Azure Cosmos DB

Google Cloud Bigtable

Amazon Redshift

Microsoft Azure SQL Data warehouse

Google BigQuery

Amazon Lambda

Azure Functions

Google Cloud Functions

Amazon S3

Azure Blob Storage

Google Storage

AWS Direct Connect

Azure ExpressRoute

Google Cloud Interconnect

AWS SNS

Azure Service Bus

Google Cloud Pub/Sub

AWS Cloudwatch

Application Insights

Stackdriver Monitoring

Exploring GCP

Let's dive a little deeper into GCP by creating an account and getting familiar with the console and command-line interface. There are three ways to access GCP—via console, via a command-line interface using the gcloud command-line tool, and Google Cloud SDK client libraries. But before that, we need to understand the concept of projects.

In GCP, all resources must belong to a project. If you work for a large organization, don't be surprised to see tens of hundreds of projects. Projects can be tied down to a business unit or an internal or external organization.

In GCP, any cloud resources that you create must belong to a project. A project is basically an organizing entity for any cloud resource that you wish to deploy. All resources deployed within a single project can communicate easily with each other, for example two compute engine virtual machines can easily communicate with each other within a project without having to go through a gateway. This, however, is subject to region and zone limitations. It is important to note that resources in one project can talk to resources in another project only through an external network connection.

Each project has a project name, a project ID, and a project number. The project ID has to be a unique name across the cloud platform (or Google can generate an ID for you). Remember that even if the project has been deleted, its ID cannot be reused again:

GCP allows you a free trail that provides you with $300 of credit towards any Google product. Your trial lasts for 12 months and expires automatically after that. If you exceed your free $300 credit, your services will be turned off but you will not be charged or billed, making this a safe way to explore and learn more about GCP.

To get started:

  1. Go to https://cloud.google.com and click on TRY IT FREE:
Remember that you will need to have a Google registered ID to be able to register to use GCP services. We will discuss accounts and access in greater detail in cloud identity and access management.
  1. Once you create an account and log in, agree to the terms and conditions and fill out your details along with a valid credit card number.
  1. Once logged in you will see a Billing Overview:

Let's look at how to access different GCP services using the console:

  1. Click on the menu on the left to drop down the list of services. Feel free to scroll down this list to explore:
  1. On the right, let's look at another way of accessing your GCP instance using the cloud shell tool that allows you to manage your resources from the command line in any browser. The on the top right activates your Google cloud shell. This opens a new frame at the bottom of the browser and displays a prompt. It may take a few seconds for the shell session to be established:

Creating your first project

Alternatively, if you prefer using your terminal, you can download and install the SDK to use gcloud on your terminal. It is important to remember that gcloud is part of the Google Cloud SDK.

We can get started at deploying services by first creating a project:

  1. In the preceding illustration, click Create to create your first project:
  1. You can pick any project name and GCP auto-generates a project ID for you. If you need to customize the project ID in accordance with your organization's standards, click Edit. Remember that this project ID needs to be unique.
  2. Click Create when done.
  1. Once the project is created, your DASHBOARD will show you all info related to your project and its associated resources:
Project IDs are auto-generated but can be customized. It is best to leave the default project IDs in place to avoid management issues.
  1. On the left, note the Project name, Project ID, and the Project number.
  1. Click on Project settings. You will see that you are able to change the Project name but cannot change the Project ID or the Project number. Project settings can also be accessed by going to IAM & admin | Settings:

You can even shut down a project by clicking on the Shut Down option. This will cause all traffic and billing to stop on the project and shut down all resources within a project. You will have 30 days to restore such a project before its deleted. You also have an option to migrate a project. This comes in handy if you are part of an organization and want to move a project over to the organization unit. You will be able to do this if you are a G suite or a cloud premium customer with a support package. Ideally, this is something that keeps projects and permissions at an organization level, rather than at an individual level.

Let's look at enabling APIs as services for your project to allow us to use API access to services. APIs are automatically enabled whenever you try to launch a service using the console. For example, if you attempt to deploy a Google Compute Engine virtual machine, the initialization of that service will enable the Google Cloud Compute API:

  1. Go to Menu | API's and Services | Dashboard:

All APIs associated with services are disabled by default and you can enable specific ones as required by your application.

  1. Click on ENABLE APIS AND SERVICES and search for the Google Cloud Compute API. Click Enable. You can also click on Try this API to test the API through the browser console.

Once the API is enabled, you will see all the info related to this API in the dashboard. You can even choose to disable the API if needed:

API in the dashboard

Using the command line

Let's look at using the gcloud command to create a project. gcloud is part of the Google Cloud SDK. You will need to download and install it on your machine in order to use the gcloud commands from your terminal. Alternatively, you may use the cloud shell console from within the browser. Go to https://cloud.google.com/sdk/downloads to download the relevant package as it applies to your machine and install it:

  1. Once you have installed the SDK on your machine, we need to initialize it. This is done by running the gcloud init command to perform the initial setup tasks. If you ever need to change a setting or create a new configuration, simply re-run gcloud init.
  2. Open the terminal on your machine and type gcloud init. This opens a browser to allow you to log in to your account. If you want to avoid the browser, type gcloud init --console-only.
  3. If you use the -console-only flag, then copy and paste the browser URL in the terminal and then copy the key back into the console:
  1. Enter the numeric choice for the project to use. To create new project, type 2:

  1. Enter a unique project ID and click Enter. This will create a new project.
  2. To list all projects, type gcloud projects list:

Summary

We are off to a good start with a brief understanding of the history of GCP and its services. We looked at all the data center regions where GCP is offered and discussed their aspects and also a list of services. We also spent time creating a free tier account and explored the GCP console and created projects.

In Chapter 2, Google Cloud Platform Compute, we will look into learning about GCP Compute and its various aspects.

Left arrow icon Right arrow icon

Key benefits

  • Discover new techniques to administer, manage, and deploy applications on GCP
  • Understand effective solutions for storing, retrieving, and deploying your container images
  • Explore various offerings of GCP for operations and security

Description

On-premise data centers are costly to manage. If you need a data center but don’t want to deal with a physical one, Google Cloud Platform (GCP) is the solution. With GCP, you can build, test, and deploy applications on Google’s infrastructure. Google Cloud Platform Administration begins with GCP fundamentals, with the help of which you will deploy your first app and gain an understanding of Google Cloud architecture and services. Furthermore, you will learn how to manage Compute, networking, and storage resources. As you make your way through the book, you will learn how to track and manage GCP’s usage, monitoring, and billing access control. You will also be able to manage your GCP's access and permissions. In the concluding chapters, you will explore a list of different developer tools for managing and interacting with the GCP platform. By the end of this book, you will have learned how to effectively deploy workloads on GCP.

What you will learn

Understand all GCP Compute components Deploy and manage multiple GCP storage options Manage and utilize the networking resources offered by GCP Explore the functionalities and features of the GCP Container Understand the workings of GCP operations such as monitoring and error reporting Discover an immune GCP using its identity and security options

Product Details

Country selected

Publication date : Sep 29, 2018
Length 230 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781788624350
Vendor :
Google

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details


Publication date : Sep 29, 2018
Length 230 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781788624350
Vendor :
Google

Table of Contents

11 Chapters
Preface Chevron down icon Chevron up icon
1. Introduction to Google Cloud Platform Chevron down icon Chevron up icon
2. Google Cloud Platform Compute Chevron down icon Chevron up icon
3. Google Cloud Platform Storage Chevron down icon Chevron up icon
4. Google Cloud Platform Networking Chevron down icon Chevron up icon
5. Google Cloud Platform Containers Chevron down icon Chevron up icon
6. Google Cloud Platform Operations Chevron down icon Chevron up icon
7. Google Cloud Platform Identity and Security Chevron down icon Chevron up icon
8. Google Cloud Platform Billing Chevron down icon Chevron up icon
9. Google Cloud Platform Tools Chevron down icon Chevron up icon
10. Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Top Reviews
No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.