Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Preface
Who Should Read This Book
Why We Wrote This Book
Ecosystem
Technology You Need to Understand
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
1. Introduction
What Does Programming Kubernetes Mean?
A Motivational Example
Extension Patterns
Controllers and Operators
The Control Loop
Events
Edge- Versus Level-Driven Triggers
Changing Cluster Objects or the External World
Optimistic Concurrency
Operators
Summary
2. Kubernetes API Basics
The API Server
The HTTP Interface of the API Server
API Terminology
Kubernetes API Versioning
Declarative State Management
Using the API from the Command Line
How the API Server Processes Requests
Summary
3. Basics of client-go
The Repositories
The Client Library
Kubernetes API Types
API Machinery
Creating and Using a Client
Versioning and Compatibility
API Versions and Compatibility Guarantees
Kubernetes Objects in Go
TypeMeta
ObjectMeta
spec and status
Client Sets
Status Subresources: UpdateStatus
Listings and Deletions
Watches
Client Expansion
Client Options
Informers and Caching
Work Queue
API Machinery in Depth
Kinds
Resources
REST Mapping
Scheme
Vendoring
glide
dep
Go Modules
Summary
4. Using Custom Resources
Discovery Information
Type Definitions
Advanced Features of Custom Resources
Validating Custom Resources
Short Names and Categories
Printer Columns
Subresources
Status subresource
Scale subresource
A Developer’s View on Custom Resources
Dynamic Client
Typed Clients
Anatomy of a type
Golang package structure
Typed client created via client-gen
controller-runtime Client of Operator SDK and Kubebuilder
Summary
5. Automating Code Generation
Why Code Generation
Calling the Generators
Controlling the Generators with Tags
Global Tags
Local Tags
deepcopy-gen Tags
runtime.Object and DeepCopyObject
client-gen Tags
informer-gen and lister-gen
Summary
6. Solutions for Writing Operators
Preparation
Following sample-controller
Bootstrapping
Business Logic
Kubebuilder
Bootstrapping
Business Logic
The Operator SDK
Bootstrapping
Business Logic
Other Approaches
Uptake and Future Directions
Summary
7. Shipping Controllers and Operators
Lifecycle Management and Packaging
Packaging: The Challenge
Helm
Kustomize
Other Packaging Options
Packaging Best Practices
Lifecycle Management
Production-Ready Deployments
Getting the Permissions Right
Automated Builds and Testing
Custom Controllers and Observability
Logging
Monitoring, instrumentation, and auditing
Summary
8. Custom API Servers
Use Cases for Custom API Servers
Example: A Pizza Restaurant
The Architecture: Aggregation
API Services
Inner Structure of a Custom API Server
Delegated Authentication and Trust
Delegated Authorization
Writing Custom API Servers
Options and Config Pattern and Startup Plumbing
The First Start
Internal Types and Conversion
Writing the API Types
Conversions
Defaulting
Roundtrip Testing
Validation
Registry and Strategy
Generic registry
Strategy
Wiring a strategy into the generic registry
API Installation
Admission
Implementation
Registering
Plumbing resources
Deploying Custom API Servers
Deployment Manifests
Setting Up RBAC
Running the Custom API Server Insecurely
Certificates and Trust
Sharing etcd
Summary
9. Advanced Custom Resources
Custom Resource Versioning
Revising the Pizza Restaurant
Conversion Webhook Architecture
Conversion Webhook Implementation
Setting Up the HTTPS Server
Deploying the Conversion Webhook
Seeing Conversion in Action
Admission Webhooks
Admission Requirements in the Restaurant Example
Admission Webhook Architecture
Registering Admission Webhooks
Implementing an Admission Webhook
Admission Webhook in Action
Structural Schemas and the Future of CustomResourceDefinitions
Structural Schemas
Pruning Versus Preserving Unknown Fields
Controlling Pruning
IntOrString and RawExtensions
Default Values
Summary
A. Resources
General
Books
Tutorials and Examples
Articles
Repositories
Index
← Prev
Back
Next →
← Prev
Back
Next →