Closed monabhardwaj closed 2 years ago
Creating a replicaset is not something that Flux itself does. Flux creates the Deployment and Kubernetes creates the replicaset to match its spec. When the spec changes, another replicaset gets created. It is surprising that two worker threads would start the same job at the same time without coordinating that between each other, (but I don't know the code well enough to say for sure that it does not happen like this...)
Unfortunately as you might have noticed, Flux v1 and Helm Operator are both approaching EOL, and all of the development is happening on Flux v2. This issue is not likely to be fixed in Flux v1, unless there is a patch which does not introduce any backwards incompatibility that is possible. Moreover, I am extremely constrained in the amount of effort that I can put into new development of features or bugfixes on Flux v1. We are supporting migrations away from Flux v1, and security patches if they are critical updates, but there is little help that I can offer with regard to fixing this issue if it is able to be confirmed.
The Migration Timetable that was published in the Flux docs marked Flux v1 and Helm Operator as superseded, in June 2021.
I cannot dig into the code right now to try to figure this issue out, but if you have a code fix or suggestion as to where the problem is, I can look into it further, and we could potentially merge a fix and release it if the fix can honor those constraints.
My primary suggestion though, is to begin migrating to Flux v2, where I suspect this issue will not be present anymore.
I'm going to go ahead and close this as no progress is being made. If you have a suggestion for PR to fix, or other workaround that doesn't introduce any incompatibility, we can reopen and consider it for inclusion in the docs, or merge!
Thanks for reporting and sorry for the trouble.
Describe the bug
I need some assistance. We are using the Gitops model (flux/helm) for auto deployment. We are observing an issue where 2 replica sets are getting created for a deployment at the same time. This is happening for the first deployment itself. This can cause potential inconsistencies.
Flux provides an option for configuring the worker count. On setting the worker count to 1, the above issue is not observed, which means that there is an inconsistency or race condition with the helm worker threads.
However, we cannot set the worker count to 1 for our production scenario since that will significantly slow down the setup. Has anyone faced this issue? Do you have any suggestions for a workaround?
Providing some details for clarity :
kubectl get rs -n test
kubectl get deploy -n test
Snippet from the describe deployment output -
Snippet of the events log where we can see 2 replica sets getting created and scaled up at the same time. Shortly after, one of the replica sets gets scaled down to 0
kubectl get events -n test
This is only the first deployment for the service, however I can see the deployment revision as 2
kubectl describe deploy mytest-service -n test
I would greatly appreciate any help here!
Steps to reproduce
Install multiple applications with flux/helm
Expected behavior
During first deployment, one replica set should be created for an application
Kubernetes version / Distro / Cloud provider
K3S v1.21.1+k3s1
Flux version
flux v1.24.3 / Helm Chart 1.4.2 / fluxctl 1.24.3
Git provider
No response
Container Registry provider
No response
Additional context
No response
Maintenance Acknowledgement
Code of Conduct