Cover Title Page Copyright and Credits About Packt Contributors Table of Contents Preface Section 1: App Engine Chapter 1: Introducing App Engine Introducing GAE Why go serverless with App Engine? Who is the target audience? Understanding the App Engine framework App Engine components Task queues Memcache Data storage Cloud Datastore Cloud SQL Handling auto-scaling on App Engine Defining App Engine components Runtime languages supported App Engine – Standard App Engine – Flexible Understanding App Engine features Application versioning Traffic splitting Monitoring, logging, and diagnostics Summary Questions Further reading Chapter 2: Developing with App Engine Building an application on GAE Qwiklabs Getting started Selecting a region Selecting a language runtime and environment Working with the GCloud SDK Building and deploying a sample application Wrapping up Understanding deployment strategies Creating a new version Traffic splitting Migrating traffic Wrapping up Troubleshooting App Engine deployments Building and deploying Basic mode Advanced filter Wrapping up Summary Questions Further reading Section 2: Google Cloud Functions Chapter 3: Introducing Lightweight Functions Technical requirements Operational management tools Cloud Tasks Cloud Scheduler Introducing Cloud Functions Developing a Cloud Functions-based application App version 1 – introducing Cloud Functions App version 2 – migrating to Cloud Shell App version 3 – adding a view App version 4 – decoupling HTML output App version 5 – extending the RSS reader Summary Questions Further reading Chapter 4: Developing Cloud Functions Technical requirements Introducing Google Cloud Functions Defining the use cases Processing with backend services Processing with real-time data Developing with the Functions Framework Introducing the Functions Framework Deploying an application locally with the Functions Framework Deploying an application to the cloud with the Functions Framework Exploring the Cloud Functions workflow Cloud Function properties Authentication Source control Working with different runtime languages Node.js Python Go Testing the runtime triggering event Stackdriver Understanding the HTTP protocol Defining GET/POST methods Unmasking HTTP response codes Working with Cross-Origin Resource Sharing (CORS) Summary Questions Further reading Chapter 5: Exploring Functions as a Service Technical requirements Developing an HTTP endpoint application Triggering Cloud Pub/Sub Triggering Cloud Storage Exploring Cloud Functions and Google APIs General architecture Frontend service Backend service Exploring Google Cloud Storage events General architecture Frontend service Storage service Building an enhanced signed URL service Frontend service Backend service Summary Questions Further reading Chapter 6: Cloud Functions Labs Technical requirements Building a static website Provisioning the environment Creating a data source Designing a frontend Analyzing a Cloud Function Service account security Economic limits Insecure credential storage Execution flow manipulation FunctionShield Summary Questions Further reading Section 3: Google Cloud Run Chapter 7: Introducing Cloud Run Technical requirements Working with microservices Asynchronous event processing pattern Synchronous event processing pattern Working with containers Leveraging Docker Populating Container Registry Using Cloud Build Introducing Cloud Run gVisor Knative Cloud Run versus Cloud Run for Anthos Summary Questions Further reading Chapter 8: Developing with Cloud Run Technical requirements Exploring the Cloud Run dashboard Developing with Cloud Run Building a Representation State Transfer (REST) API Base URL Requirements Implementing a base URL API consistency Requirements Implementing API consistency Error handling Requirements Error handling API versioning Requirements Express versioning with routing Developer productivity Cloud Source Repository Cloud Build The continuous integration example Summary Questions Further reading Chapter 9: Developing with Cloud Run for Anthos Technical requirements Identity and policy management IAM objects Members Roles Overview of Google Kubernetes Engine Differentiating Cloud Run from Cloud Run for Anthos Using Cloud Run for Anthos Provisioning GKE Custom networking on GKE Internal networking External networking Deploying Cloud Run for Anthos Continuous deployment Applying a domain Troubleshooting with Stackdriver Deleting the cluster Summary Questions Further reading Chapter 10: Cloud Run Labs Technical requirements Building a container Creating a service Testing the announce service Deploying Cloud Run on GKE Provisioning a GKE cluster Testing the GKE service Applying a custom domain Creating a simple web application CI on GKE Summary Questions Further reading Section 4: Building a Serverless Workload Chapter 11: Building a PDF Conversion Service Technical requirements Pet Theory case study overview Designing a document service Storing document information Handling processing requests Securing service access Processing document conversations Developing a document service Storing document information Developing a Cloud Run service Developing the service Deploying the service Securing service access Creating a service account Handling processing requests Testing the document service Summary Questions Further reading Chapter 12: Consuming Third-Party Data via a REST API Technical requirements An overview of the Pet Theory case study Designing a lab report solution Report collation Message handling Email communication SMS communication Developing the lab solution Linking to Google Docs Report collation Email/SMS communication Email SMS The continuous integration workflow Configuring Lab Service CI Triggering Cloud Build Triggering email and SMS Testing a lab service Accessing the credentials Setting up the email Cloud Pub/Sub subscription Setting up the SMS Cloud Pub/Sub subscription Testing the service Summary Questions Further reading Assessments Other Books You May Enjoy Index Effectively deploy fully managed workloads using Google Cloud's serverless services Key Features Use real-world use cases to understand the core functionalities of Functions as a Service Explore the potential of Cloud Run, Knative, Cloud Build, Google Kubernetes Engine, and Cloud Storage Get to grips with architectural decisions, seamless deployments, containerization, and serverless solutions Book Description Google Cloud's serverless platform allows organizations to scale fully managed solutions without worrying about the underlying infrastructure. With this book, you will learn how to design, develop, and deploy full stack serverless apps on Google Cloud. The book starts with a quick overview of the Google Cloud console, its features, user interface (UI), and capabilities. After getting to grips with the Google Cloud interface and its features, you will explore the core aspects of serverless products such as Cloud Run, Cloud Functions and App Engine. You will also learn essential features such as version control, containerization, and identity and access management with the help of real-world use cases. Later, you will understand how to incorporate continuous integration and continuous deployment (CI/CD) techniques for serverless applications. Toward the concluding chapters, you will get to grips with how key technologies such as Knative enable Cloud Run to be hosted on multiple platforms including Kubernetes and VMware. By the end of this book, you will have become proficient in confidently developing, managing, and deploying containerized applications on Google Cloud. What you will learn Explore the various options for deploying serverless workloads on Google Cloud Determine the appropriate serverless product for your application use case Integrate multiple lightweight functions to build scalable and resilient services Increase productivity through build process automation Understand how to secure serverless workloads using service accounts Build a scalable architecture with Google Cloud Functions and Cloud Run Who this book is for If you are a cloud administrator, architect, or developer who wants to build scalable systems and deploy serverless workloads on Google Cloud, then this book is for you. To get the most out of this book, a basic understanding of the serverless ecosystem and cloud computing will be beneficial. Table of Contents Introducing App Engine Developing with App Engine Introducing Lightweight Functions Developing Cloud Functions Exploring Functions as a Service Cloud Functions Labs Introducing Cloud Run Developing with Cloud Run Developing with Cloud Run for Anthos Cloud Run Labs Building a PDF Conversion Service Consuming Third-Party Data via a REST API BEffectively deploy fully managed workloads using Google Cloud's serverless services/b h4Key Features/h4 ulliUse real-world use cases to understand the core functionalities of Functions as a Service /li liExplore the potential of Cloud Run, Knative, Cloud Build, Google Kubernetes Engine, and Cloud Storage /li liGet to grips with architectural decisions, seamless deployments, containerization, and serverless solutions/li/ul h4Book Description/h4 Google Cloud's serverless platform allows organizations to scale fully managed solutions without worrying about the underlying infrastructure. With this book, you will learn how to design, develop, and deploy full stack serverless apps on Google Cloud. The book starts with a quick overview of the Google Cloud console, its features, user interface (UI), and capabilities. After getting to grips with the Google Cloud interface and its features, you will explore the core aspects of serverless products such as Cloud Run, Cloud Functions and App Engine. You will also learn essential features such as version control, containerization, and identity and access management with the help of real-world use cases. Later, you will understand how to incorporate continuous integration and continuous deployment (CI/CD) techniques for serverless applications. Toward the concluding chapters, you will get to grips with how key technologies such as Knative enable Cloud Run to be hosted on multiple platforms including Kubernetes and VMware. By the end of this book, you will have become proficient in confidently developing, managing, and deploying containerized applications on Google Cloud. h4What you will learn/h4 ulliExplore the various options for deploying serverless workloads on Google Cloud /li liDetermine the appropriate serverless product for your application use case /li liIntegrate multiple lightweight functions to build scalable and resilient services /li liIncrease productivity through build process automation /li liUnderstand how to secure serverless workloads using service accounts /li liBuild a scalable architecture with Google Cloud Functions and Cloud Run/li/ul h4Who this book is for/h4 If you are a cloud administrator, architect, or developer who wants to build scalable systems and deploy serverless workloads on Google Cloud, then this book is for you. To get the most out of this book, a basic understanding of the serverless ecosystem and cloud computing will be beneficial