23,92 €
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
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
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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 93
Veröffentlichungsjahr: 2018
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Acquisitions Editor: Aditya DateContent Development Editor: Tanmayee PatilProduction Coordinators: Shantanu Zagade, Ratan Pote
First published: September 2018
Production reference: 1260918
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78961-927-0
www.packtpub.com
Onur Yilmaz is a software engineer in a multinational enterprise software company. He is a Certified Kubernetes Administrator (CKA) and works on Kubernetes and cloud management systems. He has been developing software systems since he was eleven years old. He is a keen supporter of cutting-edge technologies, such as Docker, Kubernetes, and cloud-native applications. He has one master's and two bachelor's degrees in engineering and is pursuing a doctorate degree.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
I
mprove your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.Packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.Packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Title
Copyright and Credits
Kubernetes Design Patterns and Extensions
Contributor
About the Author
Packt Is Searching for Authors like You
Packt Upsell
Why Subscribe?
PacktPub.com
Preface
Who This Book Is For
What This Book Covers
To Get the Most out of This Book
Download the Example Code Files
Conventions Used
Get in Touch
Reviews
Kubernetes Design Patterns
Software Design Patterns
Uses of Software Design Patterns
Classification of Software Design Patterns
Kubernetes Design Patterns
Structural Patterns
Sidecar Pattern
Activity: Running a Web Server with Synchronization
Initialization Pattern
Activity: Running a Web Server after Content Preparation
Behavioral Patterns
Job Pattern
Scheduled Job Pattern
Daemon Service Pattern
Singleton Service Pattern
Introspective Pattern
Activity: Injecting Data into Applications
Deployment Strategies
Recreate Strategy
Deploying the Application Using the Recreate Strategy
Rolling Update Strategy
Deploying an Application Using the Rolling Update Strategy
Blue/Green Strategy
Deploying an Application Using the Blue/Green Strategy
A/B Testing Strategy
Deployment Strategies Summary
Summary
Kubernetes Client Libraries
Accessing the Kubernetes API
Kubernetes API Style
Getting a JSON Response from the Kubernetes API
Accessing the Kubernetes API
Connecting to the Kubernetes API and Creating Namespaces
Accessing the Kubernetes API inside a Cluster
To Connect to the Kubernetes API inside a Cluster
Official Client Libraries
Go Client Library
Repository
Documentation
Installation
Creating Configuration
Creating Clientset
Making API Calls
To Use the Kubernetes Go Client outside the Cluster
Activity: Using the Kubernetes Go Client inside the Cluster
Python Client Library
Repository
Installation
Client Usage
Packaging
Using the Kubernetes Python Client inside the Cluster
Other Official Client Libraries
Community-Maintained Client Libraries
Summary
Kubernetes Extensions
Kubernetes Extension Points
Extending Kubernetes Clients
Extending the Kubernetes API
Custom Resource Definitions
Creating and Deploying Custom Resource Definitions
Custom Controllers
Operator Development
Kubernetes Sample Controller
Operator Framework
Creating and Deploying the Kubernetes Operator
Kubernetes Dynamic Admission Control
Admission Webhooks
Initializers
Extending the Kubernetes Scheduler
Node Labels
Node Selectors
Node Affinity
Pod Affinity
Taints and Tolerations
Custom Scheduler Development
Deploying and using a Custom Kubernetes Scheduler
Extending Kubernetes Infrastructure
Summary
Solutions
Chapter 1:  Kubernetes Design Patterns
Activity: Running a Web Server with Synchronization
Activity: Running a Web Server after Content Preparation
Activity: Injecting Data into Applications
Chapter 2:  Kubernetes Client Libraries
Activity: Using the Kubernetes Go Client inside the Cluster
Other Books You May Enjoy
Leave a Review - Let Other Readers Know What You Think
Before plunging into how Kubernetes works, this book introduces you to the world of container orchestration and describes the recent changes in application development. It helps you understand the problems that Kubernetes solves and shows how to use Kubernetes resources to deploy applications. You also learn to apply the security model of Kubernetes clusters. The book also describes how services running in Kubernetes can leverage the platform's security features. You learn to troubleshoot Kubernetes clusters and debug Kubernetes applications. You also learn to analyze the networking model and its alternatives in Kubernetes, and apply best practices in Kubernetes with design patterns. By the time you are done reading the book, you will know all about using the power of Kubernetes for managing your containers.
After completing this book, you will be able to:
Understand and classify software designs patterns per the cloud-native paradigm
Apply best practices in Kubernetes with design patterns
Access Kubernetes API programmatically using client libraries
Extend Kubernetes with custom resources and controllers
Integrate into access control mechanisms and interact resource lifecycle in Kubernetes
Develop and run custom schedulers in Kubernetes
If you are interested in configuring and troubleshooting Kubernetes clusters and developing microservices-based applications on Kubernetes clusters, then this is a very useful book for you. DevOps engineers with basic knowledge of Docker will find this book useful.
Chapter 1, Kubernetes Design Patterns, will help you to understand Kubernetes patterns which would be presented with the examples from Kubernetes itself and external applications.
Chapter 2, Kubernetes Client Libraries, will help you to cover accessing Kubernetes API with raw HTTP queries to complex libraries with both in-cluster and out-cluster examples.
Chapter 3, Kubernetes Extensions, will present extension capabilities of Kubernetes with custom resource definitions, custom controllers, dynamic admission controllers, and custom schedulers.
We assume that you are comfortable with command-line tools and computer programming concepts and languages. The minimum hardware requirements are: Intel Core i7 or equivalent, 8 GB RAM, 35 GB hard disk, and a stable internet connection. You'll also need the following software installed in advance:
Access to a Kubernetes cluster with the version equal to or higher than 1.10 Local Kubernetes solutions such as minikube or clusters living in cloud providers:
https://github.com/kubernetes/minikube
Kubernetes command line tool kubectl is required for accessing Kubernetes from terminal:
https://kubernetes.io/docs/tasks/tools/install-kubectl/
Docker client and server with the minimum version of 18.03 are required for building and testing the client libraries:
https://www.docker.com/get-started
Installing Python and Go are not required, however recommended for playing around with the client libraries locally:
https://www.python.org/downloads/
https://golang.org/
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packt.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/TrainingByPackt/Kubernetes-Design-Patterns-and-Extensions. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "With this method, kubectl securely connects to the API server with its own credentials and creates a proxy for the applications on the local system."
A block of code is set as follows:
{ "apiVersion":"v1", "kind":"Namespace", "metadata":{ "name":"packt-client” }}
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
curl -X POST http://localhost:8080/
api/v1/namespaces/
\--header "Content-Type:
application/json
" \
Activity: These are scenario-based activities that will let you practically apply what you've learned over the course of a complete section. They are typically in the context of a real-world problem or situation.
