Skip to content

Commit 7c89339

Browse files
committed
Updated to include some risk/mitigations
1 parent fd12192 commit 7c89339

File tree

1 file changed

+34
-15
lines changed
  • enhancements/sig-architecture/179-work-feedback-scrape-type

1 file changed

+34
-15
lines changed

enhancements/sig-architecture/179-work-feedback-scrape-type/README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,18 @@ be a good place to talk about core concepts and how they relate.
8484

8585
### Risks and Mitigation
8686

87-
What are the risks of this proposal and how do we mitigate. Think broadly. For
88-
example, consider both security and how this will impact the larger OKD
89-
ecosystem.
87+
#### Risk #1: Too many watch events and update calls to the ManifestWork.
9088

91-
How will security be reviewed and by whom? How will UX be reviewed and by whom?
89+
This will be mitigated by limiting when the ManifestWork controller sends updates to the ManifestWork and to stop processing WATCH events once the ManifestWork is "Ready".
9290

93-
Consider including folks that also work outside your immediate sub-project.
91+
ManifestWork Controller will parse the response from the informer watch and only send an update to the ManifestWork if there is an update on the feedbackRules.
9492

95-
## Design Details
93+
ManifestWork Controller that registers informers per resource, will unregister the informer once the ManifestWork is Ready.
9694

97-
#### ManifestWork CRD Changes
98-
```
95+
96+
## Design Details
97+
### ManifestWorkReplicaSet CRD changes
98+
```yaml
9999
apiVersion: work.open-cluster-management.io/v1alpha1
100100
kind: ManifestWorkReplicaSet
101101
...
@@ -111,6 +111,22 @@ spec:
111111
....
112112
```
113113

114+
#### ManifestWork CRD changes
115+
```yaml
116+
apiVersion: work.open-cluster-management.io/v1alpha1
117+
kind: ManifestWork
118+
...
119+
spec:
120+
manifestConfigs:
121+
- resourceIdentifier:
122+
group: apps
123+
resource: deployments
124+
namespace: default
125+
name: hello
126+
feedbackScrapeType: WATCH (Options: WATCH | POLL, POLL is default behavior)
127+
....
128+
```
129+
114130
This change will also be populated upwards to the ManifestWorkReplicaSet level of
115131
`spec.manifestWorkTemplate.manifestConfigs`.
116132

@@ -127,8 +143,8 @@ sequenceDiagram
127143
128144
opt if feedbackScrapeType == WATCH
129145
A->>B: (WATCH) event for resource changes
130-
B->>B: feedbackRules & conditionRule Updates
131-
B->>C: (WATCH) for feedbackRule updates
146+
B->>B: feedbackRules & conditionRule Updates (if there is any update)
147+
B->>C: (WATCH) for feedbackRule updates only (if Progressing = True & Degraded = False|not set)
132148
C->>C: Update status.Conditions
133149
end
134150
```
@@ -143,19 +159,22 @@ Poll remains as a safety net.
143159
Create a FeedbackScrape interface that polls or watches resources.
144160

145161
In the ManifestWork Controller (pkg/work/spoke/controllers/statuscontroller/availablestatus_controller.go)
146-
introduce a watch-based path alongside the existing poll loop. When syncing the ManifestWork, register a informer for the resource if `feedbackScrapeType` WATCH.
162+
introduce a watch-based path alongside the existing poll loop.
163+
164+
When syncing the ManifestWork, register a informer for the resource if `feedbackScrapeType` WATCH. If the `feedbackScrapeType` is no longer WATCH, unregister the informer. If the ManifestWork is in Ready state (Progressing == False and Degraded == False / NotSet), unregister the informer. This will prevent long running WATCH from triggering too many ManifestWork changes. If there is new rollout, and the status changes to Progressing, then register the informer again.
147165

148-
When there is a change seen on the WATCH type, patch the status conditions for that resource.
166+
When the informer recieves an event (create, update, delete), verify that there is a change on the fields defined in the `feedbackRules` and patch the status conditions for that resource. If there is no change on one of the `feedbackRules` field, ignore the WATCH event.
149167

150168
#### Hub Level ManifestWorkReplicaSet Controller Reconciler
151169

152-
The update to the hub level will be the same for the new feature of `feedbackScrapeType` WATCH | POLL. When the ManifestWork has an update in the status feedback, trigger a resync of the MWRS to get the status feedback details. Once the MWRS is `Ready` status which has completed the rollout, stop the reconciler to prevent overloading the KubeAPI. (`Ready` status Proposal is TBD)
170+
There should be no updates on the MWRS reconciler. The expected behavior is that when the ManifestWork has an update in the status feedback, trigger a resync of the MWRS to get the status feedback details.
153171

172+
In the current model, the MWRS controller is reconciled if there are changes to the ManifestWork (that are managed by manifestworkreplicaset), PlacementDecisions and Placements. Therefore any update to the status.Feedback on the ManifestWork should trigger the reconcile. Standard factory used [here](https://github.com/open-cluster-management-io/ocm/blob/main/pkg/work/hub/manager.go#L97-L98)
154173

155-
### Open Questions [optional]
156174

157-
> 1. Is there a limit that should be set on the `WATCH` type to prevent overloading of the KubeAPI?
175+
### Open Questions [optional]
158176

177+
TBD
159178

160179
### Upgrade / Downgrade Strategy
161180

0 commit comments

Comments
 (0)