Coder Social home page Coder Social logo

Comments (4)

y-taka-23 avatar y-taka-23 commented on May 18, 2024 2

I ran into the same phenomenon.

Surely it is because the current implementation of the deployment-splitter controller detects the diff in and update the Status only. (pkg/reconciler/deployment/controller.go)

if !equality.Semantic.DeepEqual(previous.Status, current.Status) {
	_, uerr := c.client.Deployments(current.Namespace).UpdateStatus(ctx, current, metav1.UpdateOptions{})
	return uerr
}

On the other hand, in the case of a single downstream cluster, its reconciliation loop only adds a label cluater: your-cluster-name (pkg/reconciler/deployment/deployment.go)

if len(cls) == 1 {
	// nothing to split, just label Deployment for the only cluster.
	if root.Labels == nil {
		root.Labels = map[string]string{}
	}

	// TODO: munge cluster name
	root.Labels[clusterLabel] = cls[0].Name
	return nil
}

As a result, the deployment is not labelled and thus the corresponding syncer cannot detect the creation.

from kcp.

gyliu513 avatar gyliu513 commented on May 18, 2024

Why did the clustername in the deployment is always admin?

Guangyas-MacBook-Pro:kcp guangyaliu$ kubectl get deploy -oyaml
apiVersion: v1
items:
- apiVersion: apps/v1
  kind: Deployment
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"name":"example","namespace":"default"},"spec":{"replicas":3,"selector":{"matchLabels":{"app":"nginx"}},"template":{"metadata":{"labels":{"app":"nginx"}},"spec":{"containers":[{"command":["/bin/sh","-ec","echo \"Going to sleep\"\ntail -f /dev/null \n"],"image":"busybox:1.25","name":"busybox"}]}}}}
    clusterName: admin
    ...

from kcp.

gyliu513 avatar gyliu513 commented on May 18, 2024

Even if I change the cluster name to admin, the deployment still cannot sync to downstream cluster.

Guangyas-MacBook-Pro:kcp guangyaliu$ kubectl get cluster
NAME    AGE
admin   86s

from kcp.

gyliu513 avatar gyliu513 commented on May 18, 2024

@y-taka-23 As a simple fix, how about just remove the checking of if len(cls) == 1,

from kcp.

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.