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

Pediacluster support filter roles when sync resources #272

Open
wuyingjun-lucky opened this issue Jul 19, 2022 · 10 comments
Open

Pediacluster support filter roles when sync resources #272

wuyingjun-lucky opened this issue Jul 19, 2022 · 10 comments
Assignees
Labels
kind/feature New feature

Comments

@wuyingjun-lucky
Copy link
Member

wuyingjun-lucky commented Jul 19, 2022

What would you like to be added?

We want pediacluster support filter rules when sync resources

Why is this needed?

We want skip some namepace when resource syncd like kube-system

@wuyingjun-lucky wuyingjun-lucky added the kind/feature New feature label Jul 19, 2022
@Iceber
Copy link
Member

Iceber commented Jul 19, 2022

Is this done to avoid sensitive resources being synced to the clusterpedia, or is there another purpose?

@wuyingjun-lucky
Copy link
Member Author

wuyingjun-lucky commented Jul 19, 2022

Is this done to avoid sensitive resources being synced to the clusterpedia, or is there another purpose?

We have three clusters now and the workload name is different and namespace is same.
And the k8s or other control plane system and the resources on that namespace are same, we just want keep one copy and actually do not care about them. we just care about our workload
So we want add an optional api in pediacluster and that we can have a choice to avoid some resources being synced

@Iceber
Copy link
Member

Iceber commented Jul 20, 2022

I have a few questions:

  1. even if the resources in these control system namespaces are the same in multiple clusters, their status may still be different for various reasons, and if we don't synchronize them, then we will never be able to see the specific information of the resources in these namespaces within a specific cluster through the clusterpedia

  2. Is it possible to ignore some namespaces when retrieving resources, for example by using the search label -search.clusterpedia.io/namespaces notin (a,b,c) or url query - ?ignoreNamespaces=a,b,c?

it is also possible to use raw query

Of course I don't have a proper reason to oppose this feature, but it might make users confused about not retrieving resources in certain namespaces.

@wuyingjun-lucky
Copy link
Member Author

wuyingjun-lucky commented Jul 20, 2022

  1. multiple

Two reasons
1 · Our app developer、 k8s developer and k8s SRE are different parts. Our team may just care about the resources we directly use. The SRE do not use clusterpedia to monitor the k8s clusters
2. we found when we use old version client-go to list and then watch (informers) the collection resources will hang up because duplicate resources

@Iceber
Copy link
Member

Iceber commented Jul 20, 2022

I think we can implement this in 0.5.

To implement this we add a field in PediaCluster - ignoredNamespaces: [].

apiVersion: cluster.clusterpedia.io/v1alpha1
kind: PediaClusteer
metadata:
  name: example
spec:
  syncResources:
  - group: ""
     resources:
     - "pods"
  ignoredNamespaces:
  - "kube-system"

Global settings, not specific to a resource, What do you think?

@wuyingjun-lucky
Copy link
Member Author

I think we can implement this in 0.5.

To implement this we add a field in PediaCluster - ignoredNamespaces: [].

apiVersion: cluster.clusterpedia.io/v1alpha1
kind: PediaClusteer
metadata:
  name: example
spec:
  syncResources:
  - group: ""
     resources:
     - "pods"
  ignoredNamespaces:
  - "kube-system"

Global settings, not specific to a resource, What do you think?

Yeah, we can make it optional

@duanmengkk
Copy link
Member

/assign

@cleverhu
Copy link

I have a question, what should we handle if the resource is cluster resource?

@cleverhu
Copy link

I have a question, what should we handle if the resource is cluster resource?

Sometimes we may have turned on collecting all Crd resources, which may contain cluster resources.

@wuyingjun-lucky
Copy link
Member Author

Maybe we can pending the issue if we do not find the best scheme

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

No branches or pull requests

4 participants