Coder Social home page Coder Social logo

Comments (7)

dixudx avatar dixudx commented on July 21, 2024

For case 1, this feature is already implemented. It should be work. I will verify this later.

For case 2, currently Clusternet does not sync resource changes back to parent cluster. And this should be a new feature.

from clusternet.

dixudx avatar dixudx commented on July 21, 2024

@panpan0000 We have a WeChat group. Please follow this artice to join with us. Welcome.

from clusternet.

panpan0000 avatar panpan0000 commented on July 21, 2024

@panpan0000 We have a WeChat group. Please follow this artice to join with us. Welcome.

ok. Thanks

===================
For case 2:

not sync back. but hub cluster can override the difference which child cluster made. just like KubeFed.
and moreover , when I accidentally delete the deployment from child cluster , I'm looking forward clusternet can restore it back .

from clusternet.

panpan0000 avatar panpan0000 commented on July 21, 2024

I just checked the desc obj, it's updated while I kubectl clusternet edit xxx
But the agent didn't sync up .
the leader agent log as below:

kubectl -n clusternet-system logs -f clusternet-agent-7667fd65df-xp72c
I0917 08:58:48.679124       1 app.go:57] FLAG: --add-dir-header="false"
I0917 08:58:48.679177       1 app.go:57] FLAG: --alsologtostderr="false"
I0917 08:58:48.679181       1 app.go:57] FLAG: --cluster-reg-name=""
I0917 08:58:48.679185       1 app.go:57] FLAG: --cluster-reg-name-prefix="clusternet-cluster"
I0917 08:58:48.679189       1 app.go:57] FLAG: --cluster-reg-parent-url="https://172.30.43.20:6443"
I0917 08:58:48.679192       1 app.go:57] FLAG: --cluster-reg-token="07401b.f395accd246ae52d"
I0917 08:58:48.679195       1 app.go:57] FLAG: --cluster-reg-type="EdgeCluster"
I0917 08:58:48.679198       1 app.go:57] FLAG: --cluster-status-collect-frequency="20s"
I0917 08:58:48.679202       1 app.go:57] FLAG: --cluster-status-update-frequency="3m0s"
I0917 08:58:48.679205       1 app.go:57] FLAG: --cluster-sync-mode="Dual"
I0917 08:58:48.679208       1 app.go:57] FLAG: --enable-tunnel-logging="false"
I0917 08:58:48.679212       1 app.go:57] FLAG: --feature-gates="AppPusher=true,SocketConnection=true"
I0917 08:58:48.679221       1 app.go:57] FLAG: --help="false"
I0917 08:58:48.679224       1 app.go:57] FLAG: --kubeconfig=""
I0917 08:58:48.679229       1 app.go:57] FLAG: --log-backtrace-at=":0"
I0917 08:58:48.679232       1 app.go:57] FLAG: --log-dir=""
I0917 08:58:48.679235       1 app.go:57] FLAG: --log-file=""
I0917 08:58:48.679238       1 app.go:57] FLAG: --log-file-max-size="1800"
I0917 08:58:48.679241       1 app.go:57] FLAG: --logtostderr="true"
I0917 08:58:48.679244       1 app.go:57] FLAG: --one-output="false"
I0917 08:58:48.679247       1 app.go:57] FLAG: --skip-headers="false"
I0917 08:58:48.679250       1 app.go:57] FLAG: --skip-log-headers="false"
I0917 08:58:48.679252       1 app.go:57] FLAG: --stderrthreshold="2"
I0917 08:58:48.679255       1 app.go:57] FLAG: --v="4"
I0917 08:58:48.679258       1 app.go:57] FLAG: --version=""
I0917 08:58:48.679261       1 app.go:57] FLAG: --vmodule=""
I0917 08:58:48.679281       1 agent.go:92] current identity lock id "clusternet-agent-7667fd65df-xp72c_ebcdba43-d424-45b4-a2e5-4d77b301cfd4"
I0917 08:58:48.680340       1 deployer.go:538] get ServiceAccount clusternet-system/clusternet-app-deployer
I0917 08:58:48.693277       1 deployer.go:560] successfully get credentials populated for deployer
I0917 08:58:48.693698       1 agent.go:113] starting agent controller ...
I0917 08:58:48.693725       1 leaderelection.go:243] attempting to acquire leader lease clusternet-system/self-cluster...
I0917 08:58:48.693816       1 reflector.go:219] Starting reflector *v1.Node (12h0m0s) from pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167
I0917 08:58:48.693834       1 reflector.go:255] Listing and watching *v1.Node from pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167
I0917 08:58:48.693914       1 reflector.go:219] Starting reflector *v1.Pod (12h0m0s) from pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167
I0917 08:58:48.693923       1 reflector.go:255] Listing and watching *v1.Pod from pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167
I0917 08:58:48.700349       1 leaderelection.go:253] successfully acquired lease clusternet-system/self-cluster
I0917 08:58:48.700431       1 agent.go:167] start registering current cluster as a child cluster...
I0917 08:58:48.700468       1 agent.go:177] retrieving cluster id
I0917 08:58:48.703009       1 agent.go:182] current cluster id is "8aaf8de5-cf78-4358-978e-4221a629451e"
I0917 08:58:48.704601       1 agent.go:235] try to bootstrap cluster registration if needed
I0917 08:58:48.705174       1 agent.go:426] generate a random string "clusternet-cluster-b86bh" as cluster name for later use
I0917 08:58:48.721700       1 agent.go:256] successfully create ClusterRegistrationRequest "clusternet-8aaf8de5-cf78-4358-978e-4221a629451e"
I0917 08:58:48.725897       1 agent.go:313] the registration request for cluster "8aaf8de5-cf78-4358-978e-4221a629451e" ("clusternet-cluster-b86bh") is still waiting for approval...
I0917 08:58:54.294822       1 agent.go:307] the registration request for cluster "8aaf8de5-cf78-4358-978e-4221a629451e" gets approved
I0917 08:58:54.295085       1 agent.go:125] featuregate SocketConnection is enabled, preparing setting up socket connection...
I0917 08:58:54.295142       1 agent.go:333] store parent cluster credentials to secret for later use
I0917 08:58:54.295309       1 deployer.go:68] starting deployer ...
I0917 08:58:54.295354       1 socket_controller.go:98] setting up websocket connection to wss://172.30.43.20:6443/apis/proxies.clusternet.io/v1alpha1/sockets/8aaf8de5-cf78-4358-978e-4221a629451e
I0917 08:58:54.295488       1 status_manager.go:72] starting status manager to report heartbeats...
time="2021-09-17T08:58:54Z" level=info msg="Connecting to proxy" url="wss://172.30.43.20:6443/apis/proxies.clusternet.io/v1alpha1/sockets/8aaf8de5-cf78-4358-978e-4221a629451e"
I0917 08:58:54.295810       1 shared_informer.go:240] Waiting for caches to sync for cluster-status-controller
I0917 08:58:54.295829       1 shared_informer.go:270] caches populated
I0917 08:58:54.295835       1 shared_informer.go:247] Caches are synced for cluster-status-controller
I0917 08:58:54.295905       1 deployer.go:538] get ServiceAccount clusternet-system/clusternet-app-deployer
I0917 08:58:54.305121       1 deployer.go:560] successfully get credentials populated for deployer
I0917 08:58:54.305149       1 deployer.go:84] initializing deployer with sync mode Dual
I0917 09:03:51.720496       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 17 items received
I0917 09:05:21.701568       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 9 items received
I0917 09:12:05.703845       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 6 items received
I0917 09:12:14.722732       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 17 items received
I0917 09:19:51.706373       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 8 items received
I0917 09:21:11.724341       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 0 items received
I0917 09:29:35.709039       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 8 items received
I0917 09:30:44.726671       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 0 items received
I0917 09:39:21.710886       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 7 items received
I0917 09:39:29.728507       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 0 items received
I0917 09:44:56.712790       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 8 items received
I0917 09:45:01.730987       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 0 items received
I0917 09:53:41.714409       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 7 items received
I0917 09:54:19.732944       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 0 items received
I0917 10:00:16.716232       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 10 items received
I0917 10:03:36.734845       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Pod total 7 items received
I0917 10:05:31.717356       1 reflector.go:530] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Watch close - *v1.Node total 4 items received

from clusternet.

panpan0000 avatar panpan0000 commented on July 21, 2024

The desc obj as below . the generation did bump whenever I changed by kubectl clusternet edit xxx

# kubectl clusternet -n clusternet-b4tms get desc app-demo2-generic   -o yaml
apiVersion: apps.clusternet.io/v1alpha1
kind: Description
metadata:
  creationTimestamp: "2021-09-17T09:08:05Z"
  finalizers:
  - apps.clusternet.io/finalizer
  generation: 5
  labels:
    apps.clusternet.io/config.kind: Base
    apps.clusternet.io/config.name: app-demo2
    apps.clusternet.io/config.namespace: clusternet-b4tms
    apps.clusternet.io/config.uid: dee93cda-7470-48bf-950b-19c508f2be8a
    apps.clusternet.io/subs.name: app-demo2
    apps.clusternet.io/subs.namespace: default
    apps.clusternet.io/subs.uid: 36b3d10e-5d0f-4016-9a37-953b0b092a0f
    clusternet.io/created-by: clusternet-hub
    clusters.clusternet.io/cluster-id: 8aaf8de5-cf78-4358-978e-4221a629451e
    clusters.clusternet.io/cluster-name: clusternet-cluster-b86bh
  name: app-demo2-generic
  namespace: clusternet-b4tms
  ownerReferences:
  - apiVersion: v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: Base
    name: app-demo2
    uid: dee93cda-7470-48bf-950b-19c508f2be8a
  resourceVersion: "13055152"
  selfLink: /apis/apps.clusternet.io/v1alpha1/namespaces/clusternet-b4tms/descriptions/app-demo2-generic
  uid: 7bc2fd97-4751-46d2-814d-12012cbeeeff
spec:
  deployer: Generic
  raw:
.......

from clusternet.

GeorgeGuo2018 avatar GeorgeGuo2018 commented on July 21, 2024

for case2, it sounds like, if you adopt KubeFed, you can managle your clusters only via kubeFed.
I think the sutiation here might be a bit different, as the pic in this artice shows: users can exists in child cluster, so personally i think it is reasonable to make changes in child cluster directly.

from clusternet.

panpan0000 avatar panpan0000 commented on July 21, 2024

will split the question 2 to another issue: #132
This issue will only track the "edit" bug

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.