Skip to content
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

Feature Request: Cluster API integration - automatic installation of klusterlet on managed clusters #47

Open
grzesuav opened this issue May 4, 2022 · 14 comments
Assignees

Comments

@grzesuav
Copy link

grzesuav commented May 4, 2022

Proposal

Currently you can use ClusterAPI to spin up new kubernetes clusters. It has different provider implementations, however. most of them (I didn't checked all) provides CA secrets to access managed cluster. Having this, and having OCM in admin/hub cluster, it would be useful to automatically install klusterjet agent of any new cluster and join them to the hub.

@qiujian16
Copy link
Member

/kind feature

Thanks, I think it is a great idea. Do you expect that this will be implemented in clusteradm?

@grzesuav
Copy link
Author

grzesuav commented May 9, 2022

Actually no, it must be implemented in some watcher/controller in the hub cluster to dynamically watch which clusters are being created by ClusterAPI and take appropriate action

@grzesuav
Copy link
Author

Looking at https://github.com/open-cluster-management-io/registration-operator I think it should be a companion operator for them, like setting up klusterjet parton remote cluster and provide bootstrapping token

@qiujian16
Copy link
Member

Yes, I think it is possible.

@yandooo
Copy link

yandooo commented May 20, 2022

what would be steps/code to register managed cluster assuming we have user kubeconfig from Cluster API?

@berenss
Copy link

berenss commented May 20, 2022

I think you want to look at registration controller: https://open-cluster-management.io/getting-started/core/register-cluster/#prerequisite

@mikeshng
Copy link
Member

what would be steps/code to register managed cluster assuming we have user kubeconfig from Cluster API?

You can use the link Scott provided above. In summary:

If you are using our clusteradm tool and you have ran the clusteradm init command on the "hub" cluster and have the token output for managed cluster registration. You can then use clusteradm join --kubeconfig /path/to/managed_cluster_kubeconfig --hub-token <token_here> --hub-apiserver <https://apiserver_here> --cluster-name <cluster_name_of_your_choice> --wait

If you don't want to use clusteradm cli tool. You can refer to https://github.com/open-cluster-management-io/registration-operator#deploy-hub-spoke-deployment In short it will,

  • install the klusterlet operator
  • create a namespace for klusterlet agent deploy ie: open-cluster-management-agent
  • kubectl --kubeconfig /path/to/managed_cluster_kubeconfig create secret generic bootstrap-hub-kubeconfig --from-file=kubeconfig=/path/to/hub_cluster_kubeconfig> -n open-cluster-management-agent
  • create a klusterlet CR see sample here

@yandooo
Copy link

yandooo commented May 22, 2022

clusteradm looks easier initial approach. Thanks

@mikeshng mikeshng changed the title Feature Request: Cluster API integration - automatic installation of klusterjet on managed clusters Feature Request: Cluster API integration - automatic installation of klusterlet on managed clusters Jul 26, 2022
xuezhaojun pushed a commit to xuezhaojun/OCM that referenced this issue Mar 21, 2023
@github-actions
Copy link

This issue is stale because it has been open for 120 days with no activity. After 14 days of inactivity, it will be closed. Remove the stable label to prevent this issue from being closed.

@github-actions github-actions bot added the Stale label Jul 19, 2023
@qiujian16 qiujian16 removed the Stale label Jul 19, 2023
Copy link

This issue is stale because it has been open for 120 days with no activity. After 14 days of inactivity, it will be closed. Remove the stable label to prevent this issue from being closed.

@github-actions github-actions bot added the Stale label Nov 17, 2023
@qiujian16 qiujian16 removed the Stale label Nov 20, 2023
@qiujian16
Copy link
Member

/assign

I will do some investigation on this.

@qiujian16
Copy link
Member

We have a discussion on the last community meeting. There are some good points:

  1. It will be more useful if the cluster provisioned by capi can be automatically imported into ocm hub.
  2. capi management cluster does not necessarily to be the ocm hub.
  3. It should be possible to run capi management cluster as a managed cluster of ocm, we could have an addon installed on capi management cluster to do automatic cluster import.

@qiujian16
Copy link
Member

will do a demo in the following community meeting after 0.13.0 release

zhujian7 added a commit to zhujian7/ocm that referenced this issue May 6, 2024
@qiujian16
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

5 participants