Kubernetes Recipes A Practical Guide for Container Orchestration and Deployment (Grzegorz Stencel, Luca Berton) (Z-Library)

Author: Grzegorz Stencel, Luca Berton

教育

Kubernetes Recipes is your essential guide to using Kubernetes for container orchestration providing a hands-on, problem-solving approach to address the intricacies of deployment, scaling, and day-to-day operations. The book's format, organized for easy lookup, ensures that you can swiftly find detailed solutions to your challenges in your Kubernetes journey. Beginning with the fundamentals, the book covers Kubernetes installation, working with the Kubernetes API, and understanding application primitives for efficient deployment. It teaches monitoring and troubleshooting strategies, providing practical insights into handling issues that may arise in your clusters. Whether new to Kubernetes or seeking advanced insights, the book covers a broad spectrum of topics, including managing specialized workloads, handling volumes and configuration data, implementing scaling strategies, and ensuring security.

📄 File Format: PDF
💾 File Size: 16.9 MB
60
Views
0
Downloads
0.00
Total Donations

📄 Text Preview (First 20 pages)

ℹ️

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

📄 Page 1
Kubernetes Recipes A Practical Guide for Container Orchestration and Deployment — Grzegorz Stencel Luca Berton
📄 Page 2
Kubernetes Recipes A Practical Guide for Container Orchestration and Deployment Grzegorz Stencel Luca Berton
📄 Page 3
Kubernetes Recipes: A Practical Guide for Container Orchestration and Deployment ISBN-13 (pbk): 979-8-8688-1324-5 ISBN-13 (electronic): 979-8-8688-1325-2 https://doi.org/10.1007/979-8-8688-1325-2 Copyright © 2025 by Grzegorz Stencel, Luca Berton This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editors: James Robinson-Prior, Divya Modi Development Editor: James Markham Coordinating Editor: Gryffin Winkler Cover Image by Kerstin Riemer from Pixabay (pixabay.com) Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail booktranslations@springernature.com; for reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book can be found here: https://www.apress.com/gp/services/source-code. If disposing of this product, please recycle the paper Grzegorz Stencel Bournemouth, UK Luca Berton BOURNEMOUTH, UK
📄 Page 4
Writing this book has been a journey of growth, one that required me to step out of my comfort zone and set aside my ego. I owe a debt of gratitude to my good friend and coauthor, Luca, for inspiring me to embark on this book and my family—my beloved wife, Malgorzata; my greatest treasure, my son Xavier; and of course my mum, Ewa—for their unwavering support. Their love and understanding have allowed me to dedicate more time to this project. Throughout my career, I have learned and known how important it is to appreciate others and say a simple (or big) “thank you” to peers who helped. This also shows that the part of this book I wrote is not my own experience but the cumulative experience of brilliant people I had the honor to work with. So firstly, for infecting me with knowledge sharing, to Paul TID. Secondly but not less importantly, to the people who brought me into the advanced enterprise Ku- bernetes world, the real “Kubernetes experts,” my mentor John F. and all the magnificent people he introduced me to—his little army of best k8s engineers I was honored to work with, Sven, Neil, Eric, and Alen. And finally, for the most significant architectural inspiration, to my other mentor Bryn who can “destroy” you constructively but when he “destroys” you, you enjoy it because you take lessons from it that you won’t learn anywhere else. Also a big thanks to Allan for his immense support and coaching. Chris for teaching how to appreciate others and be a good leader—“a happy developer is a performing developer.” And, lastly, Aleksander (Olek) for motivating me to always improve and to pursue success. —Greg For my son, Filippo, the joy of my life. —Luca
📄 Page 5
v Table of Contents About the Authors ���������������������������������������������������������������������������� xxix About the Technical Reviewer ��������������������������������������������������������� xxxi Acknowledgments ������������������������������������������������������������������������� xxxiii Introduction ������������������������������������������������������������������������������������ xxxv Chapter 1: Getting Started ��������������������������������������������������������������������1 Introduction �����������������������������������������������������������������������������������������������������������1 1�1 Installing the kubectl Tool �������������������������������������������������������������������������������2 Problem �����������������������������������������������������������������������������������������������������������2 Solution �����������������������������������������������������������������������������������������������������������2 Discussion �������������������������������������������������������������������������������������������������������4 See Also �����������������������������������������������������������������������������������������������������������5 1�2 Installing Lightweight Kubernetes ������������������������������������������������������������������5 Problem �����������������������������������������������������������������������������������������������������������5 Solution �����������������������������������������������������������������������������������������������������������5 Discussion �������������������������������������������������������������������������������������������������������7 See Also �����������������������������������������������������������������������������������������������������������7 1�3 Dashboard �������������������������������������������������������������������������������������������������������7 Problem �����������������������������������������������������������������������������������������������������������7 Solution �����������������������������������������������������������������������������������������������������������8 Discussion �����������������������������������������������������������������������������������������������������10 See Also ���������������������������������������������������������������������������������������������������������10
📄 Page 6
vi 1�4 Set Up a Local Kubernetes with Minikube ����������������������������������������������������10 Problem ���������������������������������������������������������������������������������������������������������10 Solution ���������������������������������������������������������������������������������������������������������11 Discussion �����������������������������������������������������������������������������������������������������14 1�5 Running Local Kubernetes Clusters in Docker Containers ����������������������������15 Problem ���������������������������������������������������������������������������������������������������������15 Solution ���������������������������������������������������������������������������������������������������������15 Discussion �����������������������������������������������������������������������������������������������������17 See Also ���������������������������������������������������������������������������������������������������������17 1�6 Set Up a Cluster Using Kubeadm ������������������������������������������������������������������17 Problem ���������������������������������������������������������������������������������������������������������17 Solution ���������������������������������������������������������������������������������������������������������17 Discussion �����������������������������������������������������������������������������������������������������18 See Also ���������������������������������������������������������������������������������������������������������19 1�7 Set Up a Cluster Using Kubernetes Operations ���������������������������������������������19 Problem ���������������������������������������������������������������������������������������������������������19 Solution ���������������������������������������������������������������������������������������������������������19 Discussion �����������������������������������������������������������������������������������������������������20 See Also ���������������������������������������������������������������������������������������������������������21 1�8 Running on Raspberry Pis Using MicroK8s ���������������������������������������������������21 Problem ���������������������������������������������������������������������������������������������������������21 Solution ���������������������������������������������������������������������������������������������������������21 Discussion �����������������������������������������������������������������������������������������������������22 See Also ���������������������������������������������������������������������������������������������������������22 1�9 Building a Hybrid Architecture Cluster ����������������������������������������������������������23 Problem ���������������������������������������������������������������������������������������������������������23 Solution ���������������������������������������������������������������������������������������������������������23 Table of ConTenTs
📄 Page 7
vii Discussion �����������������������������������������������������������������������������������������������������24 See Also ���������������������������������������������������������������������������������������������������������24 1�10 Cluster Access Kubeconfig Files �����������������������������������������������������������������25 Problem ���������������������������������������������������������������������������������������������������������25 Solution ���������������������������������������������������������������������������������������������������������25 Discussion �����������������������������������������������������������������������������������������������������26 See Also ���������������������������������������������������������������������������������������������������������27 1�11 Implementing Kubernetes HA ���������������������������������������������������������������������27 Problem ���������������������������������������������������������������������������������������������������������27 Solution ���������������������������������������������������������������������������������������������������������28 Discussion �����������������������������������������������������������������������������������������������������29 See Also ���������������������������������������������������������������������������������������������������������29 Summary�������������������������������������������������������������������������������������������������������������30 Chapter 2: Configuring Stateless Applications �����������������������������������31 2�1 List All the Namespaces ��������������������������������������������������������������������������������31 Problem ���������������������������������������������������������������������������������������������������������31 Solution ���������������������������������������������������������������������������������������������������������32 Discussion �����������������������������������������������������������������������������������������������������32 2�2 Create a Namespace �������������������������������������������������������������������������������������32 Problem ���������������������������������������������������������������������������������������������������������32 Solution ���������������������������������������������������������������������������������������������������������33 Problem ���������������������������������������������������������������������������������������������������������34 Solution ���������������������������������������������������������������������������������������������������������34 Discussion �����������������������������������������������������������������������������������������������������34 Problem ���������������������������������������������������������������������������������������������������������34 Solution ���������������������������������������������������������������������������������������������������������34 Table of ConTenTs
📄 Page 8
viii 2�3 Create a Pod in a Namespace �����������������������������������������������������������������������35 Problem ���������������������������������������������������������������������������������������������������������35 Solution ���������������������������������������������������������������������������������������������������������35 2�4 Create a Pod with Environment Variables as Configuration ��������������������������36 Problem ���������������������������������������������������������������������������������������������������������36 Solution ���������������������������������������������������������������������������������������������������������36 2�5 Create a Multi-container Pod ������������������������������������������������������������������������38 Problem ���������������������������������������������������������������������������������������������������������38 Solution ���������������������������������������������������������������������������������������������������������39 2�6 Create a Pod with Resource Limits ���������������������������������������������������������������41 Problem ���������������������������������������������������������������������������������������������������������41 Solution ���������������������������������������������������������������������������������������������������������42 Discussion �����������������������������������������������������������������������������������������������������43 2�7 Apply a JSON Patch Operation ����������������������������������������������������������������������45 Problem ���������������������������������������������������������������������������������������������������������45 Solution ���������������������������������������������������������������������������������������������������������45 2�8 Create Secrets ����������������������������������������������������������������������������������������������46 Problem ���������������������������������������������������������������������������������������������������������46 Solution ���������������������������������������������������������������������������������������������������������46 Discussion �����������������������������������������������������������������������������������������������������48 2�9 Use Enterprise and Linux-Based Images for Our Pod �����������������������������������48 Problem ���������������������������������������������������������������������������������������������������������48 Solution ���������������������������������������������������������������������������������������������������������48 Discussion �����������������������������������������������������������������������������������������������������51 Summary�������������������������������������������������������������������������������������������������������������53 Table of ConTenTs
📄 Page 9
ix Chapter 3: Configuring Stateful Applications �������������������������������������55 3�1 Containerized Databases ������������������������������������������������������������������������������55 Problem ���������������������������������������������������������������������������������������������������������56 Solution ���������������������������������������������������������������������������������������������������������56 Discussion �����������������������������������������������������������������������������������������������������58 3�2 Understanding Data Persistency on Kubernetes �������������������������������������������59 Problem ���������������������������������������������������������������������������������������������������������59 Solution ���������������������������������������������������������������������������������������������������������59 Discussion �����������������������������������������������������������������������������������������������������61 See Also ���������������������������������������������������������������������������������������������������������61 3�3 Database Migrations to Kubernetes Environments ���������������������������������������61 Problem ���������������������������������������������������������������������������������������������������������61 Solution ���������������������������������������������������������������������������������������������������������62 Discussion �����������������������������������������������������������������������������������������������������62 See Also ���������������������������������������������������������������������������������������������������������65 3�4 Apply Multiple YAML Files at Once on Kubernetes ����������������������������������������66 Problem ���������������������������������������������������������������������������������������������������������66 Solution ���������������������������������������������������������������������������������������������������������66 Discussion �����������������������������������������������������������������������������������������������������67 3�5 Cloud-Native Software Development Lifecycle (SDLC) ���������������������������������68 Problem ���������������������������������������������������������������������������������������������������������68 Solution ���������������������������������������������������������������������������������������������������������68 Discussion �����������������������������������������������������������������������������������������������������69 3�6 Polyglot, Multi-language, Cloud Application Development ����������������������������70 Problem ���������������������������������������������������������������������������������������������������������70 Solution ���������������������������������������������������������������������������������������������������������70 Discussion �����������������������������������������������������������������������������������������������������71 Chapter Summary �����������������������������������������������������������������������������������������������73 Table of ConTenTs
📄 Page 10
x Chapter 4: Kubernetes on Cloud Providers �����������������������������������������75 4�1 Google Kubernetes Engine (GKE) ������������������������������������������������������������������75 Problem ���������������������������������������������������������������������������������������������������������75 Solution ���������������������������������������������������������������������������������������������������������76 Discussion �����������������������������������������������������������������������������������������������������79 See Also ���������������������������������������������������������������������������������������������������������81 4�2 Azure Kubernetes Service (AKS) �������������������������������������������������������������������82 Problem ���������������������������������������������������������������������������������������������������������82 Solution ���������������������������������������������������������������������������������������������������������82 Discussion �����������������������������������������������������������������������������������������������������86 See Also ���������������������������������������������������������������������������������������������������������88 4�3 Amazon Elastic Kubernetes Service (EKS) ����������������������������������������������������88 Problem ���������������������������������������������������������������������������������������������������������88 Discussion �����������������������������������������������������������������������������������������������������89 See Also ���������������������������������������������������������������������������������������������������������90 4�4 DigitalOcean ��������������������������������������������������������������������������������������������������90 Problem ���������������������������������������������������������������������������������������������������������90 Solution ���������������������������������������������������������������������������������������������������������91 Discussion �����������������������������������������������������������������������������������������������������93 See Also ���������������������������������������������������������������������������������������������������������94 4�5 OVH ���������������������������������������������������������������������������������������������������������������94 Problem ���������������������������������������������������������������������������������������������������������94 Solution ���������������������������������������������������������������������������������������������������������94 Discussion �����������������������������������������������������������������������������������������������������95 4�6 Hetzner ����������������������������������������������������������������������������������������������������������96 Problem ���������������������������������������������������������������������������������������������������������96 Solution ���������������������������������������������������������������������������������������������������������96 Discussion �����������������������������������������������������������������������������������������������������99 See Also ���������������������������������������������������������������������������������������������������������99 Table of ConTenTs
📄 Page 11
xi 4�7 Kubespray �����������������������������������������������������������������������������������������������������99 Problem ���������������������������������������������������������������������������������������������������������99 Solution �������������������������������������������������������������������������������������������������������100 Discussion ���������������������������������������������������������������������������������������������������101 4�8 Certified Kubernetes Software Conformance by CNCF (Sonobuoy) ������������102 Problem �������������������������������������������������������������������������������������������������������102 Solution �������������������������������������������������������������������������������������������������������103 Discussion ���������������������������������������������������������������������������������������������������103 Chapter Summary ���������������������������������������������������������������������������������������������104 Chapter 5: Developer Experience in Kubernetes ������������������������������105 5�1 Command-Line Tools �����������������������������������������������������������������������������������105 Problem �������������������������������������������������������������������������������������������������������105 Solution �������������������������������������������������������������������������������������������������������106 5�2 Lens as k8s IDE �������������������������������������������������������������������������������������������109 Problem �������������������������������������������������������������������������������������������������������109 Solution �������������������������������������������������������������������������������������������������������109 5�3 DevSpace ����������������������������������������������������������������������������������������������������112 Problem �������������������������������������������������������������������������������������������������������112 Solution �������������������������������������������������������������������������������������������������������112 5�4 VS Code as k8s IDE �������������������������������������������������������������������������������������118 Problem �������������������������������������������������������������������������������������������������������118 Solution �������������������������������������������������������������������������������������������������������118 Summary�����������������������������������������������������������������������������������������������������������123 Table of ConTenTs
📄 Page 12
xii Chapter 6: Scaling and Resiliency ����������������������������������������������������125 6�1 Create Resource Limits and Requests in Pods and Containers ������������������125 Problem �������������������������������������������������������������������������������������������������������125 Solution �������������������������������������������������������������������������������������������������������126 6�2 Deployment, ReplicaSet, Replication Controller, or Job ������������������������������131 Problem �������������������������������������������������������������������������������������������������������131 Solution �������������������������������������������������������������������������������������������������������131 6�3 Kustomize: Do More with Less ��������������������������������������������������������������������139 Problem �������������������������������������������������������������������������������������������������������139 Solution �������������������������������������������������������������������������������������������������������140 6�4 Cluster Autoscaler (Google, Azure, AWS, DigitalOcean, OVH Cloud) �������������152 Problem �������������������������������������������������������������������������������������������������������152 Solution �������������������������������������������������������������������������������������������������������153 6�5 Kubernetes Event-Driven Autoscaling (KEDA) ���������������������������������������������155 Problem �������������������������������������������������������������������������������������������������������155 Solution �������������������������������������������������������������������������������������������������������156 6�6 Application Horizontal Pod Autoscaling �������������������������������������������������������160 Problem �������������������������������������������������������������������������������������������������������160 Solution �������������������������������������������������������������������������������������������������������161 6�7 Application Vertical Pod Autoscaling �����������������������������������������������������������163 Problem �������������������������������������������������������������������������������������������������������163 Solution �������������������������������������������������������������������������������������������������������164 6�8 High-Performance Kubernetes Cluster Autoscaler with Karpenter ��������������������������������������������������������������������������������������������167 Problem �������������������������������������������������������������������������������������������������������167 Solution �������������������������������������������������������������������������������������������������������168 Table of ConTenTs
📄 Page 13
xiii 6�9 Ensuring Application Resiliency and Efficiency in Constrained Environments with Kubernetes PodTopologySpread ����������������������������������172 Problem �������������������������������������������������������������������������������������������������������172 Solution �������������������������������������������������������������������������������������������������������173 6�10 Securing the Control Plane with Additional Resources �����������������������������177 Problem �������������������������������������������������������������������������������������������������������177 Solution �������������������������������������������������������������������������������������������������������177 6�11 Container Image Registries (AWS ECR, DockerHub, GCR, Quay�io, Harbor, JFrog) ������������������������������������������������������������������������������179 Problem �������������������������������������������������������������������������������������������������������179 Solution �������������������������������������������������������������������������������������������������������180 6�12 Update Your App: Deployment Strategy Types �������������������������������������������187 Problem �������������������������������������������������������������������������������������������������������187 Solution �������������������������������������������������������������������������������������������������������188 Best Practices for Deployment Strategies ���������������������������������������������������200 6�13 vCluster: Instantly Spin Up Hundreds of Kubernetes Virtual Clusters in Seconds �����������������������������������������������������������������������201 Problem �������������������������������������������������������������������������������������������������������201 Solution �������������������������������������������������������������������������������������������������������202 Scaling and Resiliency Chapter Summary ��������������������������������������������������������209 Chapter 7: Storage in Kubernetes �����������������������������������������������������211 7�1 Storage for Containerized Workloads ����������������������������������������������������������211 Problem �������������������������������������������������������������������������������������������������������212 Solution �������������������������������������������������������������������������������������������������������212 Discussion ���������������������������������������������������������������������������������������������������214 7�2 Defining StorageClass ���������������������������������������������������������������������������������215 Problem �������������������������������������������������������������������������������������������������������215 Solution �������������������������������������������������������������������������������������������������������215 Discussion ���������������������������������������������������������������������������������������������������216 Table of ConTenTs
📄 Page 14
xiv 7�3 Static Provisioning ��������������������������������������������������������������������������������������217 Problem �������������������������������������������������������������������������������������������������������217 Solution �������������������������������������������������������������������������������������������������������217 Discussion ���������������������������������������������������������������������������������������������������219 See Also �������������������������������������������������������������������������������������������������������219 7�4 Local Persistent Volumes ����������������������������������������������������������������������������220 Problem �������������������������������������������������������������������������������������������������������220 Solution �������������������������������������������������������������������������������������������������������220 Discussion ���������������������������������������������������������������������������������������������������222 7�5 Dynamic Provisioning Volumes �������������������������������������������������������������������223 Problem �������������������������������������������������������������������������������������������������������223 Solution �������������������������������������������������������������������������������������������������������224 Discussion ���������������������������������������������������������������������������������������������������227 See Also �������������������������������������������������������������������������������������������������������227 7�6 NFS Volume �������������������������������������������������������������������������������������������������228 Problem �������������������������������������������������������������������������������������������������������228 Solution �������������������������������������������������������������������������������������������������������228 Discussion ���������������������������������������������������������������������������������������������������231 7�7 Azure Dynamic Provisioning ������������������������������������������������������������������������232 Problem �������������������������������������������������������������������������������������������������������232 Solution �������������������������������������������������������������������������������������������������������232 Discussion ���������������������������������������������������������������������������������������������������235 7�8 Amazon EFS ������������������������������������������������������������������������������������������������235 Problem �������������������������������������������������������������������������������������������������������235 Solution �������������������������������������������������������������������������������������������������������236 Discussion ���������������������������������������������������������������������������������������������������239 Table of ConTenTs
📄 Page 15
xv 7�9 Regional Persistent Disks in GKE ����������������������������������������������������������������240 Problem �������������������������������������������������������������������������������������������������������240 Solution �������������������������������������������������������������������������������������������������������240 Discussion ���������������������������������������������������������������������������������������������������243 Summary�����������������������������������������������������������������������������������������������������������244 Chapter 8: Networking in Kubernetes ����������������������������������������������247 Debugging Kubernetes Networking ������������������������������������������������������������������248 Netshoot ������������������������������������������������������������������������������������������������������251 Determine Where to Debug From ����������������������������������������������������������������252 Deploy a Debugging Pod �����������������������������������������������������������������������������253 Exec into the Debug Pod������������������������������������������������������������������������������254 Check Pod Logs and Events ������������������������������������������������������������������������254 Verify Network Policies ��������������������������������������������������������������������������������255 Check Service and Endpoint Configurations �����������������������������������������������255 Debug Cluster Networking Issues ���������������������������������������������������������������255 Capture Network Traffic �������������������������������������������������������������������������������256 Additional Tips ���������������������������������������������������������������������������������������������256 8�1 Set Up a Load Balancer �������������������������������������������������������������������������������256 Problem �������������������������������������������������������������������������������������������������������256 Solution �������������������������������������������������������������������������������������������������������257 Conclusion ���������������������������������������������������������������������������������������������������262 8�2 Problem Statement: Applying Network Policies in Kubernetes �������������������262 Solution: Configuring Network Policies in Kubernetes ��������������������������������263 Conclusion ���������������������������������������������������������������������������������������������������273 8�3 Problem Statement: Creating Service Types in Kubernetes ������������������������273 Solution: Configuring Service Types in Kubernetes �������������������������������������274 Conclusion ���������������������������������������������������������������������������������������������������281 Table of ConTenTs
📄 Page 16
xvi 8�4 Problem Statement: Traffic Routing with Istio, CertManager, ExternalDNS, and External Secrets in Kubernetes ��������������������������������������282 Solution: Implementing Traffic Routing with Istio, CertManager, ExternalDNS, and External Secrets ��������������������������������������������������������������283 Conclusion ���������������������������������������������������������������������������������������������������294 Conclusion ���������������������������������������������������������������������������������������������������295 8�5 Problem Statement: Traffic Split Configuration, Retry Rule, and Timeout in Kubernetes ��������������������������������������������������������������������������������296 Solution: Configuring Traffic Split, Retry Rules, and Timeouts in Kubernetes ��������������������������������������������������������������������������������������������������296 Conclusion ���������������������������������������������������������������������������������������������������304 8�6 Problem Statement: Iptables and Nftables in Kubernetes ��������������������������304 Solution: Iptables and Nftables in Kubernetes���������������������������������������������305 Summary �����������������������������������������������������������������������������������������������������313 8�7 Problem Statement: Implementing Network Security in Kubernetes ����������313 Solution: Implementing Network Security in Kubernetes ����������������������������314 Conclusion ���������������������������������������������������������������������������������������������������320 8�8 Problem Statement: Network Automation and Software-Defined Networking (SDN) in Kubernetes ����������������������������������������������������������������320 Specific Issues ��������������������������������������������������������������������������������������������321 Solution: Implementing Network Automation and SDN in Kubernetes ��������321 Conclusion ���������������������������������������������������������������������������������������������������325 8�9 Problem Statement: Implementing Cloud-Native Network Functions (CNFs) and Virtual Network Functions (VNFs) in Kubernetes �����326 Specific Issues ��������������������������������������������������������������������������������������������326 Solution: Implementing Cloud-Native Network Functions and Virtual Network Functions in Kubernetes ���������������������������������������������327 Conclusion ���������������������������������������������������������������������������������������������������332 8�10 Troubleshooting Common Networking Issues in Kubernetes ��������������������332 8�10�1 Debugging Service Connectivity Problems ���������������������������������������333 Table of ConTenTs
📄 Page 17
xvii 8�10�2 Troubleshooting Misconfigured Network Policies�����������������������������335 8�10�3 Resolving Load Balancer Setup Errors ���������������������������������������������337 Chapter Summary ���������������������������������������������������������������������������������������������339 Chapter 9: Performance Observability in Kubernetes ����������������������341 9�1 Metrics Server ��������������������������������������������������������������������������������������������341 Problem �������������������������������������������������������������������������������������������������������341 Solution �������������������������������������������������������������������������������������������������������342 Discussion ���������������������������������������������������������������������������������������������������343 See Also �������������������������������������������������������������������������������������������������������345 9�2 Prometheus �������������������������������������������������������������������������������������������������345 Problem �������������������������������������������������������������������������������������������������������345 Solution �������������������������������������������������������������������������������������������������������345 Discussion ���������������������������������������������������������������������������������������������������347 See Also �������������������������������������������������������������������������������������������������������349 9�3 InfluxDB �������������������������������������������������������������������������������������������������������349 Problem �������������������������������������������������������������������������������������������������������349 Solution �������������������������������������������������������������������������������������������������������350 Discussion ���������������������������������������������������������������������������������������������������350 See Also �������������������������������������������������������������������������������������������������������351 9�4 Fluentd ��������������������������������������������������������������������������������������������������������351 Problem �������������������������������������������������������������������������������������������������������351 Solution �������������������������������������������������������������������������������������������������������351 Discussion ���������������������������������������������������������������������������������������������������352 See Also �������������������������������������������������������������������������������������������������������352 9�5 ELK (Elasticsearch, Logstash, Kibana) Stack ����������������������������������������������353 Problem �������������������������������������������������������������������������������������������������������353 Solution �������������������������������������������������������������������������������������������������������353 Discussion ���������������������������������������������������������������������������������������������������355 Table of ConTenTs
📄 Page 18
xviii 9�6 Jaeger ���������������������������������������������������������������������������������������������������������356 Problem �������������������������������������������������������������������������������������������������������356 Solution �������������������������������������������������������������������������������������������������������356 Discussion ���������������������������������������������������������������������������������������������������358 9�7 Zipkin ����������������������������������������������������������������������������������������������������������359 Problem �������������������������������������������������������������������������������������������������������359 Solution �������������������������������������������������������������������������������������������������������359 Discussion ���������������������������������������������������������������������������������������������������360 See Also �������������������������������������������������������������������������������������������������������360 9�8 Grafana �������������������������������������������������������������������������������������������������������360 Problem �������������������������������������������������������������������������������������������������������360 Solution �������������������������������������������������������������������������������������������������������361 Discussion ���������������������������������������������������������������������������������������������������361 See Also �������������������������������������������������������������������������������������������������������362 9�9 Kibana ���������������������������������������������������������������������������������������������������������362 Problem �������������������������������������������������������������������������������������������������������362 Solution �������������������������������������������������������������������������������������������������������362 Discussion ���������������������������������������������������������������������������������������������������363 9�10 OpenTelemetry ������������������������������������������������������������������������������������������363 Problem �������������������������������������������������������������������������������������������������������363 Solution �������������������������������������������������������������������������������������������������������363 Discussion ���������������������������������������������������������������������������������������������������364 9�11 Locust �������������������������������������������������������������������������������������������������������365 Problem �������������������������������������������������������������������������������������������������������365 Solution �������������������������������������������������������������������������������������������������������365 Discussion ���������������������������������������������������������������������������������������������������366 Table of ConTenTs
📄 Page 19
xix 9�12 Vegeta �������������������������������������������������������������������������������������������������������367 Problem �������������������������������������������������������������������������������������������������������367 Solution �������������������������������������������������������������������������������������������������������368 Discussion ���������������������������������������������������������������������������������������������������368 See Also �������������������������������������������������������������������������������������������������������368 9�13 KubeVirt ����������������������������������������������������������������������������������������������������368 Problem �������������������������������������������������������������������������������������������������������368 Solution �������������������������������������������������������������������������������������������������������369 Discussion ���������������������������������������������������������������������������������������������������370 9�14 Harvester ��������������������������������������������������������������������������������������������������373 Problem �������������������������������������������������������������������������������������������������������373 Solution �������������������������������������������������������������������������������������������������������373 Discussion ���������������������������������������������������������������������������������������������������374 See Also �������������������������������������������������������������������������������������������������������374 9�15 Amazon CloudWatch ���������������������������������������������������������������������������������374 Problem �������������������������������������������������������������������������������������������������������374 Solution �������������������������������������������������������������������������������������������������������374 Discussion ���������������������������������������������������������������������������������������������������376 9�16 Azure Monitor for Containers ��������������������������������������������������������������������376 Problem �������������������������������������������������������������������������������������������������������376 Solution �������������������������������������������������������������������������������������������������������377 Discussion ���������������������������������������������������������������������������������������������������377 9�17 Google Cloud Operations ���������������������������������������������������������������������������377 Problem �������������������������������������������������������������������������������������������������������377 Solution �������������������������������������������������������������������������������������������������������378 Discussion ���������������������������������������������������������������������������������������������������378 Summary�����������������������������������������������������������������������������������������������������������379 Table of ConTenTs
📄 Page 20
xx Chapter 10: Control Plane Administration and Package Management �������������������������������������������������������������������������������������381 Kube-API Server ������������������������������������������������������������������������������������������������382 Etcd �������������������������������������������������������������������������������������������������������������������383 Kube-Scheduler ������������������������������������������������������������������������������������������������385 Kube-Controller-Manager ���������������������������������������������������������������������������������386 Cloud Controller Manager (Optional) �����������������������������������������������������������������387 Node Components ���������������������������������������������������������������������������������������������388 Kubelet ��������������������������������������������������������������������������������������������������������388 Kube-Proxy (Optional) ����������������������������������������������������������������������������������389 Container Runtime ���������������������������������������������������������������������������������������389 10�1 Assigning Labels, Annotations, and Taints to Nodes ���������������������������������390 Problem �������������������������������������������������������������������������������������������������������390 Solution �������������������������������������������������������������������������������������������������������390 Outcome ������������������������������������������������������������������������������������������������������398 10�2 Performing a Drain ������������������������������������������������������������������������������������399 Problem �������������������������������������������������������������������������������������������������������399 Solution �������������������������������������������������������������������������������������������������������400 Outcome ������������������������������������������������������������������������������������������������������404 10�3 Cordon and Uncordon to Nodes ����������������������������������������������������������������405 Problem �������������������������������������������������������������������������������������������������������405 Solution �������������������������������������������������������������������������������������������������������406 Outcome ������������������������������������������������������������������������������������������������������408 10�4 Upgrade Kubernetes ���������������������������������������������������������������������������������408 Problem �������������������������������������������������������������������������������������������������������408 Solution �������������������������������������������������������������������������������������������������������410 Outcome ������������������������������������������������������������������������������������������������������414 Table of ConTenTs
The above is a preview of the first 20 pages. Register to read the complete e-book.

💝 Support Author

0.00
Total Amount (¥)
0
Donation Count

Login to support the author

Login Now
Back to List