Skip to content

Commit ff684c0

Browse files
authored
feat(argus,csc): accept agent.conf customizations for collector (#78)
1 parent 524129a commit ff684c0

File tree

8 files changed

+149
-5
lines changed

8 files changed

+149
-5
lines changed

charts/argus/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ maintainers:
1111
1212
name: LogicMonitor
1313
name: argus
14-
version: 2.2.0-rc04
14+
version: 2.2.0-rc05
1515
home: https://logicmonitor.github.io/helm-charts-qa
1616
appVersion: v8.2.0-rc1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
3+
{{- define "trimmed-collector-config-agentConf" -}}
4+
{{- $trimmedCollectorProps := list "jdbc" "perfmon" "wmi" "netapp" "esx" "xen" "mongo" "wineventlog" "snmptrap" "syslog"}}
5+
{{- $propList := list }}
6+
{{- range $val := $trimmedCollectorProps }}
7+
{{- $kv := dict}}
8+
{{- $_ := set $kv "key" (printf "collector.%s.enable" $val) }}
9+
{{- $_1 := set $kv "value" "false" }}
10+
{{- $propList = append $propList $kv }}
11+
trimmedCollectorAgentConf:
12+
{{- toYaml $propList | nindent 2 }}
13+
{{- end }}
14+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "argus.fullname" . }}-collector
5+
namespace: {{ template "argus.namespace" . }}
6+
labels:
7+
{{- include "argus.labels" . | nindent 4 }}
8+
annotations:
9+
helm-chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
10+
helm-revision: "{{ .Release.Revision }}"
11+
## keep value false as string, spinnaker's limitation, otherwise spinnaker fails to cast boolean to string
12+
strategy.spinnaker.io/versioned: "false"
13+
{{- include "argus.annotations" . | nindent 4 }}
14+
data:
15+
collector-conf.yaml: |
16+
agentConf:
17+
{{- if not .Values.collector.disableLightweightCollector }}
18+
{{- $abc := include "trimmed-collector-config-agentConf" . | fromYaml }}
19+
{{- get $abc "trimmedCollectorAgentConf" | toYaml | nindent 6 }}
20+
{{- end }}
21+
{{- toYaml .Values.collector.collectorConf.agentConf | nindent 6 }}

charts/argus/templates/collectorset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ spec:
5353
{{ toYaml .Values.collector.statefulsetSpec | nindent 4 }}
5454
{{- end }}
5555
probe: {{ toYaml .Values.collector.probe | nindent 4 }}
56+
collectorConfigMapName: {{ include "argus.fullname" . }}-collector

charts/argus/values.schema.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,25 @@
19161916
}
19171917
},
19181918
"additionalProperties": false
1919+
},
1920+
"disableLightweightCollector": {
1921+
"$id": "#/properties/collector/properties/enableLightweightCollector",
1922+
"type": "boolean",
1923+
"default": false
1924+
},
1925+
"collectorConf": {
1926+
"$id": "#/properties/collector/properties/collectorConf",
1927+
"type": "object",
1928+
"properties": {
1929+
"agentConf": {
1930+
"type": "array",
1931+
"items": {
1932+
"$ref": "#/definitions/collectorConfKeyVal"
1933+
},
1934+
"uniqueItems": true
1935+
}
1936+
},
1937+
"additionalProperties": false
19191938
}
19201939
},
19211940
"additionalProperties": false
@@ -2310,6 +2329,91 @@
23102329
},
23112330
"additionalProperties": false,
23122331
"definitions": {
2332+
"collectorConfKeyVal": {
2333+
"if": {
2334+
"properties": {
2335+
"discrete": {
2336+
"type": "boolean",
2337+
"enum": [
2338+
false
2339+
]
2340+
}
2341+
}
2342+
},
2343+
"then": {
2344+
"additionalProperties": false,
2345+
"properties": {
2346+
"discrete": {
2347+
"type": "boolean"
2348+
},
2349+
"value": {
2350+
"type": [
2351+
"object",
2352+
"number",
2353+
"null",
2354+
"integer",
2355+
"array",
2356+
"boolean",
2357+
"string"
2358+
]
2359+
},
2360+
"key": {
2361+
"type": "string",
2362+
"minLength": 1
2363+
},
2364+
"dontOverride": {
2365+
"type": "boolean"
2366+
},
2367+
"coalesceFormat": {
2368+
"enum": [
2369+
"",
2370+
"csv",
2371+
"json",
2372+
"pipe"
2373+
],
2374+
"default": ""
2375+
}
2376+
}
2377+
},
2378+
"else": {
2379+
"additionalProperties": false,
2380+
"properties": {
2381+
"discrete": {
2382+
"type": "boolean"
2383+
},
2384+
"values": {
2385+
"type": "array",
2386+
"items": {
2387+
"type": [
2388+
"object",
2389+
"number",
2390+
"null",
2391+
"integer",
2392+
"array",
2393+
"boolean",
2394+
"string"
2395+
]
2396+
}
2397+
},
2398+
"key": {
2399+
"type": "string",
2400+
"minLength": 1
2401+
},
2402+
"dontOverride": {
2403+
"type": "boolean"
2404+
},
2405+
"coalesceFormat": {
2406+
"enum": [
2407+
"",
2408+
"csv",
2409+
"json",
2410+
"pipe"
2411+
],
2412+
"default": ""
2413+
}
2414+
}
2415+
}
2416+
},
23132417
"toleration": {
23142418
"oneOf": [
23152419
{

charts/argus/values.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ collector:
138138
pullPolicy: ""
139139
## OPTIONAL VALUES
140140

141-
# On a collector downloading event, either download the latest EA version or the latest GD version.
142-
141+
disableLightweightCollector: false
142+
# collector application configuration such as agent.conf
143+
collectorConf:
144+
agentConf: []
143145
# The Http/s proxy url of the collectors.
144146
proxy:
145147
url: ""

charts/collectorset-controller/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ maintainers:
66
77
name: LogicMonitor
88
name: collectorset-controller
9-
version: 1.1.0-rc05
9+
version: 1.1.0-rc06
1010
home: https://logicmonitor.github.io/helm-charts-qa
11-
appVersion: v4.1.0-rc2
11+
appVersion: v4.1.0-rc3

charts/collectorset-controller/crds/collectorset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,8 @@ spec:
11411141
invalid. For ex: 29.101 is invalid, correct input is 29101)'
11421142
minimum: 0
11431143
type: integer
1144+
collectorConfigMapName:
1145+
type: string
11441146
required:
11451147
- replicas
11461148
- clusterName

0 commit comments

Comments
 (0)