Skip to content

Commit

Permalink
Agent deployed with ArgoCD remains in endless sync loop (#4008)
Browse files Browse the repository at this point in the history
By reordering metrics argocd will no longer be stuck in endless loop.
Related issue in ArgoCD project argoproj/argo-cd#1079
  • Loading branch information
tiithansen authored and clayton-cornell committed Aug 14, 2023
1 parent 745dbca commit 6f15881
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions operations/helm/charts/grafana-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Unreleased
### Bugfixes

- Only set the deployment replicas when autoscaling is disabled. (@tiithansen)
- Reorder HPA `spec.metrics` to avoid endless sync loop in ArgoCD. (@tiithansen)

0.14.0 (2023-05-11)
-------------------
Expand Down
11 changes: 7 additions & 4 deletions operations/helm/charts/grafana-agent/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ spec:
minReplicas: {{ .minReplicas }}
maxReplicas: {{ .maxReplicas }}
metrics:
{{- with .targetCPUUtilizationPercentage }}
# Changing the order of the metrics will cause ArgoCD to go into a sync loop
# memory needs to be first.
# More info in: https://github.com/argoproj/argo-cd/issues/1079
{{- with .targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: cpu
name: memory
target:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- with .targetMemoryUtilizationPercentage }}
{{- with .targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: memory
name: cpu
target:
type: Utilization
averageUtilization: {{ . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
minReplicas: 1
maxReplicas: 5
metrics:
# Changing the order of the metrics will cause ArgoCD to go into a sync loop
# memory needs to be first.
# More info in: https://github.com/argoproj/argo-cd/issues/1079
- type: Resource
resource:
name: memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
minReplicas: 1
maxReplicas: 5
metrics:
# Changing the order of the metrics will cause ArgoCD to go into a sync loop
# memory needs to be first.
# More info in: https://github.com/argoproj/argo-cd/issues/1079
- type: Resource
resource:
name: memory
Expand Down

0 comments on commit 6f15881

Please sign in to comment.