Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Kubernetes - A Complete DevOps Cookbook
Kubernetes - A Complete DevOps Cookbook

Kubernetes - A Complete DevOps Cookbook: Build and manage your applications, orchestrate containers, and deploy cloud-native services

eBook
Mex$179.99 Mex$721.99
Paperback
Mex$902.99
Subscription
Free Trial

What do you get with a Packt Subscription?

Free for first 7 days. $19.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

Kubernetes - A Complete DevOps Cookbook

Operating Applications on Kubernetes

In this chapter, we will discuss the provisioning tools available to deploy cloud-native applications on Kubernetes. You will learn how to deploy DevOps tools and CI/CD (short for continuous integration/continuous delivery or continuous deployment) infrastructure on Kubernetes using the most popular life cycle management options. You will gain the skills to perform Day 1 and some Day 2 operations, such as installing, upgrading, and version controlling Deployments, ruling out a new application, and removing Deployments when they are no longer needed.

In this chapter, we will be covering the following topics:

  • Deploying workloads using YAML files
  • Deploying workloads using Customize
  • Deploying workloads using Helm charts
  • Deploying and operating applications using Kubernetes operators
  • Deploying and managing the life cycle of Jenkins X
  • Deploying...

Technical requirements

Recipes in this section assume that you have a functional Kubernetes cluster deployed following one of the recommended methods described in Chapter 1, Building Production-Ready Kubernetes Clusters.

The Kubernetes Operations tool kubectl will be used for the rest of the recipes in this section since it's the main command-line interface for running commands against Kubernetes clusters. If you are using a Red Hat OpenShift cluster, you can replace kubectl with oc and all commands are expected to function similarly.

Deploying workloads using YAML files

In this section, we will create the resource configurations required to deploy your applications in Kubernetes. You will learn how to create a Kubernetes manifest, deploy a workload, and roll out a new version using Yet Another Markup Language (YAML) files.

Getting ready

Before you start, clone the repository of the examples used in this chapter:

$ git clone https://github.com/k8sdevopscookbook/src.git

Make sure you have a Kubernetes cluster ready and kubectl configured to manage the cluster resources.

How to do it…

This section is further divided into the following subsections to ease the process:

  • Creating a Deployment
  • Verifying a Deployment
  • Editing a Deployment
  • Rolling back a Deployment
  • Deleting a Deployment

Creating a Deployment

This recipe will take you through instructions to create a Deployment using a manifest file that keeps a set of pods running. Deployments are used to declare how many replicas of a pod should be running. A Deployment...

Deploying workloads using Kustomize

In this section, we will show you how to generate resources from files and compose and customize collections of resources in Kubernetes. You will learn about the declarative management of Kubernetes objects using Kustomize.

Getting ready

Make sure you have a Kubernetes cluster ready and kubectl configured to manage the cluster resources.

The source files created in this section can be found on my GitHub repository located at https://github.com/k8sdevopscookbook/src/tree/master/chapter2/kustomize. It is recommended that you follow the instructions to create and edit them and only use the files in the repository to compare with your files if you run into an issue.

How to do it…

This section is further divided into the following subsections to ease the process:

  • Validating the Kubernetes cluster version
  • Generating Kubernetes resources from files
  • Creating a base for a development and production Deployment

Validating the Kubernetes cluster version...

Deploying workloads using Helm charts

In this section, we will show you how to use Helm charts in Kubernetes. Helm is the package manager for Kubernetes, which helps developers and SREs to easily package, configure, and deploy applications.

You will learn how to install Helm on your cluster and use Helm to manage the life cycle of third-party applications.

Getting ready

Make sure you have a Kubernetes cluster ready and kubectl configured to manage the cluster resources.

How to do it…

This section is further divided into the following subsections to ease the process:

  • Installing Helm 2.x
  • Installing an application using Helm charts
  • Searching for an application in Helm repositories
  • Updating an application using Helm
  • Rolling back an application using Helm
  • Adding new Helm repositories
  • Deleting an application using Helm
  • Building a Helm chart

Installing Helm 2.x

Let's perform the following steps to configure the prerequisites and install Helm:

  1. Create a ServiceAccount by using...

Deploying and operating applications using Kubernetes operators

Kubernetes operators are another method of bundling, deploying, and managing application for Kubernetes. Operators are a bit more complex than a package manager like Helm. An operator helps to remove manual steps, application-specific preparation, and post-deployment steps, and even automates second-day operations such as scaling or upgrading them for the user.

As an example, an application's requirements might be validated differently based on the platform on which it is installed or may require changes to its configuration and interaction with external systems.

In this section, we will deploy two operators for popular stateful applications based on two different operator frameworks and learn what functionalities they offer.

Getting ready

Make sure you have a Kubernetes cluster ready and kubectl configured to manage the cluster resources.

How to do it…

This section is further divided into the following subsections...

Deploying and managing the life cycle of Jenkins X

Jenkins X is an open source solution that offers software developers pipeline automation, built-in GitOps, CI, automated testing, and CD, known as CI/CD, in Kubernetes. Jenkins X is highly focused on accelerating software delivery at a large scale using the Kubernetes ecosystem.

In this section, we will focus on Jenkins X recipes and create a Kubernetes cluster with CI/CD capabilities on your cloud provider.

Getting ready

In the following recipes, you will learn how to create a static Jenkins Server to deploy Kubernetes clusters with pipeline automation and automated CI/CD with GitOps promotion and preview environments.

This recipe requires kubectl and Helm. For this recipe, we will use GKE (short for Google Kubernetes Engine), therefore the gcloud CLI tool needs to be installed as well. You also need to have a proper GitHub organization and GitHub account created.

How to do it...

This section is further divided into the following...

Deploying and managing the life cycle of GitLab

GitLab is a complete DevOps tool chain, delivered in a single application platform. GitLab provides all the necessary tooling you need to manage, plan, create, verify, package, release, configure, monitor, and secure your applications.

In this section, we will cover the deployment and life cycle management of GitLab using Helm charts.

Getting ready

In the following recipe, you will learn how to install GitLab on an existing Kubernetes cluster where you can manage the entire DevOps life cycle.

This recipe requires kubectl and Helm, as well as an existing Kubernetes cluster. For this recipe, we will use the cluster we deployed on AWS in Chapter 1, Building Production-Ready Kubernetes Clusters. You should be able to run the same recipe on any Kubernetes cluster version 1.11 or higher with a minimum of 6vCPU and 16 GB of RAM.

How to do it...

This section is further divided into the following subsections to ease the process:

  • Installing GitLab...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Implement Kubernetes to orchestrate and scale applications proficiently
  • Leverage the latest features of Kubernetes to resolve common as well as complex problems in a cloud-native environment
  • Gain hands-on experience in securing, monitoring, and troubleshooting your application

Description

Kubernetes is a popular open source orchestration platform for managing containers in a cluster environment. With this Kubernetes cookbook, you’ll learn how to implement Kubernetes using a recipe-based approach. The book will prepare you to create highly available Kubernetes clusters on multiple clouds such as Amazon Web Services (AWS), Google Cloud Platform (GCP), Azure, Alibaba, and on-premises data centers. Starting with recipes for installing and configuring Kubernetes instances, you’ll discover how to work with Kubernetes clients, services, and key metadata. You’ll then learn how to build continuous integration/continuous delivery (CI/CD) pipelines for your applications, and understand various methods to manage containers. As you advance, you’ll delve into Kubernetes' integration with Docker and Jenkins, and even perform a batch process and configure data volumes. You’ll get to grips with methods for scaling, security, monitoring, logging, and troubleshooting. Additionally, this book will take you through the latest updates in Kubernetes, including volume snapshots, creating high availability clusters with kops, running workload operators, new inclusions around kubectl and more. By the end of this book, you’ll have developed the skills required to implement Kubernetes in production and manage containers proficiently.

Who is this book for?

This Kubernetes book is for developers, IT professionals, and DevOps engineers and teams who want to use Kubernetes to manage, scale, and orchestrate applications in their organization. Basic understanding of Kubernetes and containerization is necessary.

What you will learn

  • Deploy cloud-native applications on Kubernetes
  • Automate testing in the DevOps workflow
  • Discover and troubleshoot common storage issues
  • Dynamically scale containerized services to manage fluctuating traffic needs
  • Understand how to monitor your containerized DevOps environment
  • Build DevSecOps into CI/CD pipelines

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 13, 2020
Length: 584 pages
Edition : 1st
Language : English
ISBN-13 : 9781838828042
Vendor :
Google
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.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 : Mar 13, 2020
Length: 584 pages
Edition : 1st
Language : English
ISBN-13 : 9781838828042
Vendor :
Google
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 3,672.97
Mastering Kubernetes
Mex$1640.99
Kubernetes and Docker - An Enterprise Guide
Mex$1128.99
Kubernetes - A Complete DevOps Cookbook
Mex$902.99
Total Mex$ 3,672.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Building Production-Ready Kubernetes Clusters Chevron down icon Chevron up icon
Operating Applications on Kubernetes Chevron down icon Chevron up icon
Building CI/CD Pipelines Chevron down icon Chevron up icon
Automating Tests in DevOps Chevron down icon Chevron up icon
Preparing for Stateful Workloads Chevron down icon Chevron up icon
Disaster Recovery and Backup Chevron down icon Chevron up icon
Scaling and Upgrading Applications Chevron down icon Chevron up icon
Observability and Monitoring on Kubernetes Chevron down icon Chevron up icon
Securing Applications and Clusters Chevron down icon Chevron up icon
Logging with Kubernetes Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(4 Ratings)
5 star 75%
4 star 0%
3 star 25%
2 star 0%
1 star 0%
valleyguy Mar 19, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great coverage of common Kubernetes and DevOps tools. I've learned about some of the tools I haven't used before like Jenkins X, GitLab, Fossa, Trivy, Litmus Chaos etc.Although some of the long YAML files are provided in the GitHub repository I got the digital version, makes it easier to copy paste.
Amazon Verified review Amazon
Robotica Apr 28, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
There are so many "base" Kubernetes books out there - they cover the basic Kubernetes objects, which is great, but there needs to be more books on the add-ons that most people will encounter once they have a cluster up and running.This book covers many of the topics that people often search the internet for - Backups, CI/CD, Security, etc... You may find a Blog on a topic but it doesnt detail how to deploy anything. You may find a script to install something, but you have no idea what it did or why it creates certain objects. Aside from all of that, it takes time to track the information down and then you have to hope whoever posted the details understands what they created and if its correct.Finally there is a book that is well written and covers a broad range of topics - It wont put you to sleep, each section has a great summary of the topic and then details deploying a solution for the topic. I love the cookbook style books, being an Engineer and IT guy, Im all for "wordy" books when they make sense, but lets face it, not everyone wants to read that much information on a topic. Most people also learn better when they are involved with hands-on exercises and this book delivers!If you want to go beyond the basic Kubeadm, KinD, etc... Clusters - you will find this book VERY useful and informative.
Amazon Verified review Amazon
Michael Apr 21, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Short and to the point recipes to help you get the general idea. Not a in depth explanation, but shows you how to configure most relevant DevOps software & platforms, and is a great way to get a good idea of what is needed to get started. Links to more in depth information at the end of each section. Great book - just what I was looking for.
Amazon Verified review Amazon
Patricio Oct 03, 2021
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
If you are starting to know k8s this may be a good book for you. You have a little how-to in many flavors. On the other hand, if you expect production grade insights (like me) this book is not a good fit.
Amazon Verified review Amazon
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.