Book Image

The Kubernetes Operator Framework Book

By : Michael Dame
1 (1)
Book Image

The Kubernetes Operator Framework Book

1 (1)
By: Michael Dame

Overview of this book

From incomplete collections of knowledge and varying design approaches to technical knowledge barriers, Kubernetes users face various challenges when developing their own operators. Knowing how to write, deploy, and pack operators makes cluster management automation much easier – and that's what this book is here to teach you. Beginning with operators and Operator Framework fundamentals, the book delves into how the different components of Operator Framework (such as the Operator SDK, Operator Lifecycle Manager, and OperatorHub.io) are used to build operators. You’ll learn how to write a basic operator, interact with a Kubernetes cluster in code, and distribute that operator to users. As you advance, you’ll be able to develop a sample operator in the Go programming language using Operator SDK tools before running it locally with Operator Lifecycle Manager, and also learn how to package an operator bundle for distribution. The book covers best practices as well as sample applications and case studies based on real-world operators to help you implement the concepts you’ve learned. By the end of this Kubernetes book, you’ll be able to build and add application-specific operational logic to a Kubernetes cluster, making it easier to automate complex applications and augment the platform.
Table of Contents (16 chapters)
1
Part 1: Essentials of Operators and the Operator Framework
4
Part 2: Designing and Developing an Operator
9
Part 3: Deploying and Distributing Operators for Public Use

Building a container image

Kubernetes is a container orchestration platform, meaning that it is designed to run applications that have been built into containers. Even the core system components for Kubernetes, such as the API server and scheduler, run as containers. So, it should come as no surprise that the Operators developed for Kubernetes must also be built and deployed as containers.

For this process, a basic understanding of the fundamentals of working with containers is helpful. Fortunately, however, the Operator SDK abstracts away much of the configuration and command-line incantations to simple Makefile targets. These are build macros that help to automate the process of compiling binaries and container images (as well as pushing those images to a registry and deploying them in a cluster).

To see the full list of available targets provided by the Operator SDK, run the make help command within the project:

$ make help
Usage:
  make <target>
General...