Problem:
The clusternet used cluster object is different from tke and tkestack, ManagedCluster in cluster is used to define the cluster managed by hub cluster, but tkestck/tke also have similar cluster obj but different spac, so it will cause compatibility issue and hard to integration.
Solution:
-
In order to consolidate them to support both user case, a mutatingWebhook get involved as the bridge to sync them, after that,
both side only focus on individual business logic. With this loose-coupled design, the tke/tkestack still can use existing cluster object for create/list/query operation, clusternet focus on ManagedCluster register and status update.
-
The mutatingWebhook should designed as provider or plug-in mechanism so that support tke and tkestack case
-
sync status from ManagedCluster to tke and tkestack
root@vm-0-80-ubuntu:~/submariner-test# kubectl get cluster.platform.tkestack.io
NAME CREATED AT
global 2021-06-17T08:07:05Z
root@vm-0-80-ubuntu:~/submariner-test#
root@VM-0-56-ubuntu:~# kubectl get ManagedCluster.clusters.clusternet.io -n clusternet-fnbgq
NAME CLUSTER-ID CLUSTER-TYPE KUBERNETES READYZ AGE
clusternet-cluster-gh7kt fdcfbb35-e2f5-4327-b773-d39c60319822 EdgeClusterSelfProvisioned v1.19.7 true 6d16h
root@VM-0-56-ubuntu:~#
Reference:
Problem:
The clusternet used cluster object is different from tke and tkestack,
ManagedClusterin cluster is used to define the cluster managed by hub cluster, but tkestck/tke also have similar cluster obj but different spac, so it will cause compatibility issue and hard to integration.Solution:
In order to consolidate them to support both user case, a mutatingWebhook get involved as the bridge to sync them, after that,
both side only focus on individual business logic. With this loose-coupled design, the tke/tkestack still can use existing cluster object for create/list/query operation, clusternet focus on
ManagedClusterregister and status update.The mutatingWebhook should designed as
providerorplug-inmechanism so that supporttkeandtkestackcasesync status from
ManagedClustertotkeandtkestackReference: