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
The Kubernetes Bible
The Kubernetes Bible

The Kubernetes Bible: The definitive guide to deploying and managing Kubernetes across cloud and on-prem environments , Second Edition

Arrow left icon
Profile Icon Gineesh Madapparambath Profile Icon Russ McKendrick
Arrow right icon
€18.99 per month
Paperback Nov 2024 720 pages 2nd Edition
eBook
€8.99 €35.99
Paperback
€44.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Gineesh Madapparambath Profile Icon Russ McKendrick
Arrow right icon
€18.99 per month
Paperback Nov 2024 720 pages 2nd Edition
eBook
€8.99 €35.99
Paperback
€44.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €35.99
Paperback
€44.99
Subscription
Free Trial
Renews at €18.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

The Kubernetes Bible

Kubernetes Architecture – from Container Images to Running Pods

In the previous chapter, we laid the groundwork regarding what Kubernetes is from a functional point of view. You should now have a better idea of how Kubernetes can help you manage clusters of machines running containerized microservices. Now, let’s go a little deeper into the technical details. In this chapter, we will examine how Kubernetes enables you to manage containers that are distributed on different machines. Following this chapter, you should have a better understanding of the anatomy of a Kubernetes cluster. In particular, you will have a better understanding of Kubernetes components and know the responsibility of each of them in the execution of your containers.

Kubernetes is made up of several distributed components, each of which plays a specific role in the execution of containers. To understand the role of each Kubernetes component, we will follow the life cycle of a container as it...

Technical requirements

The following are the technical requirements to proceed with this chapter:

  • A basic understanding of the Linux OS and how to handle basic operations in Linux
  • One or more Linux machines

The code and snippets used in the chapter are tested on the Fedora workstation. All the code, commands, and other snippets for this chapter can be found in the GitHub repository at https://github.com/PacktPublishing/The-Kubernetes-Bible-Second-Edition/tree/main/Chapter02.

The name – Kubernetes

Kubernetes derives its name from Greek origins, specifically from the word “kubernētēs,” which translates to helmsman or pilot. This nautical term signifies someone skilled in steering and navigating a ship. The choice of this name resonates with the platform’s fundamental role in guiding and orchestrating the deployment and management of containerized applications, much like a helmsman steering a ship through the complexities of the digital landscape.

In addition to its formal name, Kubernetes is commonly referred to as “K8s” within the community. This nickname cleverly arises from the technique of abbreviating the word by counting the eight letters between the “K” and the “s.” This shorthand not only streamlines communication but also adds a touch of informality to discussions within the Kubernetes ecosystem.

Understanding the difference between the control plane nodes and compute nodes

To run Kubernetes, you will require Linux machines, which are called nodes in Kubernetes. A node could be a physical machine or a virtual machine on a cloud provider, such as an EC2 instance. There are two types of node in Kubernetes:

  • Control plane nodes (also known as master nodes)
  • Compute nodes (also known as worker nodes)

The master and worker nodes

In various contexts, you might encounter the terms “master nodes” and “worker nodes,” which were previously used to describe the conventional hierarchical distribution of roles in a distributed system. In this setup, the “master” node oversaw and assigned tasks to the “worker” nodes. However, these terms may carry historical and cultural connotations that could be perceived as insensitive or inappropriate. In response to this concern, the Kubernetes community has chosen...

Kubernetes components

Kubernetes, by its inherent design, functions as a distributed application. When we refer to Kubernetes, it’s not a standalone, large-scale application released in a single build for installation on a dedicated machine. Instead, Kubernetes embodies a compilation of small projects, each crafted in Go (language), collectively constituting the overarching Kubernetes project.

To establish a fully operational Kubernetes cluster, it’s necessary to individually install and configure each of these components, ensuring seamless communication among them. Once these prerequisites are fulfilled, you can commence running your containers using the Kubernetes orchestrator.

For development or local testing, it is fine to install all of the Kubernetes components on the same machine. However, in production, to meet requirements like high availability, load balancing, distributed computing, scaling, and so on, these components should be spread across different...

The Control Plane Components

In the following sections, let us explore the different control plane components and their responsibilities.

kube-apiserver

Kubernetes’ most important component is a Representational State Transfer (REST) API called kube-apiserver, which exposes all the Kubernetes features. You will be interacting with Kubernetes by calling this REST API through the kubectl command-line tool, direct API calls, or the Kubernetes dashboard (Web UI) utilities.

The role of kube-apiserver

kube-apiserver is a part of the control plane in Kubernetes. It’s written in Go, and its source code is open and available on GitHub under the Apache 2.0 license. To interact with Kubernetes, the process is straightforward. Whenever you want to instruct Kubernetes, you send an HTTP request to kube-apiserver. Whether it’s creating, deleting, or updating a container, you always make these calls to the appropriate kube-apiserver endpoint using the right HTTP...

The compute node components

We will dedicate this part of the chapter to explaining the anatomy of a compute node by explaining the three components running on it:

  • Container engine and container runtime
  • kubelet
  • The kube-proxy component

    kubelet, kube-proxy, and container runtime are essential components for both control plane (master) nodes and worker nodes. We’ll cover them in this section to highlight their functionalities in both contexts.

Container engine and container runtime

A container engine is a software platform designed to oversee the creation, execution, and lifecycle of containers. It offers a more abstract layer compared to a container runtime, streamlining container management and enhancing accessibility for developers. Well-known container engines are Podman, Docker Engine, and CRI-O. In contrast, container runtime is a foundational software component responsible for the creation, execution, and administration...

Exploring the kubectl command-line tool and YAML syntax

kubectl is the official command-line tool used to manage the Kubernetes platform. This is an HTTP client that is fully optimized to interact with Kubernetes and allows you to issue commands to your Kubernetes cluster.

Kubernetes and Linux-Based Learning Environment

For effective learning in Linux containers and related topics, it’s best to use workstations or lab machines with a Linux OS. A good understanding of Linux basics is essential for working with containers and Kubernetes. Using a Linux OS on your workstation automatically places you in the Linux environment, making your learning experience better. You can choose the Linux distribution you prefer, like Fedora, Ubuntu, or another. We’re committed to inclusivity and will offer alternative steps for Windows and macOS users when needed, ensuring a diverse and accessible learning experience for everyone. However, it is not mandatory to have a...

How to make Kubernetes highly available

As you’ve observed earlier, Kubernetes is a clustering solution. Its distributed nature allows it to run on multiple machines. By splitting the different components across different machines, you’ll be able to make your Kubernetes cluster highly available. Next, we will have a brief discussion on the different Kubernetes setups.

The single-node cluster

Installing all Kubernetes components on the same machine is the worst possible idea if you want to deploy Kubernetes in production. However, it is perfectly fine for testing your development. The single-node way consists of grouping all of the different Kubernetes components on the same host or a virtual machine:

Figure 2.9: All of the components are working on the same machine

Typically, this arrangement is seen as a solid beginning for getting into Kubernetes through local testing. There’s a tool called minikube that makes it easy to set up single-node...

Summary

This was quite a big chapter, but at least you now have a list of all the Kubernetes components. Everything we will do later will be related to these components: they are the core of Kubernetes. This chapter was full of technical details too, but it was still relatively theoretical. Don’t worry if things are still not very clear to you. You will gain a better understanding through practice.

The good news is that you are now completely ready to install your first Kubernetes cluster locally, and things are going to be a lot more practical from now on. That is the next step, and that’s what we will do in the next chapter. After the next chapter, you’ll have a Kubernetes cluster running locally on your workstation, and you will be ready to run your first pods using Kubernetes!

Further reading

To learn more about the topics that were covered in this chapter, take a look at the following resources:

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Comprehensive coverage of Kubernetes concepts - from deployment to cluster and resource management
  • Gain insights into the latest cloud-native trends and how they impact your Kubernetes deployments
  • Tap into the collective wisdom of acclaimed Kubernetes experts

Description

Kubernetes has become the go-to orchestration platform for containerized applications. As a Kubernetes user, you know firsthand how powerful yet complex this tool can be. The Kubernetes Bible cuts through the complexity, offering hands-on examples and expert advice to conquer containerization challenges With this new edition, you will master cutting edge security practices, deploy seamlessly and scale effortlessly, ensuring unwavering service availability. You will gain the expertise to craft production-grade applications, secure development environments, navigate complex deployments with ease, and become a security maestro. You will be able to optimize network communication and data management across major cloud platforms. Additionally, this book dives deep into these challenges, offering solutions such as multi-container Pods, advanced security techniques, and expert networking guidance. You will also explore persistent storage advancements, cloud-specific cluster management updates, and best practices for traffic routing By the end of this comprehensive guide, you will possess the skills and knowledge to orchestrate your containerized applications with precision, ensuring their optimal performance and scalability. Stop settling for basic container management. Order your copy today and orchestrate your containers to greatness.

Who is this book for?

Whether you're a software developer, DevOps engineer, or an existing Kubernetes user, this Kubernetes book is your comprehensive guide to mastering container orchestration and services in the cloud. It empowers you to overcome challenges in building secure, scalable, and cloud-native applications using Kubernetes. With a foundational understanding of Kubernetes, Docker, and leading cloud providers (AWS, Azure, GCP) recommended, this book equips you with the knowledge and skills needed to navigate complex deployments and master core Kubernetes concepts and architecture.

What you will learn

  • Secure your Kubernetes clusters with advanced techniques
  • Implement scalable deployments and autoscaling strategies
  • Design and learn to build production-grade containerized applications
  • Manage Kubernetes effectively on major cloud platforms (GKE, EKS, AKS)
  • Utilize advanced networking and service management practices
  • Use Helm charts and Kubernetes Operators for robust security measures
  • Optimize in-cluster traffic routing with advanced configurations
  • Enhance security with techniques like Immutable ConfigMaps and RBAC

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 29, 2024
Length: 720 pages
Edition : 2nd
Language : English
ISBN-13 : 9781835464717
Languages :
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 : Nov 29, 2024
Length: 720 pages
Edition : 2nd
Language : English
ISBN-13 : 9781835464717
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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
Banner background image

Table of Contents

23 Chapters
Kubernetes Fundamentals Chevron down icon Chevron up icon
Kubernetes Architecture – from Container Images to Running Pods Chevron down icon Chevron up icon
Installing Your First Kubernetes Cluster Chevron down icon Chevron up icon
Running Your Containers in Kubernetes Chevron down icon Chevron up icon
Using Multi-Container Pods and Design Patterns Chevron down icon Chevron up icon
Namespaces, Quotas, and Limits for Multi-Tenancy in Kubernetes Chevron down icon Chevron up icon
Configuring Your Pods Using ConfigMaps and Secrets Chevron down icon Chevron up icon
Exposing Your Pods with Services Chevron down icon Chevron up icon
Persistent Storage in Kubernetes Chevron down icon Chevron up icon
Running Production-Grade Kubernetes Workloads Chevron down icon Chevron up icon
Using Kubernetes Deployments for Stateless Workloads Chevron down icon Chevron up icon
StatefulSet – Deploying Stateful Applications Chevron down icon Chevron up icon
DaemonSet – Maintaining Pod Singletons on Nodes Chevron down icon Chevron up icon
Working with Helm Charts and Operators Chevron down icon Chevron up icon
Kubernetes Clusters on Google Kubernetes Engine Chevron down icon Chevron up icon
Launching a Kubernetes Cluster on Amazon Web Services with Amazon Elastic Kubernetes Service Chevron down icon Chevron up icon
Kubernetes Clusters on Microsoft Azure with Azure Kubernetes Service Chevron down icon Chevron up icon
Security in Kubernetes Chevron down icon Chevron up icon
Advanced Techniques for Scheduling Pods Chevron down icon Chevron up icon
Autoscaling Kubernetes Pods and Nodes Chevron down icon Chevron up icon
Advanced Kubernetes: Traffic Management, Multi-Cluster Strategies, and More Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
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.