mirror of
https://github.com/kubernetes/sample-controller.git
synced 2024-10-06 07:42:17 +08:00
35 lines
1.2 KiB
Markdown
35 lines
1.2 KiB
Markdown
|
# sample-controller
|
||
|
|
||
|
This repository implements a simple controller for watching Foo resources as
|
||
|
defined with a CustomResourceDefinition (CRD).
|
||
|
|
||
|
It makes use of the generators in [k8s.io/code-generator](https://github.com/kubernetes/code-generator)
|
||
|
to generate a typed client, informers, listers and deep-copy functions. You can
|
||
|
do this yourself using the `./hack/update-codegen.sh` script.
|
||
|
|
||
|
The `update-codegen` script will automatically generate the following files &
|
||
|
directories:
|
||
|
|
||
|
* `pkg/apis/samplecontroller/v1alpha1/zz_generated.deepcopy.go`
|
||
|
* `pkg/client/`
|
||
|
|
||
|
Changes should not be made to these files manually, and when creating your own
|
||
|
controller based off of this implementation you should not copy these files and
|
||
|
instead run the `update-codegen` script to generate your own.
|
||
|
|
||
|
# Purpose
|
||
|
|
||
|
This is an example of how to build a kube-like controller with a single type.
|
||
|
|
||
|
# Compatibility
|
||
|
|
||
|
HEAD of this repository will match HEAD of k8s.io/apimachinery and
|
||
|
k8s.io/client-go.
|
||
|
|
||
|
# Where does it come from?
|
||
|
|
||
|
`sample-controller` is synced from
|
||
|
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/sample-controller.
|
||
|
Code changes are made in that location, merged into k8s.io/kubernetes and
|
||
|
later synced here.
|