Skip to content

Lacking guidance on nuances of writing controllers #309

@grantr

Description

@grantr

I'd like us to write down or link to some of the accumulated wisdom and best practices learned about how to write Kubernetes controllers. This will make onboarding new contributors easier (see knative/eventing#308 (comment)) and help keep old contributors honest (and informed) about why we do things a certain way.

In particular, I think these questions need well-supported answers:

  • When should status be updated during reconcile?
  • What counts as a reconcile error (i.e., what errors should requeue the resource)?
  • When is it ok to update the spec of a resource?
  • Can I update a different resource during reconcile?

When these answers already exist in https://github.com/kubernetes/community/tree/master/contributors/devel (https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md and https://github.com/kubernetes/community/blob/master/contributors/devel/controllers.md probably have some great info), we should link to them, since those documents are hard to find otherwise.

/cc @pmorie @mattmoor @dprotaso @evankanderson @n3wscott

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions