clusterpedia icon indicating copy to clipboard operation
clusterpedia copied to clipboard

feat: support excluded sync resources

Open KubeKyrie opened this issue 1 year ago • 3 comments

What type of PR is this? /kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes: Fixes #611

Special notes for your reviewer: Add excludeResources for syncResources of pediacluster and clustersyncresources. And excludeResources is optional. New yaml just like:

syncResources:
  - excludeResources:
    - deployments
    - daemonsets
    group: apps
    resources:
    - '*'

Does this PR introduce a user-facing change?:

Support specifying unsynchronized resources by excludeResources

KubeKyrie avatar Dec 14 '23 08:12 KubeKyrie

Hi @KubeKyrie, Thanks for your pull request! If the PR is ready, use the /auto-cc command to assign Reviewer to Review. We will review it shortly.

Details

Instructions for interacting with me using comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.

clusterpedia-bot avatar Dec 14 '23 08:12 clusterpedia-bot

case 1

suppose that pediacluster syncResources configured like this:

[root@qin-dev ~]# kubectl get pediacluster cluster-1  -ojsonpath="{.spec.syncResources}"
[{"excludeResources":["deployments","daemonsets"],"group":"apps","resources":["*"]}]

[root@qin-dev ~]# kubectl get pediacluster cluster-1  -ojsonpath="{.spec.syncAllCustomResources}"
true

test results:

image

case 2

[root@qin-dev ~]# kubectl get pediacluster cluster-1  -ojsonpath="{.spec.syncResources}"
[{"excludeResources":["deployments","daemonsets"],"group":"*","resources":["*"]}]

test results:

sqlite> select distinct kind from resources;
Prometheus
IPAMBlock
HelmRelease
FelixConfiguration
HelmOperation
BGPConfiguration
KubeControllersConfiguration
HelmRepo
IPPool
ClusterInformation
PrometheusRule
Instrumentation
ReplicaSet
StatefulSet
BlockAffinity
IPAMHandle
IPAMConfig
ServiceMonitor
ControllerRevision
Job
Role
PriorityClass
CSINode
Event
Namespace
PriorityLevelConfiguration
Endpoints
Service
FlowSchema
EndpointSlice
RoleBinding
Lease
ServiceAccount
Node
MutatingWebhookConfiguration
ValidatingWebhookConfiguration
APIService
ClusterRole
ClusterRoleBinding
Pod
ConfigMap
CustomResourceDefinition

KubeKyrie avatar Jan 02 '24 15:01 KubeKyrie

@Iceber PTAL, thanks!

KubeKyrie avatar Jan 02 '24 15:01 KubeKyrie