Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Make Kubernetes resources exclusion configurable #2749

Merged
merged 4 commits into from
Jan 16, 2020
Merged

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Jan 15, 2020

This PR adds the --k8s-exclude-resource to fluxd command args to make the Kubernetes resources exclusion configurable.

By default the *metrics.k8s.io/*, webhook.certmanager.k8s.io/* and v1/Event resources are excluded.

Also objects with owner references are excluded from Flux discovery to avoid conflicts between Flux GC and Kubernetes GC.

Fix: #2554
Fix: #2642

@stefanprodan stefanprodan changed the title Add certmanager's webhook to excluded groups list Make Kubernetes groups exclusion configurable Jan 15, 2020
@stefanprodan stefanprodan changed the title Make Kubernetes groups exclusion configurable Make Kubernetes resources exclusion configurable Jan 15, 2020
cmd/fluxd/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@2opremio 2opremio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment about the flag description, otherwise LGTM

@stefanprodan
Copy link
Member Author

@2opremio please take a look again, the filtering happens at group level first (to avoid API calls errors when fetching the resources) and a 2nd time for the Kind matching. Also if you have a better description for the flag please write it here.

PS. I've also excluded the Event kind as the events could fill Flux memory.

@2opremio
Copy link
Contributor

please take a look again, the filtering happens at group level first (to avoid API calls errors when fetching the resources) and a 2nd time for the Kind matching. Also if you have a better description for the flag please write it here.

Ah, sorry, I had missed that (I was checking the PR on the phone)

@2opremio
Copy link
Contributor

How about

do not attempt to obtain cluster resources whose group/version/kind matches these glob expressions, e.g. coordination.k8s.io/v1beta1/Lease, coordination.k8s.io/*/Lease or coordination.k8s.io/*

@stefanprodan stefanprodan merged commit 092caf9 into master Jan 16, 2020
@stefanprodan stefanprodan deleted the exclude-webhook branch January 16, 2020 08:55
@stefanprodan stefanprodan added this to the 1.18.0 milestone Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants