kustomize-controller icon indicating copy to clipboard operation
kustomize-controller copied to clipboard

Question: sharding on kustomize controller only

Open masterphenix opened this issue 9 months ago • 4 comments

Hello, One of our k8s cluster has more than 300 namespaces ; we are using flux to manage content of this cluster, by means of:

  • 1 gitRepository source, that points to a unique repository, formatted like this:
<cluster_name>
  |_<namespace1>
  |_<namespace2>
    |_ kustomization and resources
  • 1 kustomization (kustomize.toolkit.fluxcd.io/v1) per namespace
  • a webhook to trigger reconcilation when a push is made on the git repo

Today, we are facing some delays when pushing changes to git, because the kustomize controller will trigger a reconcile on every kustomization (more than 300) ; as a result, for a small change on a single namespace, it can take more than 5 minutes to be applied on the cluster, depending on the order in which reconciliations are done.

We considered using the sharding capability of the kustomize controller, but it appears that, since flux kustomization are depending on the GitRepository source, the latter should also be sharded: this is an issue for us, since there is only 1 gitRepository for 300 kustomization.

Did we understand something wrong ? Would you by any chance have any recommendations to help us lower these delays ?

masterphenix avatar May 29 '24 14:05 masterphenix