وبلاگ بلیان

Programming Kubernetes : Developing Cloud-Native Applications

معرفی کتاب «Programming Kubernetes : Developing Cloud-Native Applications» نوشتهٔ Michael Hausenblas; Stefan Schimanski, (Software engineer)، منتشرشده توسط نشر O'Reilly Media در سال 2019. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Programming Kubernetes : Developing Cloud-Native Applications» در دستهٔ بدون دسته‌بندی قرار دارد.

Copyright 6 Table of Contents 7 Preface 13 Who Should Read This Book 13 Why We Wrote This Book 13 Ecosystem 13 Technology You Need to Understand 14 Conventions Used in This Book 15 Using Code Examples 15 O’Reilly Online Learning 16 How to Contact Us 16 Acknowledgments 17 Chapter 1. Introduction 19 What Does Programming Kubernetes Mean? 19 A Motivational Example 21 Extension Patterns 22 Controllers and Operators 23 The Control Loop 24 Events 25 Edge- Versus Level-Driven Triggers 27 Changing Cluster Objects or the External World 29 Optimistic Concurrency 32 Operators 34 Summary 36 Chapter 2. Kubernetes API Basics 37 The API Server 37 The HTTP Interface of the API Server 38 API Terminology 39 Kubernetes API Versioning 42 Declarative State Management 43 Using the API from the Command Line 44 How the API Server Processes Requests 47 Summary 51 Chapter 3. Basics of client-go 53 The Repositories 53 The Client Library 53 Kubernetes API Types 55 API Machinery 56 Creating and Using a Client 57 Versioning and Compatibility 59 API Versions and Compatibility Guarantees 62 Kubernetes Objects in Go 64 TypeMeta 65 ObjectMeta 68 spec and status 68 Client Sets 69 Status Subresources: UpdateStatus 71 Listings and Deletions 71 Watches 72 Client Expansion 73 Client Options 73 Informers and Caching 74 Work Queue 79 API Machinery in Depth 80 Kinds 80 Resources 81 REST Mapping 81 Scheme 82 Vendoring 84 glide 84 dep 85 Go Modules 86 Summary 87 Chapter 4. Using Custom Resources 89 Discovery Information 91 Type Definitions 92 Advanced Features of Custom Resources 94 Validating Custom Resources 94 Short Names and Categories 96 Printer Columns 98 Subresources 99 A Developer’s View on Custom Resources 103 Dynamic Client 104 Typed Clients 105 controller-runtime Client of Operator SDK and Kubebuilder 110 Summary 112 Chapter 5. Automating Code Generation 113 Why Code Generation 113 Calling the Generators 113 Controlling the Generators with Tags 115 Global Tags 116 Local Tags 117 deepcopy-gen Tags 118 runtime.Object and DeepCopyObject 118 client-gen Tags 120 informer-gen and lister-gen 121 Summary 122 Chapter 6. Solutions for Writing Operators 123 Preparation 123 Following sample-controller 124 Bootstrapping 124 Business Logic 125 Kubebuilder 131 Bootstrapping 132 Business Logic 136 The Operator SDK 141 Bootstrapping 141 Business Logic 143 Other Approaches 146 Uptake and Future Directions 147 Summary 147 Chapter 7. Shipping Controllers and Operators 149 Lifecycle Management and Packaging 149 Packaging: The Challenge 149 Helm 150 Kustomize 152 Other Packaging Options 154 Packaging Best Practices 155 Lifecycle Management 155 Production-Ready Deployments 156 Getting the Permissions Right 156 Automated Builds and Testing 159 Custom Controllers and Observability 160 Summary 163 Chapter 8. Custom API Servers 165 Use Cases for Custom API Servers 165 Example: A Pizza Restaurant 167 The Architecture: Aggregation 168 API Services 170 Inner Structure of a Custom API Server 172 Delegated Authentication and Trust 174 Delegated Authorization 175 Writing Custom API Servers 177 Options and Config Pattern and Startup Plumbing 177 The First Start 184 Internal Types and Conversion 185 Writing the API Types 189 Conversions 190 Defaulting 194 Roundtrip Testing 195 Validation 197 Registry and Strategy 199 API Installation 204 Admission 207 Deploying Custom API Servers 216 Deployment Manifests 217 Setting Up RBAC 219 Running the Custom API Server Insecurely 220 Certificates and Trust 223 Sharing etcd 225 Summary 226 Chapter 9. Advanced Custom Resources 227 Custom Resource Versioning 227 Revising the Pizza Restaurant 228 Conversion Webhook Architecture 231 Conversion Webhook Implementation 234 Setting Up the HTTPS Server 235 Deploying the Conversion Webhook 241 Seeing Conversion in Action 241 Admission Webhooks 244 Admission Requirements in the Restaurant Example 245 Admission Webhook Architecture 246 Registering Admission Webhooks 248 Implementing an Admission Webhook 249 Admission Webhook in Action 254 Structural Schemas and the Future of CustomResourceDefinitions 255 Structural Schemas 256 Pruning Versus Preserving Unknown Fields 257 Controlling Pruning 258 IntOrString and RawExtensions 259 Default Values 260 Summary 262 Appendix A. Resources 263 General 263 Books 263 Tutorials and Examples 263 Articles 264 Repositories 264 Index 265 About the Authors 272 Colophon 272 While Kubernetes has established itself as the industry standard for managing containers and their life cycles, there's a definite need for good practices on how to write native applications. This practical guide shows application and infrastructure developers, DevOps practitioners, and site reliability engineers how to develop cloud native apps that run on Kubernetes.-----If you’re looking to develop native applications in Kubernetes, this is your guide. Developers and AppOps administrators will learn how to build Kubernetes-native applications that interact directly with the API server to query or update the state of resources. AWS developer advocate Michael Hausenblas and Red Hat principal software engineer Stefan Schimanski explain the characteristics of these apps and show you how to program Kubernetes to build them. You’ll explore the basic building blocks of Kubernetes, including the client-go API library and custom resources. All you need to get started is a rudimentary understanding of development and system administration tools and practices, such as package management, the Go programming language, and Git. • Walk through Kubernetes API basics and dive into the server’s inner structure• Explore Kubernetes’s programming interface in Go, including Kubernetes API objects• Learn about custom resources—the central extension tools used in the Kubernetes ecosystem• Use tags to control Kubernetes code generators for custom resources• Write custom controllers and operators and make them production ready• Extend the Kubernetes API surface by implementing a custom API server
دانلود کتاب Programming Kubernetes : Developing Cloud-Native Applications