|
| 1 | +--- |
| 2 | +title: "Enhanced Extension Management: Introducing `autoEnable` and `clusterCompatibility`" |
| 3 | +linkTitle: "Enhanced Extension Management: Introducing `autoEnable` and `clusterCompatibility`" |
| 4 | +newsSubtitle: June 18, 2025 |
| 5 | +publishdate: 2025-06-18 |
| 6 | +authors: |
| 7 | +- avatar: https://avatars.githubusercontent.com/timuthy |
| 8 | + login: timuthy |
| 9 | + name: Tim Usner |
| 10 | +aliases: ["/blog/2025/06/18/enhanced-extension-management-introducing-autoenable-and-clustercompatibility"] |
| 11 | +--- |
| 12 | + |
| 13 | +Gardener's extension mechanism has been enhanced with two new fields in the `ControllerRegistration` and `operatorv1alpha1.Extension` APIs, offering operators more granular control and improved safety when managing extensions. These changes, detailed in [PR #11982](https://github.com/gardener/gardener/pull/11982), introduce `autoEnable` and `clusterCompatibility` for resources of `kind: Extension`. |
| 14 | + |
| 15 | +### Fine-Grained Automatic Enablement with `autoEnable` |
| 16 | + |
| 17 | +Previously, operators could use the `globallyEnabled` field to automatically enable an extension resource for all shoot clusters. This field is now deprecated and will be removed in Gardener `v1.123`. |
| 18 | + |
| 19 | +The new `autoEnable` field replaces `globallyEnabled` and provides more flexibility. Operators can now specify an array of cluster types for which an extension should be automatically enabled. The supported cluster types are: |
| 20 | +* `shoot` |
| 21 | +* `seed` |
| 22 | +* `garden` |
| 23 | + |
| 24 | +This allows, for example, an extension to be automatically enabled for all seed clusters or a combination of cluster types, which was not possible with the boolean `globallyEnabled` field. |
| 25 | + |
| 26 | +If `autoEnable` includes `shoot`, it behaves like the old `globallyEnabled: true` for shoot clusters. If an extension is not set to `autoEnable` for a specific cluster type, it must be explicitly enabled in the respective cluster's manifest (e.g., `Shoot` manifest for a shoot cluster). |
| 27 | + |
| 28 | +```yaml |
| 29 | +# Example in ControllerRegistration or operatorv1alpha1.Extension spec.resources |
| 30 | +- kind: Extension |
| 31 | + type: my-custom-extension |
| 32 | + autoEnable: |
| 33 | + - shoot |
| 34 | + - seed |
| 35 | + # globallyEnabled: true # This field is deprecated |
| 36 | +``` |
| 37 | + |
| 38 | +### Ensuring Correct Deployments with `clusterCompatibility` |
| 39 | + |
| 40 | +To enhance safety and prevent misconfigurations, the `clusterCompatibility` field has been introduced. This field allows extension developers and operators to explicitly define which cluster types a generic Gardener extension is compatible with. The supported cluster types are: |
| 41 | +* `shoot` |
| 42 | +* `seed` |
| 43 | +* `garden` |
| 44 | + |
| 45 | +Gardener will validate that an extension is only enabled or automatically enabled for cluster types listed in its `clusterCompatibility` definition. If `clusterCompatibility` is not specified for an `Extension` kind, it defaults to `['shoot']`. This provides an important safeguard, ensuring that extensions are not inadvertently deployed to environments they are not designed for. |
| 46 | + |
| 47 | +```yaml |
| 48 | +# Example in ControllerRegistration or operatorv1alpha1.Extension spec.resources |
| 49 | +- kind: Extension |
| 50 | + type: my-custom-extension |
| 51 | + autoEnable: |
| 52 | + - shoot |
| 53 | + clusterCompatibility: # Defines where this extension can be used |
| 54 | + - shoot |
| 55 | + - seed |
| 56 | +``` |
| 57 | +
|
| 58 | +### Important Considerations for Operators |
| 59 | +
|
| 60 | +* **Deprecation of `globallyEnabled`**: Operators should migrate from `globallyEnabled` to the new `autoEnable` field for `kind: Extension` resources. `globallyEnabled` is deprecated and scheduled for removal in Gardener `v1.123`. |
| 61 | +* **Breaking Change for Garden Extensions**: The introduction of `clusterCompatibility` is a breaking change for operators managing garden extensions via `gardener-operator`. If your `Garden` custom resource specifies `spec.extensions`, you must update the corresponding `operatorv1alpha1.Extension` resources to include `garden` in the `clusterCompatibility` array for those extensions intended to run in the garden cluster. |
| 62 | + |
| 63 | +These new fields provide more precise control over extension lifecycle management across different cluster types within the Gardener ecosystem, improving both operational flexibility and system stability. |
| 64 | + |
| 65 | +For further details, you can review the [original pull request (#11982)](https://github.com/gardener/gardener/pull/11982) and watch the [demonstration in the Gardener Review Meeting (starting at 41:23)](https://youtu.be/HguO_KY86ac?t=2483). |
0 commit comments