loft-sh / vcluster-sdk

Provides a toolset to create custom vcluster syncers
Apache License 2.0
25 stars 20 forks source link

Sync from namespaces other than vcluster's #80

Closed Symbianx closed 7 months ago

Symbianx commented 7 months ago

Hello 👋

I started looking at implementing a plugin to sync Ingress resources from the host cluster into the vcluster. Our goal is to configure with an env variable which namespaces should have their ingresses synced into the vcluster.

So I took a look at the import-secrets example and implemented something similar for Ingress resources. I now noticed that the IsManaged method only gets called for Ingresses created in the namespace where vcluster is running while I expect all the ingresses to trigger it.

Is there a configuration I'm missing?

Thank you!

facchettos commented 7 months ago

No, the vcluster doesn't have the permission to list objects outside of its namespace by default, and with some options we can have some extended permissions, but not listing ingresses in other namespaces. We would recommend writing a custom controller for this, which would be independent from the vcluster itself