Skip to content

kosmos-io/simple-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-controller

This repository implements a simple controller based on controller-runtime for watching AppService resources as defined with a CustomResourceDefinition (CRD).

Note: When your clone is done, you should "go mod tidy" and then "go mod vendor".

This example mainly demonstrates how to use the controller-runtime to create an operator from zero, including the following:

  1. How do initialize CRD-related files
  2. How to use code-generator to generate code
  3. How to implement controller business logic
  4. How to debug/deploy locally on a cluster

We use ./hack/update-codegen.sh to generate the deepcopy and register file.(update-codegen.sh comes from kosmos-io/kosmos&k8s.io/code-generator)

The update-codegen script will automatically generate the following files:

  • pkg/apis/v1/zz_generated.deepcopy.go
  • pkg/apis/v1/zz_generated.register.go

You should not edit these files, but run the script to generate your own files while writing your own controller.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published