🌱 Cluster Inventory(ClusterProfile) API Provider#48
Conversation
ClusterProfile) API Provider
|
Hello @everpeace thank you for opening the PR! |
Oh, thanks for the info. I now understand kubeconfig based providers can basically support "Push Model via Credentials in Secret (Not Recommended)" in KEP-4322. However, the kubeconfig provider seems to use different labels and key name for the Secret.
Yeah, agreed! Then, I will wait for KEP-5339 and the consumer library PR being merged and want to update this provider or add some implementation so to extract credentials via credslibrary as designed in KEP-5339 later. WDYT?? |
There was a problem hiding this comment.
One thing I got while reading this code that I dont think we handle case where cluster secret changes and we need to update-engaged cluster.
Cool! Thanks for the catch!
f4c93f0 adds the watch for Secrets and re-engaging the Cluster in manager when kubeconfig was updated.
I'm not so confident for my implementation being appropriate or not because I'm new to multicluster-runtime, particularly, how to stop/disengage existing Cluster in the manager (I just cancel() the context for the Cluster).
I would be appreciated if you gave review and some advice.
manual test result is also updated: https://gist.github.com/everpeace/4ba04f70830504fb1485279ba031d907
That's absolutely correct! |
Signed-off-by: Shingo Omura <[email protected]>
Signed-off-by: Shingo Omura <[email protected]>
Signed-off-by: Shingo Omura <[email protected]>
…nfig is changed. Signed-off-by: Shingo Omura <[email protected]>
f4c93f0 to
ec412db
Compare
Signed-off-by: Shingo Omura <[email protected]>
Signed-off-by: Shingo Omura <[email protected]>
ec412db to
b35387b
Compare
There was a problem hiding this comment.
@corentone
kubeconfig-based provider seems not following the secret management specification defined in KEP-4322: Cluster Inventory - Push Model via Credentials in Secret. It uses the different labels, data key, and has no consumer concept.
So, how about this cluster-inventory-api provider keeping the support fetching kubeconfig from Secret objects managed as defined in the KEP.
And, I'd like to support KEP-5339 in another PR once the KEP and its helper library being merged.
WDYT??
@mjudeikis @embik I implemented re-engaging the Cluster in Manager when its kubeconfig was updated. And, I also unit test for the provider including re-engaging test case by envtest.
Please take a look.
Signed-off-by: Shingo Omura <[email protected]>
ClusterProfile) API ProviderClusterProfile) API Provider
If I understand correctly from PR #45, the secret label and key in the kubeconfig provider are customizable. To work with the Cluster Inventory spec, we only need to set the |
I understand it is configurable. However, in the Cluster Inventory API KEP, one Cluster Profile can have multiple Secrets so that it can support multiple consumers like this: kind: ClusterProfile
metadata:
name: cluster1
..
---
kind: Secret
metadata:
name: kubeconfig-cluster1-for-consumer-x-but-name-is-not-important
metadata:
labels:
x-k8s.io/cluster-inventory-consumer: consumer-x
x-k8s.io/cluster-profile: cluster1
data:
Config: ...
---
kind: Secret
metadata:
name: kubeconfig-cluster1-for-consumer-y-but-name-is-not-important
metadata:
labels:
x-k8s.io/cluster-inventory-consumer: consumer-y
x-k8s.io/cluster-profile: cluster1
data:
Config: ...From the user perspective, when using the Cluster Inventory API:
|
Signed-off-by: Shingo Omura <[email protected]>
…new local manager Signed-off-by: Shingo Omura <[email protected]>
Signed-off-by: Shingo Omura <[email protected]>
|
Sorry for this PR moving slowly! I haven't forgotten it, just haven't gotten around to a better understanding of ClusterProfile so I can fully review this PR. But I promise it's on my TODO list. |
|
Thank you for updating your status! I'm looking forward to your another review round👍 |
Signed-off-by: Shingo Omura <[email protected]>
…ch can abstract how kubeconfigs are managed and retrieved. Signed-off-by: Shingo Omura <[email protected]>
d1e2781 to
58bdaed
Compare
There was a problem hiding this comment.
as agreed in #55 (comment):
- I cherry-picked @hdp617's commit in
97baa6ec5701e0 - 1ed9400 unifies both implementations into the cluster-inventory-api provider
And,
- test was also unified into mine
- examples are now based on CredentialProvider-based. (Secret-based strategy is comment-out just for reference)
PTAL 🙇
This provider now supports both CredentialProvider-based approach(KEP-5339) and Secret-based approach(KEP-4322). PTAL.
bfca3ba to
c9efaa0
Compare
embik
left a comment
There was a problem hiding this comment.
I think we aren't running tests successfully yet, let's try to get them working!
376d169 to
87eaf7e
Compare
Co-authored-by: Shingo Omura <[email protected]> Signed-off-by: Shingo Omura <[email protected]>
…api provider Signed-off-by: Shingo Omura <[email protected]>
Signed-off-by: Shingo Omura <[email protected]>
87eaf7e to
c6278a3
Compare
Co-authored-by: Marvin Beckers <[email protected]>
…"make moduels" Signed-off-by: Shingo Omura <[email protected]>
d67a0e7 to
c35aa8e
Compare
embik
left a comment
There was a problem hiding this comment.
/approve
Thank you so much for this contribution!
|
LGTM label has been added. DetailsGit tree hash: f156a1b5d54aef87ee9bd71325ab0f63b4ce6a3b |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik, everpeace The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR adds Cluster Inventory(
ClusterProfile) API Provider.The implementation heavily refers to the Cluster API Provider (
/providers/cluster-api).Note:
fixes #30