Skip to content

Conversation

@cbarbian-sap
Copy link
Contributor

@cbarbian-sap cbarbian-sap commented Feb 12, 2025

Additional managed types

By its nature, component-operator-runtime tries to handle extension types (such as CRDs or API groups added through APIService federation), and instances of these types, in a smart way.

That is, if the component contains extension types, and also instances of these types, it tries to process things in the right order; that means, during apply the instances will be applied as late as possible (to ensure that controllers and webhooks are up); and during delete, the instances will be deleted as early as possible (to ensure that controllers and webhooks are still there). Furthermore, during deletion, foreign instances (that is, instances of these types that are not part of the component) block the deletion of the whole component.

Sometimes, components are implicitly adding extension types to the cluster; in the sense that the extension types are not explicitly part of the manifests, but added in the dark through controllers, once running. A typical example are crossplane providers.

This PR tries to add some relief in this situation. Components can now list 'additional managed types', by implementing the TypeConfiguration interface; these 'additional managed types' will be treated in the same way as extension types which are explicitly mentioned in the manifest.

Improved APIService handling

Up to now, APIService objects were deployed along with the other regular (that was: unmanaged) objects of the current apply wave. As a consequence, if the federated API server was not yet ready, stale group version errors were returned by the discovery API of the main API server. To overcome this problem, APIService objects receive a special handling now, in the sense that they are reconciled (in the apply wave) after all other regular objects, and before all managed instances. That means: within each apply order, objects are deployed to readiness in three sub stages

  • regular objects (all 'normal' objects)
  • late objects (currently, this is only APIService objects)
  • instances of managed types (that is instances of types which are added in this component as CRD or through an APIService)

Within each of these sub groups, the static ordering defined in sortObjectsForApply() is effective.

@cbarbian-sap cbarbian-sap marked this pull request as draft February 12, 2025 09:16
@cbarbian-sap cbarbian-sap changed the title add option to specify additional managed types (1) add option to specify additional managed types Feb 13, 2025
@cbarbian-sap cbarbian-sap marked this pull request as ready for review February 19, 2025 09:45
@cbarbian-sap cbarbian-sap merged commit b5565ba into main Feb 19, 2025
8 checks passed
@cbarbian-sap cbarbian-sap deleted the additional-managed-types branch February 19, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants