Skip to main content
main-content

Über dieses Buch

Use this beginner’s guide to understand and work with Kubernetes on the Google Cloud Platform and go from single monolithic Pods (the smallest unit deployed and managed by Kubernetes) all the way up to distributed, fault-tolerant stateful backing stores.

You need only a familiarity with Linux, Bash, and Python to successfully use this book. Proficiency in Docker or cloud technology is not required. You will follow a learn-by-doing approach, running small experiments and observing the effects.

Google open sourced Kubernetes in 2015 and now it is the industry standard in container orchestration. It has been adopted by all leading vendors of cloud, on-prem, and hybrid infrastructure services: Microsoft (Azure AKS), Amazon (AWS EKS), IBM (IBM Cloud Kubernetes Services), Alibaba Cloud (ACK), RedHat (OpenShift), and Pivotal (PKS). Even though Kubernetes is offered by all of the market-leading cloud providers, the Google Cloud Platform (GCP) offers an integrated shell (Google Cloud Shell) and a $300 credit to get started, which makes it the ideal platform to not only learn Kubernetes but also to implement final production workloads.

What You Will Learn

Set up a Kubernetes cluster in GCPDeploy simple Docker images using monolithic PodsArrange highly available and highly scalable applications using DeploymentsAchieve zero-downtime deployments using the Service controllerExternalize configuration using ConfigMaps and SecretsSet up batch processes and recurrent tasks using Jobs and CronJobsInstall horizontal (sidecar pattern) services using DaemonSetsImplement distributed, stateful backing stores using StatefulSets

Who This Book Is For

Beginners with basic Linux admin and scripting skills (Bash and Python). Proficiency with Docker is not required as all examples in the book use off-the-shelf public images from Docker Hub.

Inhaltsverzeichnis

Frontmatter

Chapter 1. Introduction

Abstract
This chapter explains the motivation for learning Kubernetes on the Google Cloud Platform and provides instructions on the use of the Google Cloud Shell, the running of source code examples, and the setting up of a basic Kubernetes cluster.
Ernesto Garbarino

Chapter 2. Pods

Abstract
This chapter introduces the Pod resource type, which is the most fundamental building block in Kubernetes. The reader will learn how to instrument Pods to run, from simple one-off commands to web servers. Operational aspects such as setting up CPU and RAM constraints and the organization of Pods using labels and annotations will also be also be covered. By the end of the chapter, the reader will be capable of running and interacting with applications running in a Kubernetes cluster as though they were running on a local machine.
Ernesto Garbarino

Chapter 3. Deployments and Scaling

Abstract
This chapter helps the reader take Pods to the next level by introducing the Deployment controller which allows the on-demand scaling of Pods and seamless migrations—including blue/green deployments and rollbacks—when upgrading Pod versions. Also, the dynamics of autoscaling are demonstrated using the Horizontal Pod Autoscaler (HPA) controller.
Ernesto Garbarino

Chapter 4. Service Discovery

Abstract
This chapter teaches the reader how to make Pods available on the public Internet as well as within the Kubernetes cluster. In addition, this chapter explains how the Service controller interacts with the Deployment controller to facilitate zero-downtime deployments as well as graceful startup and shutdown of applications.
Ernesto Garbarino

Chapter 5. ConfigMap and Secrets

Abstract
This chapter shows how configuration can be externalized away from applications by storing it using the ConfigMap or Secret controllers. Likewise, the Secrets controller capability of storing Docker Registry credentials and TLS certificates will also be examined.
Ernesto Garbarino

Chapter 6. Jobs

Abstract
This chapter looks at the case of running batch processes—different from steady web servers—using the Job controller. Kubernetes’ parallelization capabilities, which help reduce the total processing time of large, computational-expensive, multiple-item batch jobs are also given special attention.
Ernesto Garbarino

Chapter 7. CronJobs

Abstract
This chapter describes the CronJob controller which can be instrumented to run Jobs in a recurrent manner, and that relies on the same syntax used by the cron daemon’s crontab file found in most Unix-like systems.
Ernesto Garbarino

Chapter 8. DaemonSets

Abstract
This chapter explains how to deploy Pods that are locally available in every Node of a Kubernetes cluster so that consuming Pods can benefit from faster access time either through a local TCP connection or the local file system.
Ernesto Garbarino

Chapter 9. StatefulSets

Abstract
This chapter demonstrates the nature of highly scalable stateful backing services by taking the reader through the process of implementing a primitive key/value store using the StatefulSet controller. By the end of the chapter, the reader will have an appreciation of why cloud native (managed) data stores offer a nearly unbeatable advantage, and the instrumentation mechanisms that the StatefulSet controller offers should the reader choose to roll out their own data store instead.
Ernesto Garbarino

Backmatter

Weitere Informationen

Premium Partner

    Bildnachweise