Skip to content

Commit c96cd83

Browse files
fix: argocd defaults (#1663)
Co-authored-by: jeho <[email protected]>
1 parent abb6c81 commit c96cd83

File tree

5 files changed

+166
-86
lines changed

5 files changed

+166
-86
lines changed

helmfile.d/snippets/defaults.yaml

+64-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,71 @@ environments:
99
enabled: false
1010
argocd:
1111
enabled: true
12+
applicationSet:
13+
replicas: 1
14+
controller:
15+
replicas: 1
1216
autoscaling:
13-
enabled: true
14-
minReplicas: 1
15-
maxReplicas: 5
16-
targetCPUUtilizationPercentage: 70
17+
repoServer:
18+
enabled: true
19+
minReplicas: 1
20+
maxReplicas: 5
21+
targetMemoryUtilizationPercentage: 70
22+
server:
23+
enabled: true
24+
minReplicas: 1
25+
maxReplicas: 5
26+
targetCPUUtilizationPercentage: 70
27+
resources:
28+
controller:
29+
requests:
30+
cpu: 500m
31+
memory: 1Gi
32+
limits:
33+
cpu: 2
34+
memory: 2Gi
35+
server:
36+
requests:
37+
cpu: 50m
38+
memory: 256M
39+
limits:
40+
cpu: 1
41+
memory: 1Gi
42+
repo:
43+
requests:
44+
cpu: 100m
45+
memory: 512M
46+
limits:
47+
cpu: 1
48+
memory: 1Gi
49+
redis:
50+
requests:
51+
cpu: 50m
52+
memory: 64Mi
53+
limits:
54+
cpu: 1
55+
memory: 1Gi
56+
applicationSet:
57+
requests:
58+
cpu: 100m
59+
memory: 256M
60+
limits:
61+
cpu: 1
62+
memory: 1Gi
63+
notifications:
64+
requests:
65+
cpu: 100m
66+
memory: 64M
67+
limits:
68+
cpu: 1
69+
memory: 1Gi
70+
imageUpdater:
71+
requests:
72+
memory: 50Mi
73+
cpu: 50m
74+
limits:
75+
memory: 1Gi
76+
cpu: 1
1777
cert-manager:
1878
issuer: custom-ca
1979
resources:

tests/fixtures/env/apps/argocd.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
11
apps:
22
argocd:
33
enabled: true
4+
autoscaling:
5+
repoServer:
6+
enabled: true
7+
minReplicas: 1
8+
maxReplicas: 5
9+
targetMemoryUtilizationPercentage: 70
10+
server:
11+
enabled: true
12+
minReplicas: 1
13+
maxReplicas: 5
14+
targetMemoryUtilizationPercentage: 70
15+
resources:
16+
controller:
17+
requests:
18+
cpu: 500m
19+
memory: 1Gi
20+
limits:
21+
cpu: '2'
22+
memory: 2Gi
23+
server:
24+
limits:
25+
cpu: '1'
26+
memory: 1Gi
27+
requests:
28+
cpu: 50m
29+
memory: 256M
30+
repo:
31+
limits:
32+
cpu: '1'
33+
memory: 1Gi
34+
requests:
35+
cpu: 100m
36+
memory: 512M
37+
redis:
38+
requests:
39+
cpu: 50m
40+
memory: 64Mi
41+
limits:
42+
cpu: '1'
43+
memory: 1Gi
44+
applicationSet:
45+
limits:
46+
cpu: '1'
47+
memory: 1Gi
48+
requests:
49+
cpu: 100m
50+
memory: 256M
51+
notifications:
52+
limits:
53+
cpu: '1'
54+
memory: 1Gi
55+
requests:
56+
cpu: 100m
57+
memory: 64M
58+
imageUpdater:
59+
limits:
60+
memory: 1Gi
61+
cpu: '1'
62+
requests:
63+
memory: 50Mi
64+
cpu: 50m

values-schema.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,19 @@ properties:
14851485
enabled:
14861486
type: boolean
14871487
default: true
1488+
applicationSet:
1489+
replicas:
1490+
default: 1
1491+
type: integer
1492+
controller:
1493+
replicas:
1494+
default: 1
1495+
type: integer
14881496
autoscaling:
1489-
$ref: '#/definitions/autoscalingEnabled'
1497+
repoServer:
1498+
$ref: '#/definitions/autoscalingEnabled'
1499+
server:
1500+
$ref: '#/definitions/autoscalingEnabled'
14901501
resources:
14911502
additionalProperties: false
14921503
properties:
@@ -1498,6 +1509,12 @@ properties:
14981509
$ref: '#/definitions/resources'
14991510
redis:
15001511
$ref: '#/definitions/resources'
1512+
applicationSet:
1513+
$ref: '#/definitions/resources'
1514+
notifications:
1515+
$ref: '#/definitions/resources'
1516+
imageUpdater:
1517+
$ref: '#/definitions/resources'
15011518
cert-manager:
15021519
additionalProperties: false
15031520
properties:

values/argocd/argocd-raw.gotmpl

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- $v := .Values }}
2+
{{- $a := $v.apps.argocd }}
23
resources:
34
{{- if $v._derived.untrustedCA }}
45
- apiVersion: v1
@@ -189,13 +190,7 @@ resources:
189190
port: 8080
190191
initialDelaySeconds: 3
191192
periodSeconds: 30
192-
resources:
193-
limits:
194-
memory: 500Mi
195-
cpu: 500m
196-
requests:
197-
memory: 50Mi
198-
cpu: 50m
193+
resources: {{- $a.resources.imageUpdater | toYaml | nindent 14 }}
199194
volumeMounts:
200195
- mountPath: /app/config
201196
name: image-updater-conf

values/argocd/argocd.gotmpl

+21-74
Original file line numberDiff line numberDiff line change
@@ -9,95 +9,42 @@ global:
99
{{ $key }}: {{ $val }}
1010
{{- end }}
1111
{{- end }}
12+
# ApplicationSet Controller
1213
applicationSet:
13-
autoscaling:
14-
enabled: true
15-
resources:
16-
limits:
17-
cpu: '500m'
18-
memory: 1Gi
19-
requests:
20-
cpu: 100m
21-
memory: 256M
14+
replicas: {{ $a.applicationSet.replicas }}
15+
resources: {{- $a.resources.applicationSet | toYaml | nindent 4 }}
2216

17+
# Application Controller
2318
controller:
24-
autoscaling:
25-
enabled: {{ $a.autoscaling.enabled }}
26-
maxReplicas: {{ $a.autoscaling.maxReplicas }}
27-
minReplicas: {{ $a.autoscaling.minReplicas }}
28-
targetCPUUtilizationPercentage: {{ $a.autoscaling.targetCPUUtilizationPercentage }}
19+
replicas: {{ $a.controller.replicas }}
20+
resources: {{- $a.resources.controller | toYaml | nindent 4 }}
2921

30-
resources:
31-
{{- with $a | get "resources.controller" nil }}
32-
{{- toYaml .| nindent 4 }}
33-
{{- else }}
34-
limits:
35-
cpu: 1
36-
memory: 2Gi
37-
requests:
38-
cpu: 100m
39-
memory: 1Gi
40-
{{- end }}
4122
dex:
4223
enabled: false
24+
4325
notifications:
44-
# -- Enable notifications controller
4526
enabled: true
46-
resources:
47-
limits:
48-
cpu: 1
49-
memory: 1Gi
50-
requests:
51-
cpu: 100m
52-
memory: 256M
27+
resources: {{- $a.resources.notifications | toYaml | nindent 4 }}
28+
5329
redis:
54-
resources:
55-
{{- with $a | get "resources.redis" nil }}
56-
{{- toYaml .| nindent 4 }}
57-
{{- else }}
58-
limits:
59-
cpu: 1
60-
memory: 1Gi
61-
requests:
62-
cpu: 100m
63-
memory: 256M
64-
{{- end }}
30+
resources: {{- $a.resources.redis | toYaml | nindent 4 }}
31+
6532
repoServer:
6633
autoscaling:
67-
enabled: {{ $a.autoscaling.enabled }}
68-
maxReplicas: {{ $a.autoscaling.maxReplicas }}
69-
minReplicas: {{ $a.autoscaling.minReplicas }}
70-
targetCPUUtilizationPercentage: {{ $a.autoscaling.targetCPUUtilizationPercentage }}
34+
enabled: {{ $a.autoscaling.repoServer.enabled }}
35+
maxReplicas: {{ $a.autoscaling.repoServer.maxReplicas }}
36+
minReplicas: {{ $a.autoscaling.repoServer.minReplicas }}
37+
targetMemoryUtilizationPercentage: {{ $a.autoscaling.repoServer.targetMemoryUtilizationPercentage }}
38+
resources: {{- $a.resources.repo | toYaml | nindent 4 }}
7139

72-
resources:
73-
{{- with $a | get "resources.repo" nil }}
74-
{{- toYaml .| nindent 4 }}
75-
{{- else }}
76-
limits:
77-
cpu: 1
78-
memory: 1Gi
79-
requests:
80-
cpu: 100m
81-
memory: 256M
82-
{{- end }}
8340
server:
8441
autoscaling:
85-
enabled: {{ $a.autoscaling.enabled }}
86-
maxReplicas: {{ $a.autoscaling.maxReplicas }}
87-
minReplicas: {{ $a.autoscaling.minReplicas }}
88-
targetCPUUtilizationPercentage: {{ $a.autoscaling.targetCPUUtilizationPercentage }}
42+
enabled: {{ $a.autoscaling.server.enabled }}
43+
maxReplicas: {{ $a.autoscaling.server.maxReplicas }}
44+
minReplicas: {{ $a.autoscaling.server.minReplicas }}
45+
targetMemoryUtilizationPercentage: {{ $a.autoscaling.server.targetMemoryUtilizationPercentage }}
46+
resources: {{- $a.resources.server | toYaml | nindent 4 }}
8947

90-
resources:
91-
{{- with $a | get "resources.server" nil }}
92-
{{- toYaml .| nindent 4 }}
93-
{{- else }}
94-
limits:
95-
cpu: 1
96-
memory: 1Gi
97-
requests:
98-
cpu: 100m
99-
memory: 256M
100-
{{- end }}
10148
configs:
10249
# General Argo CD configuration
10350
## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/argocd-cm.yaml

0 commit comments

Comments
 (0)