-
Notifications
You must be signed in to change notification settings - Fork 621
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
Deployment replicas is overwritten #1842
Comments
According to fluxcd/flux#1686 (comment) not specifying the replicas in the manifest should prevent Flux from overwriting the field and I wonder how it would overwrite it in this case because Flux basically doesn't have a value to overwrite the replicas field with. 🤔 |
I will try to reproduce this issue to make sure Flux overwrites the field and come back here later. |
This behavior is documented in the FAQ, you need to remove the replicas field from your Deployment YAML and Flux will no longer override the value set by HPA. |
I tried removing the replica count from a deployment again but pods were still deleted and created again. I did another reconciliation right after and no pods were deleted that time. I am not sure why the pods were deleted the first time but it seems more like a thing with Kubernetes and not one with flux. Sorry for the confusion. |
Describe the bug
The replicas for a deployment is overwritten when flux reconciles when using a pod autoscaler. The pods are terminated and then created again right after.
Steps to reproduce
Expected behavior
I would expect the deployment replicas to not be overwritten.
Screenshots and recordings
No response
OS / Distro
N/A
Flux version
N/A
Flux check
► checking prerequisites
✗ flux 0.17.0 <0.17.1 (new version is available, please upgrade)
✔ kubectl 1.22.1 >=1.18.0-0
✔ Kubernetes 1.21.4+k3s1 >=1.16.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.11.2
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.14.1
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.11.1
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.14.1
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.16.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.15.4
✔ all checks passed
Git provider
No response
Container Registry provider
No response
Additional context
I have also tried not specifying replicas on the deployment and only have them in the horizontal pod autoscaler, but the replicas still changed.
Code of Conduct
The text was updated successfully, but these errors were encountered: