Go to file
Antoine Pelisse 795dabe08b Update openapi to use kube-openapi code
Kubernetes-commit: 3ed58475c4fd99c56bba63059ca75891f417e55a
2017-10-18 15:19:56 -07:00
artifacts/examples Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
Godeps Update openapi to use kube-openapi code 2017-10-18 15:19:56 -07:00
hack Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
pkg Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
vendor Merge pull request #52753 from munnerz/sample-controller 2017-10-26 12:35:59 +00:00
BUILD Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
controller.go Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
LICENSE Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
main.go Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
OWNERS Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00
README.md Add sample CustomResourceDefinition controller 2017-10-09 19:19:34 +01:00

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 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.