clusterpedia
clusterpedia copied to clipboard
feat: support excluded sync resources
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
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.
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:
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
@Iceber PTAL, thanks!