Closed Maximebb closed 2 years ago
This was fixed many months ago, kustomize-controller is now at v0.26. See here how to update https://github.com/fluxcd/flux2/discussions/1916
Oh, are you telling me that going ahead with our plan to upgrade flux would've fixed it? :D
Thanks for the fast response!
In v1beta2 I've rewritten the garbage collector especially for issues like this, some controllers decided to copy the kustomize.toolkit.fluxcd.io/checksum
to their own resources, thus making Flux think that they were in the repo at some point. in v1beta2 Flux no longer looks for annotations, instead it keeps it's own inventory of what things it manages and does a GC run only for those.
Describe the bug
We use flux (v2) to deploy applications that are bundled with operator managed resources. Specifically, we use the ECK operator to deploy elastic search clusters as well as RMQ cluster operator for rabbitmq clusters.
These two require custom resources refered to by our kustomization file which is synced by flux. Visually, The repo
flux.yaml
kustomization.yaml
rabbitmqcluster.yaml
elasticcluster.yaml
Both the
rqm-worker
andelastic-server
produces more resources by the associated operator. In particular, each will generate a secret with default credentials our application code uses. As such, after reconciliation, there will be armq-worker-default-user
and aelastic-server-es-elastic-user
secret, both containing credentials.Now, we're observing flux behaving differently with either resource. With RabbitMQ, it will garbage collect the secret once in a while (we haven't figured the trigger yet), but will never touch the Elastic Search one. In fact, we observed that the RabbitMQ secret has flux annotation and labels, while the ES one doesn't.
The trace that shows flux garbage collecting this secret:
Our work around was to disable pruning on the kustomization, which is less than ideal. We're thinking there might be a difference in how the operator creates the resources, which may cause issues with flux pruning. Any clue as to why this is happening?
tagging @pattersongp
Steps to reproduce
Expected behavior
Flux would not garbage collect the secret generated by the operator of the RabbitMQCluster resource.
Kubernetes version / Distro / Cloud provider
1.21 and 1.22 (tested on both)
Flux version
image: ghcr.io/fluxcd/kustomize-controller:v0.13.3
Git provider
Gitlab
Container Registry provider
Gitlab
Additional context
No response
Maintenance Acknowledgement
Code of Conduct