-
Checklist:
Describe the bug I push the following manifest files into Git repository.
I created the Application to create the above manifest. This time the target of HPA was unknown.
But HPA can get target metrics if the app was disabled auto-sync of Argo CD. [How to work around] Set the following definition into Application definition. spec:
ignoreDifferences:
- group: apps
kind: Deployment
name: nginx
namespace: test-hpa
jsonPointers:
- /spec/replicas To Reproduce Create the Application by the following manifests. apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: test-hpa
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: nginx
namespace: test-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: nginx
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
targetAverageValue: 1 Expected behavior The replicas defined in Deployment manifest is ignored and the pod num is decided by HPA. Screenshots Version argocd: v1.6.2+3d1f37b
BuildDate: 2020-07-31T23:43:46Z
GitCommit: 3d1f37b0c53f4c75864dc7339e2831c6e6a947e0
GitTreeState: clean
GoVersion: go1.14.1
Compiler: gc
Platform: linux/amd64
argocd-server: v1.8.1+c2547dc
BuildDate: 2020-12-10T02:59:21Z
GitCommit: c2547dca95437fdbb4d1e984b0592e6b9110d37f
GitTreeState: clean
GoVersion: go1.14.12
Compiler: gc
Platform: linux/amd64
Ksonnet Version: v0.13.1
Kustomize Version: v3.8.1 2020-07-16T00:58:46Z
Helm Version: v3.4.1+gc4e7485
Kubectl Version: v1.17.8 Logs |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This behavior is expected. Your git desired state conflicts with a controller adjusting the replicas so it's expected that they will fight over the correct value. You should omit replicas from your deployment if you wish it to be controlled by HPA. See: https://argoproj.github.io/argo-cd/user-guide/best_practices/#leaving-room-for-imperativeness |
Beta Was this translation helpful? Give feedback.
This behavior is expected. Your git desired state conflicts with a controller adjusting the replicas so it's expected that they will fight over the correct value. You should omit replicas from your deployment if you wish it to be controlled by HPA. See:
https://argoproj.github.io/argo-cd/user-guide/best_practices/#leaving-room-for-imperativeness