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
EKS and ROSA are implemented in (relatively) standalone sets of controllers. These are currently grouped with the associated feature gates.
4
+
5
+
However, the feature gate mechanism has no specifier for GA, meaning that both implementations have stayed in beta.
6
+
7
+
This proposal supercedes `docs/proposal/20250314-optional-controllers.md`.
8
+
9
+
# Background
10
+
11
+
Cluster API Provider for AWS offers a `--feature-flags` argument to manage introduction of new features.
12
+
13
+
This allows features to move through `alpha` and `beta` phases, but there is not currently a defined path to general availability.
14
+
15
+
Specifically of interest is controllers for the `EKS` and ROSA`, which offer optional features to the program.
16
+
17
+
This proposal focuses on how these controllers could be grouped in order to remain optional, while also giving a path to GA.
18
+
19
+
## Goals
20
+
21
+
- Allow features spanning groups of controllers to graduate, while also remaining optional
22
+
23
+
## Non-goals
24
+
25
+
- Provide a generalized path to general availbility
26
+
27
+
28
+
## Proposed solution
29
+
30
+
Introduce a new argument, `--disable-controllers`, which allows controllers to be logically grouped as feature sets and turned on and off independently.
31
+
32
+
The groups and their disabled status will be tracked in a map within a private module, and can be queried via exposed functions.
33
+
34
+
The map's structure and functions would be as follows.
35
+
36
+
```go
37
+
vardisabledControllers = map[string]bool{
38
+
ControllerGroupName: false,
39
+
}
40
+
41
+
// IsDisabled checks if a controller is disabled.
42
+
// If the name provided is not in the map, this will return 'false'.
43
+
funcIsDisabled(namestring) bool
44
+
45
+
// GetValidNames returns a list of controller names that are valid to disable.
46
+
// Note: these are the entries in the `disabledControllers` variable.
47
+
// Used for error and help messages
48
+
func GetValidNames() []string
49
+
50
+
// ValidateNamesAndDisable validates a list of controller names against the known set, and disables valid names.
Within `main.go`, `ValidateNamesAndDisable` will check against the contents of the `--disable-controllers` slice.
55
+
Valid entires will then be marked as `true`, indicating they are disabled.
56
+
57
+
Before initializing a controller or group of controllers, `IsDisabled` can be checked to determine whether or not they should register with the manager and start.
58
+
59
+
If a controller is disabled, a log message indicating it is disabled should be emitted.
60
+
This will aid users in troubleshooting, should the deployment behave unexpectedly.
61
+
62
+
## Logical groups
63
+
64
+
EKS and ROSA are currently behind feature gate checks.
65
+
These checks can be updated to instead use `IsDisabled` and entries within the `disabledControllers` map can be made.
66
+
67
+
## Core controllers and alternatives
68
+
69
+
The proposal `2025-01-07-aws-self-managed-feature-gates.md` was merged and planned to add `AWSMachine` and `AWSCluster` feature gates.
70
+
This merged with lazy concensus and the implementation was proposed in [PR #5284](https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/5284).
71
+
72
+
However, maintainers were opposed to moving these core controllers into feature gates, which would have put them into a permanent pre-GA phase.
73
+
This leads to a conflict between the implementation and the proposal, which was indeed accepted.
74
+
75
+
This current proposal includes the ability to disable `AWSMachine` and `AWSCluster` as a compromise, using the `unmanaged` set; it achieves the goals of the original proposal, while addressing the objections to the proposed implementation.
fmt.Sprintf("Label value that the controller watches to reconcile cluster-api objects. Label key is always %s. If unspecified, the controller watches for all cluster-api objects.", clusterv1.WatchLabel),
605
619
)
606
620
621
+
fs.StringSliceVar(
622
+
&disabledControllers,
623
+
"disable-controllers",
624
+
nil,
625
+
fmt.Sprintf("Sets of controllers that should be disabled for this instance of the controller manager in a comma-separated list. Options are: %q", strings.Join(controllers.GetValidNames(), ",")),
0 commit comments