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

feat: support excluded sync resources #617

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KubeKyrie
Copy link
Contributor

@KubeKyrie KubeKyrie commented Dec 14, 2023

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

@clusterpedia-bot
Copy link

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 clusterpedia-bot added the kind/feature New feature label Dec 14, 2023
@KubeKyrie KubeKyrie marked this pull request as draft December 14, 2023 08:56
@KubeKyrie KubeKyrie force-pushed the feat-excluded-sync-resources branch 5 times, most recently from b83f1d1 to cf36967 Compare December 14, 2023 10:10
@KubeKyrie KubeKyrie marked this pull request as ready for review December 14, 2023 10:31
@pull-request-size pull-request-size bot added size/S and removed size/L labels Dec 28, 2023
@KubeKyrie KubeKyrie force-pushed the feat-excluded-sync-resources branch 2 times, most recently from 313a7a4 to cdef1d8 Compare December 29, 2023 08:45
Signed-off-by: KubeKyrie <shaolong.qin@daocloud.io>
@KubeKyrie
Copy link
Contributor Author

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
Copy link
Contributor Author

@Iceber PTAL, thanks!

@Iceber Iceber self-requested a review January 30, 2024 05:55
@Iceber Iceber self-assigned this Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[resource sync] support exclude resources
3 participants