Skip to content

create a mutatingWebhook as the adapter between clusternet obj and tke cluser obj #1

@huxiaoliang

Description

@huxiaoliang

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:

  1. 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.

  2. The mutatingWebhook should designed as provider or plug-in mechanism so that support tke and tkestack case

  3. sync status from ManagedCluster to tke and tkestack

  • 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# 
  • clusternet
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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions