Coder Social home page Coder Social logo

Comments (4)

dixudx avatar dixudx commented on June 22, 2024

If there're multiple child clusters, how can I tell which clsrr/mcls belongs to which child cluster?

$ kubectl get clsrr
NAME                                              CLUSTER ID                             STATUS     AGE
clusternet-dc91021d-2361-4f6d-a404-7c33b9e01118   dc91021d-2361-4f6d-a404-7c33b9e01118   Approved   3d6h
$ kubectl get mcls -A -o wide
NAMESPACE          NAME                       CLUSTER ID                             CLUSTER TYPE                 SYNC MODE   KUBERNETES   READYZ   AGE
clusternet-dhxfs   clusternet-cluster-dzqkw   dc91021d-2361-4f6d-a404-7c33b9e01118   EdgeClusterSelfProvisioned   Dual        v1.19.10     true     7d23h

The auto-generated unique clusterID is a inline field for ClusterRegistrationRequest.Spec and ManagedCluster.Spec. Moreover, label clusters.clusternet.io/cluster-id=<a-cluster-uid> is appended for every ClusterRegistrationRequest and ManagedCluster object. With this label, you can also use label selector to filter target objects.

Is there anyway I can specify this clusterID in clusternet-agent manifest?

Currently, no and won't. The reason why we don't provider clusterID customization is that this clusterID is critically important for Clusternet, where we must make sure it is unique.

But you can specify clusterName in clusternet-agent command line.

from clusternet.

fengye87 avatar fengye87 commented on June 22, 2024

So the short answer is, I should specify cluster-reg-name in the clusternet-agent manifest and match that name with clsrr.Spec.ClusterName to find out the corresponding clusterID?

from clusternet.

dixudx avatar dixudx commented on June 22, 2024

@fengye87 A short answer is,

$ kubectl get clsrr -l clusters.clusternet.io/cluster-name=YOUR-CLUSTER-NAME
$ kubectl get mcls -A -l clusters.clusternet.io/cluster-name=YOUR-CLUSTER-NAME

If you get your clusterID, you can also query like this,

$ kubectl get clsrr -l clusters.clusternet.io/cluster-id=YOUR-CLUSTER-ID
$ kubectl get mcls -A -l clusters.clusternet.io/cluster-id=YOUR-CLUSTER-ID

from clusternet.

fengye87 avatar fengye87 commented on June 22, 2024

@dixudx Got it, thanks! I'm closing this issue.

from clusternet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.