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
@@ -324,72 +324,96 @@ Currently, managedClusterSet has three consumers: [placement](https://github.com
324
324
325
325
So we could finish the migration by four steps, and step 1 and step 2 will be finished in OCM 0.7.0. and step 3 and step 4 will be finished in OCM 0.8.0
326
326
327
-
1. [Implement in OCM 0.7.0]Update the managedClusterSet API which only includes an exclusive way to select target managedClusters.
327
+
1. [Implement in OCM 0.7.0]Update the managedClusterSet API which only includes "LegacyClusterSetLabel" in clusterSelector.
328
328
329
329
```go
330
+
// ManagedClusterSetSpec describes the attributes of the ManagedClusterSet
330
331
type ManagedClusterSetSpec struct {
331
-
// Selector represents a selector of ManagedClusters by labels and names.
332
+
// ClusterSelector represents a selector of ManagedClusters
2.[Implement in OCM 0.7.0]`multicloud-operators-foundation`, `submariner-addon`, `placement` change the code to integrate with new managedClusterSet api
356
+
357
+
a. `multicloud-operators-foundation` uses managedClusterSet for resource group purpose. So it should only watch the following managedClusterSets:
358
+
-`spec.ClusterSelector.SelectorType` is `LegacyClusterSetLabel`
359
+
360
+
b. `submariner-addon` uses managedClusterSet group clusters based on the network. And in different managedClusterSet, the clusters should be exclusive. So it should only watch the following managedClusterSet:
361
+
-`spec.ClusterSelector.SelectorType` is `LegacyClusterSetLabel`
362
+
363
+
c. `placement` using new `ClusterSelector` to select target clusters.
364
+
365
+
3.[Implement in OCM 0.8.0] Update full managedClusterSet api and RBAC
366
+
```go
367
+
typeManagedClusterSetSpecstruct {
368
+
// Selector represents a selector of ManagedClusters.
// "" means to use the current mechanism of matching label <cluster.open-cluster-management.io/clusterset:<ManagedClusterSet Name>.
337
-
// (future) "LabelSelector" means to use the LabelSelector to select target managedClusters
374
+
// "LegacyClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:<ManagedClusterSet Name>"" to select target clusters.
375
+
// "LabelSelector" means to use the LabelSelector to select target managedClusters
338
376
// "ExclusiveLabel" means to use a particular cluster label. It is guaranteed that clustersets with same label key are exclusive with each others
339
377
// +optional
340
378
SelectorTypeSelectorType`json:"selectorType"`
341
379
342
380
// ExclusiveLabel defines one label which clusterset could use to select target managedClusters. In this way, we will:
343
381
// 1. Guarantee clustersets with same label key are exclusive
344
382
// 2. Enable additional permission check when cluster joining/leaving a clusterset (the label key should start with the reserved prefix "cluster.open-cluster-management.io/" and "info.open-cluster-management.io/");
//Key is "cluster.open-cluster-management.io/clusterset" by default and can only be cluster.open-cluster-management.io/
397
+
//ManagedClusterLabel defines one label
398
+
typeManagedClusterLabelstruct {
357
399
Keystring`json:"key"`
358
-
//Value can only be empty or the name of the clusterset.
359
400
Valuestring`json:"value"`
360
401
}
361
402
```
362
403
363
-
-`LabelSelector` will not be included
364
-
-`ExclusiveLabel.Key` must be `cluster.open-cluster-management.io/clusterset` and `ExclusiveLabel.Value` must be `ManagedClusterset Name`
365
-
- Both `managedclusterset/join` and `managedclusters/label` permission will be supported
404
+
- Support both `join` and `label` permission
366
405
367
-
2.[Implement in OCM 0.7.0]`multicloud-operators-foundation`, `submariner-addon`, `placement` change the code to integrate with new managedClusterSet api
406
+
4.[Implement in OCM 0.8.0]`multicloud-operators-foundation`, `submariner-addon`, `placement` change the code to integrate with new managedClusterSet api
368
407
369
408
a. `multicloud-operators-foundation` uses managedClusterSet for resource group purpose. So it should only watch the following managedClusterSets:
370
-
-`spec.ClusterSelector.SelectorType` is `ExclusiveLabel` and the `ExclusiveLabel.Key` must be `cluster.open-cluster-management.io/clusterset`
371
-
-`spec.ClusterSelector.SelectorType` is ""
372
-
373
-
b. `multicloud-operators-foundation` gives the users `join` permission to a managedClusterSet if the user has "admin" permission to the managedClusterSet. So the `join` permission should be changed with the following rule:
-`spec.ClusterSelector.SelectorType` is `LegacyClusterSetLabel`
410
+
-`spec.ClusterSelector.SelectorType` is `ExclusiveLabel` and `spec.ClusterSelector.ExclusiveLabel.Key` is `cluster.open-cluster-management.io/clusterset`, value is `ManagedClusterSet Name`
380
411
381
-
c. `submariner-addon` uses managedClusterSet group clusters based on the network. And in different managedClusterSet, the clusters should be exclusive. So it should only watch the following managedClusterSet:
382
-
- `spec.ClusterSelector.SelectorType`is `ExclusiveLabel` and the `ExclusiveLabel.Key` must be `cluster.open-cluster-management.io/clusterset`, the `ExclusiveLabel.Value` must be managedClusterSet name.
383
-
- `spec.ClusterSelector.SelectorType`is ""
384
-
385
-
d. `placement` using new `ClusterSelector` to select target clusters.
386
-
387
-
3. [Implement in OCM 0.8.0] Update full managedClusterSet api and RBAC
388
-
- Include `LabelSelector`
389
-
- Take off the restriction for “ExclusiveLabel.Key” and “ExclusiveLabel.Value”
390
-
- Deprecate `managedclusterset/join` permission
412
+
b. `submariner-addon` uses managedClusterSet group clusters based on the network. And in different managedClusterSet, the clusters should be exclusive. So it should only watch the following managedClusterSet:
413
+
-`spec.ClusterSelector.SelectorType` is `LegacyClusterSetLabel`
414
+
-`spec.ClusterSelector.SelectorType` is `ExclusiveLabel` and `spec.ClusterSelector.ExclusiveLabel.Key` is `cluster.open-cluster-management.io/clusterset`, value is `ManagedClusterSet Name`
391
415
392
-
4. [Implement in OCM 0.8.0] `placement` uses the new managedClusterSet api to select managedClusters for each managedClusterSet.
416
+
c.`placement`using new `ClusterSelector`to select target clusters.
393
417
394
418
## Upgrade / Downgrade Strategy
395
419
The new api is compatible with the previous version. So there is no external work needed when upgrading
0 commit comments