Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
Can$12.99 Can$49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (35 Ratings)
eBook Dec 2021 578 pages 2nd Edition
eBook
Can$12.99 Can$49.99
Paperback
Can$61.99
Subscription
Free Trial
Arrow left icon
Profile Icon Marc Boorshtein Profile Icon Scott Surovich
Arrow right icon
Can$12.99 Can$49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (35 Ratings)
eBook Dec 2021 578 pages 2nd Edition
eBook
Can$12.99 Can$49.99
Paperback
Can$61.99
Subscription
Free Trial
eBook
Can$12.99 Can$49.99
Paperback
Can$61.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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 : 9781803236094

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 22, 2021
Length: 578 pages
Edition : 2nd
Language : English
ISBN-13 : 9781803236094

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 Can$6 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 Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 233.97
The Kubernetes Bible
Can$69.99
Kubernetes – An Enterprise Guide
Can$61.99
Mastering Kubernetes
Can$101.99
Total Can$ 233.97 Stars icon
Banner background image

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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.