ArgoCD set replicas of old replicaSet to 1 during deployment of new version #25518
-
|
We are working on moving to using ArgoCD for our deployments, previously we were using Helm. We use KEDA to autoscale our services, so we do not define a The upgrade involved a new image version, so there a rolling update was triggered. When this happened ArgoCD set the replicaCount of the old replicaSet to 1. There is a kubernetes event log that says The diff for the deployment only showed adding the ArgoCD annotations and changing the versions. Does anyone have ideas as to what could have caused this? I thought it might have been that since our Deployment manifest doesn't supply a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
When ArgoCD syncs a Deployment without a Fix: Configure ArgoCD to ignore the replicas field: spec:
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas
syncPolicy:
syncOptions:
- RespectIgnoreDifferences=trueThis prevents ArgoCD from managing replica counts, allowing KEDA to maintain full control during deployments. |
Beta Was this translation helpful? Give feedback.
-
|
When your Deployment manifest omits spec:
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas
syncPolicy:
syncOptions:
- RespectIgnoreDifferences=trueThe |
Beta Was this translation helpful? Give feedback.
-
|
Updating in case others come across this. The issue was related to what @anntnzrb said above. There is an added wrinkle though. In the past we had gone from using I have verified that setting |
Beta Was this translation helpful? Give feedback.
When your Deployment manifest omits
replicas, Kubernetes defaults to 1 during sync, overriding KEDA's scaled count. Configure ArgoCD to ignore the replicas field:The
RespectIgnoreDifferences=trueis critical - it applies the ignore rule during sync, not just diff calculation. This lets KEDA maintain control over replicas during rolling updates.