-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Placement by cluster name requires managedcluster be labeled name=<cluster name> #16
Comments
@xiangjingli do you know the history of this label requirement? |
@mikeshng The managedCluster CR has the name label by default in midstream. So placementRule leverages the matchLabel functionality to get the clusters by cluster name. Has the name label been removed from managedCluster CR in upstream? If so, we can switch to get the clusters by matching the managedCluster meta.name. |
@xiangjingli the label doesn't seem to be there using just the upstream registration code. I think we can try doing label lookup first then if there are no results use a GET as a fallback? What do you think? /assign mikeshng |
@mikeshng yeah, it sounds good. There are two ways
It seems the first solution may get better performance. there is only one GET |
This problem still exists~, i think the ways said by @xiangjingli are good. It seems better if both support solution 1 and 2? |
Hi @ivan-cai thank you for your feedback. We are currently in the process of adopting OCM's Placement API https://github.com/open-cluster-management-io/placement which is the native Placement API for OCM across the whole project. If the community is interested in this enhancement for the PlacementRule API, please feel free to submit a fix. Sorry for the lack of update until now. |
Hi @mikeshng,adopting Placement API is a good choice. But what time can it be done? |
@ivan-cai we are targeting before end of this year. |
We have implemented majority of the placement API integration. Follow steps in https://github.com/open-cluster-management-io/OCM/blob/main/solutions/deploy-a-helm-chart/READEME.md to give it a try. More docs and other misc changes to come later but for now the integration should work fine. |
@mikeshng, We replaced usage of PlacementRule with Placement, do we still need to keep the workaround labeling the managed cluster? |
No, it shouldn't be needed but it's highly recommended you give it a try first. Also, it might depend on your Placement spec. If your Placement spec contains the label criteria then it needs to be there. @xiangjingli could you please confirm? Thanks. |
Thanks, will check. |
I wonder why a managedcluster needs to be labeled with its name, when its
metadata.name
could be used?multicloud-operators-subscription/pkg/utils/placementrule/placement.go
Line 52 in 3a52d8b
If ocm requires a managedcluster be labeled with its name for placement, I wonder why ocm does not so label each managedcluster?
The text was updated successfully, but these errors were encountered: