Kubernetes Design Patterns and Extensions
eBook - ePub

Kubernetes Design Patterns and Extensions

Enhance your container-cluster management skills and efficiently develop and deploy applications

  1. 106 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Kubernetes Design Patterns and Extensions

Enhance your container-cluster management skills and efficiently develop and deploy applications

About this book

Master the art of container management with Kubernetes and study robust container orchestration to ensure that your container-based applications sail into production without hiccups

Key Features

  • Implement best practices in cloud-native applications using Kubernetes
  • Explore the usage of client libraries and programmatic access to Kubernetes
  • Use your domain expertise to code

Book Description

Before plunging into how Kubernetes works, this book introduces you to the world of container orchestration and describes the recent changes in application development. You'll understand problems that Kubernetes solves and get to grips with using Kubernetes resources to deploy applications. In addition to this, you'll learn to apply the security model of Kubernetes clusters.

Kubernetes Design Patterns and Extensions describes how services running in Kubernetes can leverage the platform's security features. Once you've grasped all this, you'll explore how to troubleshoot Kubernetes clusters and debug Kubernetes applications. You also discover how to analyze the networking model and its alternatives in Kubernetes, and apply best practices with design patterns.

By the end of this book, you'll have studied all about using the power of Kubernetes for managing your containers.

What you will learn

  • Understand and classify software designs as per the cloud-native paradigm
  • Apply best practices in Kubernetes with design patterns
  • Set up Kubernetes clusters in managed and unmanaged environments
  • Explore Kubernetes extension points
  • Extend Kubernetes with custom resources and controllers
  • Integrate dynamic admission controllers
  • Develop and run custom schedulers in Kubernetes
  • Analyze networking models in Kubernetes

Who this book is for

Kubernetes Design Patterns and Extensions is for you if you are interested in configuring and troubleshooting Kubernetes clusters and developing microservices-based applications on Kubernetes clusters. DevOps engineers with basic knowledge of Docker will also find this book useful. It is assumed that you are comfortable using command-line tools and programming concepts and languages.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Kubernetes Design Patterns and Extensions by Onur Yilmaz in PDF and/or ePUB format, as well as other popular books in Computer Science & Cloud Computing. We have over one million books available in our catalogue for you to explore.

Information

Kubernetes Extensions

Kubernetes is highly customizable and extensible so that any segment of the system can be configured comprehensively and extended with new features. Extension points of Kubernetes do not focus on low-level configuration of the built-in resources, such as pods or stateful sets. However, extending Kubernetes means extending the operations of Kubernetes itself. These extension points enable many practices, including creating new Kubernetes resources, automating Kubernetes and human interactions, and intervening with the creation or editing of resources and their scheduling mechanisms.
In this chapter, extension points and patterns will be presented, and the most common and essential extension points will be covered. Firstly, the Kubernetes API will be enhanced, and human knowledge will be converted into the automation of Kubernetes operators. Secondly, the control access mechanisms of Kubernetes will be extended with webhooks and initializers. Finally, the default scheduler of Kubernetes will be configured with highly customizable options. How to develop and deploy a custom scheduler will also be demonstrated. Throughout these chapters, you should be able to implement and deploy extensions by creating applications that consume the Kubernetes API.

Kubernetes Extension Points

Kubernetes itself and its built-in resources are highly configurable so that any modern cloud-native application can be configured to run on the cloud environment. When it comes to adding new capabilities, converting human knowledge into code and automating more, the Kubernetes extension comes to the rescue. Fortunately, to extend the capabilities of Kubernetes, users do not need to download the source code, make changes, build and deploy the complete system. With its modularity, the extension points of Kubernetes are already defined and ready to use.
Kubernetes extension points focus on the current functionalities of Kubernetes and its environment. Built-in components and how to extend Kubernetes are summarized in the following categories:
  • Kubernetes clients: It is possible to extend client applications such as kubectl by writing kubectl plugins. These extensions will help you use kubectl with less human interaction, such as choosing a Kubernetes cluster context automatically. Likewise, generated clients with the OpenAPI specifications can extend client libraries such as client-go. With these generated clients, you can programmatically use the Kubernetes API in custom applications.
  • Kubernetes API types: Kubernetes API resources such as pods, deployments, and many more are highly configurable, but it is also possible to add new resources called custom resources.
  • Kubernetes API controllers: The control plane of Kubernetes, which includes the Kubernetes API server, handles all operations, such as automatic scaling or self-healing; however, it is also possible to develop custom controllers.
  • Access controllers: The access control mechanism that handles authentication, authorization, and admission controllers can be extended by connecting to webhook servers or intervening with initializers.
  • Scheduling: kube-scheduler already handles the scheduling of pods to the nodes; however, it is also possible to create custom schedulers and deploy them to the clusters.
  • Infrastructure: The infrastructure part of Kubernetes is standardized, regarding the server, network, and storage with the Container Runtime Interface (CRI), Container Network Interface (CNI), and Container Storage Interface (CSI). The implementation, of these interfaces provide ways of extending the infrastructure of the underlying Kubernetes clusters.
I have put the preceding categories into the following table for ease of use:

Extending Kubernetes Clients

Kubernetes client applications and libraries are the main entry points for accessing the Kubernetes API. With these applications and libraries, it is possible to automate and extend Kubernetes operations.
For the official Kubernetes client applications, kubectl can be extended by writing plugin applications. Some of the most popular plugins enhance the capabilities of kubectl:
  • It switches the Kubernetes cluster context automatically
  • It calculates and displays the uptime information of pods
  • It connects via SSH into a container with a specific user
Official Kubernetes code generators can generate official Kubernetes client libraries and Kubernetes server codes. These generators create the required source code for internal versioned types, clients informers, and protobuf codecs.
With the extension points on client applications and libraries, it is possible to enhance operations that interact with Kubernetes. If your custom requirements need more than the capabilities of kubectl or client libraries, Kubernetes provides extension points for customization.

Extending the Kubernetes API

Kubernetes already has a rich set of resources, starting from pods as building blocks to higher-level resources such as stateful sets and deployments. Modern cloud-native applications can be deployed in terms of Kubernetes resources and their high-level configuration options. However, they are not sufficient when human expertise and operations are required. Kubernetes enables extending its own API with new resources and operates them as Kubernetes-native objects with the following features:
  • RESTful API: New resources are directly included in the RESTful API so that they are accessible with their special endpoints.
  • Authentication and authorization: All requests for new resources go through the steps of authentication and authorization, like native requests.
  • OpenAPI discovery: New resources can be discovered and integrated into OpenAPI specifications.
  • Client libraries: Client libraries such as kubectl or client-go can be used to interact with new resources.
Two major steps are involved when extending the Kubernetes API:
  • Create a new Kubernetes resource to introduce the new API types
  • Control and automate operations to implement custom logic as an additional API controller

Custom Resource Definitions

In Kubernetes, all of the resources have their REST endpoints in ...

Table of contents

  1. Title
  2. Copyright and Credits
  3. Contributor
  4. Packt Upsell
  5. Preface
  6. Kubernetes Design Patterns
  7. Kubernetes Client Libraries
  8. Kubernetes Extensions
  9. Solutions
  10. Other Books You May Enjoy