Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncer not pushing resource to physical cluster #67

Closed
davidffrench opened this issue May 10, 2021 · 6 comments
Closed

Syncer not pushing resource to physical cluster #67

davidffrench opened this issue May 10, 2021 · 6 comments

Comments

@davidffrench
Copy link
Contributor

davidffrench commented May 10, 2021

I have the kcp server, cluster controller and syncer all running separately locally with a cluster resource created with the kubeconfig of a physical cluster.

Cluster controller command

go run ./cmd/cluster-controller --kubeconfig=.kcp/data/admin.kubeconfig --pull_model=false mycustomresource

Syncer command

go run ./cmd/syncer/ --cluster=local --from_kubeconfig=.kcp/data/admin.kubeconfig --from_context=admin --to_kubeconfig=pathtomykubeconfig mycustomresource

The mycustomresource CRD from my physical cluster is pulled successfully with Davids new branch. However, when I create an instance of mycustomresource in kcp, this is not synced downstream to the physical cluster.

I0510 19:20:45.173659   32948 main.go:117] Set up informer for managedkafka.bf2.org/v1alpha1, Resource=managedkafkas
I0510 19:20:45.173881   32948 main.go:126] Starting workers```

There are no logs to indicate any reconciliation in the syncer.
@davidffrench
Copy link
Contributor Author

This is not working for deployments for me either. I could be doing something wrong with the setup. The informer looks to be setup correctly.

Syncer Logs

I0510 23:19:14.912097   36113 main.go:117] Set up informer for apps/v1, Resource=deployments
I0510 23:19:15.702204   36113 main.go:126] Starting workers

kcp logs

DEBUG: key=/registry/apps/deployments/admin willExtractCluster=false

I have added a breakpoint to https://github.com/kcp-dev/kcp/blob/main/pkg/syncer/syncer.go#L34 and it is never called when adding a new deployment resource

@davidfestal
Copy link
Member

Just a dummy question: did you add the cluster label to your deployment, with the name of your physical cluster ?

@davidfestal
Copy link
Member

I just tested locally and it works on my side with deployments

@davidffrench
Copy link
Contributor Author

@davidfestal Yes, I have the label added to my resource.

$ kubectl get clusters
NAME    AGE
local   16h
metadata:
  ...
  labels:
    kcp.dev/cluster: local
spec:

@davidfestal
Copy link
Member

Oh, it seems the label name in the implementation is simply cluster, which should probably be changed to something like you added.

@davidffrench
Copy link
Contributor Author

Agreed @davidfestal . It is listed in the docs here as kcp.dev/cluster https://github.com/kcp-dev/kcp/tree/main/contrib/demo#object-syncer

Issue created - #70 and closing this issue. Thanks for the help David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants