You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Watch additional resources from your controller do the following in your controller.go:
209
214
210
-
Use the following annotation to generate RBAC rules to allow your controller to read and write resources when
211
-
running in a container in a Kubernetes cluster.
215
+
1. Add a `gc.Watch*` call to the `ProvideController`. e.g. Call gc.[WatchTransformationKeyOf](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/controller#example-GenericController-WatchTransformationKeyOf)
216
+
- This will trigger Reconcile calls for events
217
+
2. Add an [// +informers:](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/controller#example-package) annotation
218
+
to the `type <Kind>Controller struct` with the type of the resource you are watching
219
+
- This will make sure the informers that watch for events are started
220
+
3. Add an [// +rbac:](https://godoc.org/github.com/kubernetes-sigs/kubebuilder/pkg/gen/controller#example-package)
221
+
annotation to the `type <Kind>Controller struct` with the type of the resource you are watching
222
+
- This will make sure the RBAC rules that allow the controller to watch events in a cluster are generated
0 commit comments