Overview

Overview

Overview

Here I will explain about how to write sample-controller step by step. Although this is not the only way to implement a Kubernetes operator and there are very convenient tools to help create a custom Kubernetes operator e.g. kubebuilder, operator-sdk, you’ll gain deeper understanding of Kubernetes internal implementaion with this documentation, which will be helpful for OSS code reading, daily debuging, and implementing Kubernetes operators.

0. Initialize Go module

Initialize Go module.

1. Define Go types for CRD

Define Go types for Custom Resource Definition Foo.

2. Generate codes

Generate Go codes with code-generator.

3. Create CRD yaml file

Create CustomResourceDefinition yaml file manually.

4. Checkpoint

Check the behavior at this point.

5. Implement reconciliation

Implement controller.