About the Operator SDK

    Operators make it easy to manage complex, stateful applications on top of Kubernetes. However, writing an Operator today can be difficult because of challenges such as using low-level APIs, writing boilerplate, and a lack of modularity, which leads to duplication.

    The Operator SDK, a component of the Operator Framework, provides a command-line interface (CLI) tool that Operator developers can use to build, test, and deploy an Operator.

    Why use the Operator SDK?

    The Operator SDK simplifies this process of building Kubernetes-native applications, which can require deep, application-specific operational knowledge. The Operator SDK not only lowers that barrier, but it also helps reduce the amount of boilerplate code required for many common management capabilities, such as metering or monitoring.

    The Operator SDK is a framework that uses the controller-runtime library to make writing Operators easier by providing the following features:

    • Tools for scaffolding and code generation to quickly bootstrap a new project

    • Extensions to cover common Operator use cases

    • Metrics set up automatically in any generated Go-based Operator for use on clusters where the Prometheus Operator is deployed

    Operator authors with cluster administrator access to a Kubernetes-based cluster (such as OKD) can use the Operator SDK CLI to develop their own Operators based on Go, Ansible, or Helm. is embedded into the Operator SDK as the scaffolding solution for Go-based Operators, which means existing Kubebuilder projects can be used as is with the Operator SDK and continue to work.

    For an overview about basic Operator concepts and terminology, see .

    The Operator SDK provides the following workflow to develop a new Operator:

    1. Specify resources to watch by using the Operator SDK API.

    2. Define the Operator reconciling logic in a designated handler and use the Operator SDK API to interact with resources.

    3. Use the Operator SDK CLI to build and generate the Operator deployment manifests.

    Figure 1. Operator SDK workflow

    At a high level, an Operator that uses the Operator SDK processes events for watched resources in an Operator author-defined handler and takes actions to reconcile the state of the application.

    This guide provides an effective demonstration of the value of the Operator Framework for building and managing Operators, but it is limited in scope. The Operator Framework and its components are open source, so visit each project individually and learn what else you can do:

    If you want to discuss your experience, have questions, or want to get involved, join the .