Chapter 4: Developing an Operator with the Operator SDK
With a completed design outline for an Operator, it is now possible to begin the actual work of developing it. This means writing and compiling code that can be deployed onto an actual running Kubernetes cluster. For this chapter, the Operator SDK will be used to initialize the scaffolding of a boilerplate Operator project. From there, the technical steps to develop the rest of a basic Operator will be demonstrated as a tutorial. This guide will follow the Operator design already planned in Chapter 3, Designing an Operator – CRD, API, and Target Reconciliation, which focused on developing a Level II Operator to deploy and upgrade a simple Nginx Pod.
As a tutorial, this chapter will follow the process for building an Operator from scratch with Go. Beginning with the initialization of boilerplate project code, the guide will then follow through the steps of defining the Operator API and generating the corresponding CustomResourceDefinition...