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
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Kubernetes – An Enterprise Guide
Kubernetes – An Enterprise Guide

Kubernetes – An Enterprise Guide: Effectively containerize applications, integrate enterprise systems, and scale applications in your enterprise , Second Edition

Arrow left icon
Profile Icon Marc Boorshtein Profile Icon Scott Surovich
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (35 Ratings)
Paperback Dec 2021 578 pages 2nd Edition
eBook
$43.99 $63.99
Paperback
$79.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Marc Boorshtein Profile Icon Scott Surovich
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (35 Ratings)
Paperback Dec 2021 578 pages 2nd Edition
eBook
$43.99 $63.99
Paperback
$79.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$43.99 $63.99
Paperback
$79.99
Subscription
Free Trial
Renews at $19.99p/m

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 – An Enterprise Guide

Deploying Kubernetes Using KinD

One of the largest obstacles to learning Kubernetes is having enough resources to create a cluster for testing or development. Like most IT professionals, we like to have a Kubernetes cluster on our laptops for demonstrations and for testing products in general.

Often, you may have a need to run a multiple node cluster, or multiple clusters for a complex demonstration or testing, such as a multi-cluster service mesh. These scenarios would require multiple servers to create the necessary clusters, which, in turn, would require a lot of RAM and a hypervisor.

To do full testing on a multiple cluster scenario, you would need to create multiple nodes for each cluster. If you created the clusters using virtual machines, you would need to have enough resources to run the virtual machines. Each of the machines would have an overhead including disk space, memory, and CPU utilization.

But what if you could create a cluster using just containers? Using...

Technical requirements

This chapter has the following technical requirements:

  • A Docker host installed using the steps from Chapter 1, Docker and Container Essentials
  • Installation scripts from this book's GitHub repository

You can access the code for this chapter by going to this book's GitHub repository: https://github.com/PacktPublishing/Kubernetes---An-Enterprise-Guide-2E/tree/main/chapter2.

We thought it was important to point out that this chapter will reference multiple Kubernetes objects, some without a lot of context. Chapter 3, Kubernetes Bootcamp, goes over Kubernetes objects in detail, many with commands you can use to understand them, so we thought having a cluster to use while reading about this would be useful.

Most of the base Kubernetes topics covered in this chapter will be discussed in future chapters, so if some topics may be a bit foggy after you've read this chapter, don't fear! They will be discussed...

Introducing Kubernetes components and objects

Since this chapter will refer to common Kubernetes objects and components, we wanted to provide a short table of terms that you will see and a brief definition of each to provide context.

In Chapter 3, Kubernetes Bootcamp, we will go over the components of Kubernetes and the base set of objects that are included in a cluster. We will also discuss how to interact with a cluster using the kubectl executable:

Table 2.1: Kubernetes components and objects

While these are only a few of the objects that are available in a Kubernetes cluster, they are the main objects we will mention in this chapter. Knowing what each resource is and having basic knowledge of their functionality will help you understand this chapter and deploy a KinD cluster.

Interacting with a cluster

To test our KinD installation, we will interact with the cluster using the kubectl executable. We will go over kubectl in Chapter 3, Kubernetes Bootcamp...

Using development clusters

Over the years, various tools have been created to install development Kubernetes clusters, allowing admins and developers to perform testing on a local system. Many of these tools worked for basic Kubernetes tests, but they often had limitations that made them less than ideal for quick, advanced scenarios.

Some of the most common solutions available are as follows:

  • Docker Desktop
  • Rancher Desktop
  • minikube
  • kubeadm
  • K3s

Each solution has benefits, limitations, and use cases. Some solutions limit you to a single node that runs both the control plane and worker nodes. Others offer multi-node support but require additional resources to create multiple virtual machines. Depending on your development or testing requirements, these solutions may not meet your needs completely.

It seems that a new solution is coming out every few weeks, and one of the newest options for creating development clusters is a project...

Installing KinD

The files for this chapter are located in the KinD directory. You can use the provided files, or you can create your own files from this chapter's content. We will explain each step of the installation process in this section.

At the time of writing, the current version of KinD is 0.11.0, supporting Kubernetes clusters up to 1.21.1

Installing KinD – prerequisites

KinD can be installed using a few different methods, but the easiest and quickest way to start building KinD clusters is to download the KinD binary and the standard Kubernetes kubectl executable to interact with the cluster.

Installing kubectl

Since KinD is a single executable, it does not install kubectl. If you do not have kubectl installed and you are using an Ubuntu 20.04 system, you can install it by running snap install, or you may download it from Google directly.

To install kubectl using snap, you only need to run a single command:

sudo snap install...

Creating a KinD cluster

Now that you have met all the requirements, you can create your first cluster using the KinD executable. The KinD utility can create a single-node cluster, as well as a complex cluster that's running multiple nodes for the control plane with multiple worker nodes. In this section, we will discuss the KinD executable options. By the end of the chapter, you will have a two-node cluster running – a single control plane node and a single worker node.

For the exercises in this book, we will install a multi-node cluster. The simple cluster configuration is an example and should not be used for our exercises.

Creating a simple cluster

To create a simple cluster that runs the control plane and a worker node in a single container, you only need to execute the KinD executable with the create cluster option.

Let's create a quick single-node cluster to see how quickly KinD creates a fast development cluster. On your host, create...

Reviewing your KinD cluster

With a Kubernetes cluster now available, we have the ability to look at Kubernetes objects first-hand. This will help you understand the next chapter, Kubernetes Bootcamp, where we will cover many of the base objects included in a Kubernetes cluster. While we will explain most objects in the next chapter, we need to introduce the objects that Kubernetes uses to provide storage. In the next section we introduce the objects included with KinD that provide persistent storage to your workloads. In particular, we will discuss the storage objects that are included with your KinD cluster.

KinD storage objects

Remember that KinD includes Rancher's auto-provisioner to provide automated persistent disk management for the cluster. Kubernetes has a number of storage objects, there is one object that the auto-provisioner does not require since it uses a base Kubernetes feature: it does not require a CSIdriver. Since the ability to use local host paths as...

Adding a custom load balancer for Ingress

This section is a complex topic that covers adding a custom HAProxy container that you can use to load balance worker nodes in a KinD cluster. You should not deploy these steps on the KinD cluster that we will use for the remaining chapters.

We added this section for anybody that may want to know more about how to load balance between multiple worker nodes.

KinD does not include a load balancer for worker nodes. The included HAProxy container only creates a configuration file for the API server; the team does not officially support any modifications to the default image or configuration. Since you will interact with load balancers in your everyday work, we wanted to add a section on how to configure your own HAProxy container in order to load balance between three KinD nodes.

First, we will not use this configuration for any of chapters in this book. We want to make the exercises available to everyone, so to limit...

Summary

In this chapter, you learned about the Kubernetes SIG project called KinD. We went into details on how to install optional components in a KinD cluster, including Calico as the CNI and NGINX as the Ingress controller. Finally, we covered the details of the Kubernetes storage objects that are included with a KinD cluster.

Hopefully, with the help of this chapter, you now understand the power that using KinD can bring to you and your organization. It offers an easy-to-deploy, fully configurable Kubernetes cluster. The number of running clusters on a single host is theoretically limited only by the host resources.

In the next chapter, we will dive into Kubernetes objects. We've called the next chapter Kubernetes Bootcamp since it will cover the majority of the base Kubernetes objects and what each one is used for. The next chapter can be considered a "Kubernetes pocket guide." It contains a quick reference to Kubernetes objects and what they do, as well...

Questions

  1. What object must be created before you can create a PersistentVolumeClaim?
    1. PVC
    2. Disk
    3. PersistentVolume
    4. VirtualDisk
  2. KinD includes a dynamic disk provisioner. Which company created the provisioner?
    1. Microsoft
    2. CNCF
    3. VMware
    4. Rancher
  3. If you created a KinD cluster with multiple worker nodes, what would you install to direct traffic to each node?
    1. Load balancer
    2. Proxy server
    3. Nothing
    4. Network load balancer
  4. True or false: A Kubernetes cluster can only have one CSIdriver installed.
    1. True
    2. False

Join our book's Discord space

Join the book's Discord workspace for a monthly Ask me Anything session with the authors:

https://packt.link/K8EntGuide

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Extensively revised edition to cover the latest updates and new releases along with two new chapters to introduce Istio
  • Get a firm command of Kubernetes from a dual perspective of an admin as well as a developer
  • Understand advanced topics including load balancing, externalDNS, global load balancing, authentication integration, policy, security, auditing, backup, Istio and CI/CD

Description

Kubernetes has taken the world by storm, becoming the standard infrastructure for DevOps teams to develop, test, and run applications. With significant updates in each chapter, this revised edition will help you acquire the knowledge and tools required to integrate Kubernetes clusters in an enterprise environment. The book introduces you to Docker and Kubernetes fundamentals, including a review of basic Kubernetes objects. You’ll get to grips with containerization and understand its core functionalities such as creating ephemeral multinode clusters using KinD. The book has replaced PodSecurityPolicies (PSP) with OPA/Gatekeeper for PSP-like enforcement. You’ll integrate your container into a cloud platform and tools including MetalLB, externalDNS, OpenID connect (OIDC), Open Policy Agent (OPA), Falco, and Velero. After learning to deploy your core cluster, you’ll learn how to deploy Istio and how to deploy both monolithic applications and microservices into your service mesh. Finally, you will discover how to deploy an entire GitOps platform to Kubernetes using continuous integration and continuous delivery (CI/CD).

Who is this book for?

This book is for anyone interested in DevOps, containerization, and going beyond basic Kubernetes cluster deployments. DevOps engineers, developers, and system administrators looking to enhance their IT career paths will also find this book helpful. Although some prior experience with Docker and Kubernetes is recommended, this book includes a Kubernetes bootcamp that provides a description of Kubernetes objects to help you if you are new to the topic or need a refresher.

What you will learn

  • Create a multinode Kubernetes cluster using KinD
  • Implement Ingress, MetalLB, ExternalDNS, and the new sandbox project, K8GBConfigure a cluster OIDC and impersonation
  • Deploy a monolithic application in Istio service mesh
  • Map enterprise authorization to Kubernetes
  • Secure clusters using OPA and GateKeeper
  • Enhance auditing using Falco and ECK
  • Back up your workload for disaster recovery and cluster migration
  • Deploy to a GitOps platform using Tekton, GitLab, and ArgoCD

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 22, 2021
Length: 578 pages
Edition : 2nd
Language : English
ISBN-13 : 9781803230030
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 : Dec 22, 2021
Length: 578 pages
Edition : 2nd
Language : English
ISBN-13 : 9781803230030
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 $5 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 $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 224.97
The Kubernetes Bible
$64.99
Kubernetes – An Enterprise Guide
$79.99
Mastering Kubernetes
$79.99
Total $ 224.97 Stars icon

Table of Contents

16 Chapters
Docker and Container Essentials Chevron down icon Chevron up icon
Deploying Kubernetes Using KinD Chevron down icon Chevron up icon
Kubernetes Bootcamp Chevron down icon Chevron up icon
Services, Load Balancing, ExternalDNS, and Global Balancing Chevron down icon Chevron up icon
Integrating Authentication into Your Cluster Chevron down icon Chevron up icon
RBAC Policies and Auditing Chevron down icon Chevron up icon
Deploying a Secured Kubernetes Dashboard Chevron down icon Chevron up icon
Extending Security Using Open Policy Agent Chevron down icon Chevron up icon
Node Security with GateKeeper Chevron down icon Chevron up icon
Auditing Using Falco, DevOps AI, and ECK Chevron down icon Chevron up icon
Backing Up Workloads Chevron down icon Chevron up icon
An Introduction to Istio Chevron down icon Chevron up icon
Building and Deploying Applications on Istio Chevron down icon Chevron up icon
Provisioning a Platform Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6
(35 Ratings)
5 star 68.6%
4 star 25.7%
3 star 2.9%
2 star 0%
1 star 2.9%
Filter icon Filter
Top Reviews

Filter reviews by




Alexl Jul 14, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Kubernetes – An Enterprise Guide provides an in-depth exploration and architecture review of common concerns when it comes to deploying and running Kubernetes. The authors explore topics, such routing and deploying L4 and L7 load balancers, RBAC, OIDC, Istio, and many others.I liked the depth of a lot of topics, such as exploring Istio from the Kubernetes' point of view, as well as from the application concerns. The book provides concrete steps for deploying and testing explored concepts on a local Kubernetes cluster (KinD).The authors provide an opinionated approach to the architecture. Since Marc Boorshtein is involved with the company behind OpenUnison, it is understandable that OpenUnison gets featured in the book prominently. It is up to the reader to decide whether to accept such architecture or not; the underlying concepts, however, are explained quite well and are applicable to different OIDC providers as well.The book deals with a fast-moving tech stack, so the instructional steps can get obsolete fairly quickly. Consequently, readers might have to do a bit of their own troubleshooting when it comes to deploying various parts of the Kubernetes stack.I would recommend the book to readers that are looking to deepen their experience with Kubernetes (at least at the level of CKA would be my recommendation). It is definitely worth the read, provided you do not mind the opinionated approach.
Amazon Verified review Amazon
Pratik Dave Sep 05, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is one of the excellent books that I come across to learn Kubernetes basics and advance. The book covers wide range of topics that start with Docker and containers to RBAC , GitOps, Service mesh. Author explains each section in detail and it has been nicely divided in each chapters. The way advanced topics of Kubernetes are explained with example, it made easy to understand for anyone.I would really recommend this book not only who are new to the Kubernetes but it is also a good reference book for seasoned players.
Amazon Verified review Amazon
Bhanu Addanki Apr 21, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Thanks to the authors for this book. Getting started with K8s with a book like this is a great step. I found this book very Worthy and informative. I always used to be distracted while using YouTube for learning. This book solves my problem.
Amazon Verified review Amazon
Jeffrey Chilberto Jul 14, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Thanks to the authors. This comprehensive book on Kubernetes came at the right time.This book starts with the basics and continues to build and build and build. I appreciate the pacing as there is a lot of information covered, and the authors did a great job of not skimming over content. For example, Kubernetes resources are covered thoroughly. I have experienced some books that tend to end up providing nothing more than a list or a repeat of the help content.I would recommend this to those wanting to start using K8s and those with a moderate amount of experience. The scope is huge but all major aspects of hosting a K8s solution are covered from basic operation to networking and security to more complex scenarios using a service mesh. I also found this guide helpful for a PaaS Kubernetes offering (Azure Kubernetes Service).
Amazon Verified review Amazon
Aman Gupta May 10, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The chronology of chapters in this book has been set strategically to increase the complexity as I proceed. The best thing I liked about the book is no alien term is left unexplained. You don't need to google or refer any external material to understand the concepts described in this book.
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.