Skip to content

Commit

Permalink
feat(argus,csc): accept agent.conf customizations for collector (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkumbhar94 authored Sep 20, 2022
1 parent 524129a commit ff684c0
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/argus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ maintainers:
- email: argus@logicmonitor.com
name: LogicMonitor
name: argus
version: 2.2.0-rc04
version: 2.2.0-rc05
home: https://logicmonitor.github.io/helm-charts-qa
appVersion: v8.2.0-rc1
14 changes: 14 additions & 0 deletions charts/argus/templates/_collector_conf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{/* vim: set filetype=mustache: */}}

{{- define "trimmed-collector-config-agentConf" -}}
{{- $trimmedCollectorProps := list "jdbc" "perfmon" "wmi" "netapp" "esx" "xen" "mongo" "wineventlog" "snmptrap" "syslog"}}
{{- $propList := list }}
{{- range $val := $trimmedCollectorProps }}
{{- $kv := dict}}
{{- $_ := set $kv "key" (printf "collector.%s.enable" $val) }}
{{- $_1 := set $kv "value" "false" }}
{{- $propList = append $propList $kv }}
trimmedCollectorAgentConf:
{{- toYaml $propList | nindent 2 }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/argus/templates/collector-conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "argus.fullname" . }}-collector
namespace: {{ template "argus.namespace" . }}
labels:
{{- include "argus.labels" . | nindent 4 }}
annotations:
helm-chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
helm-revision: "{{ .Release.Revision }}"
## keep value false as string, spinnaker's limitation, otherwise spinnaker fails to cast boolean to string
strategy.spinnaker.io/versioned: "false"
{{- include "argus.annotations" . | nindent 4 }}
data:
collector-conf.yaml: |
agentConf:
{{- if not .Values.collector.disableLightweightCollector }}
{{- $abc := include "trimmed-collector-config-agentConf" . | fromYaml }}
{{- get $abc "trimmedCollectorAgentConf" | toYaml | nindent 6 }}
{{- end }}
{{- toYaml .Values.collector.collectorConf.agentConf | nindent 6 }}
1 change: 1 addition & 0 deletions charts/argus/templates/collectorset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ spec:
{{ toYaml .Values.collector.statefulsetSpec | nindent 4 }}
{{- end }}
probe: {{ toYaml .Values.collector.probe | nindent 4 }}
collectorConfigMapName: {{ include "argus.fullname" . }}-collector
104 changes: 104 additions & 0 deletions charts/argus/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,25 @@
}
},
"additionalProperties": false
},
"disableLightweightCollector": {
"$id": "#/properties/collector/properties/enableLightweightCollector",
"type": "boolean",
"default": false
},
"collectorConf": {
"$id": "#/properties/collector/properties/collectorConf",
"type": "object",
"properties": {
"agentConf": {
"type": "array",
"items": {
"$ref": "#/definitions/collectorConfKeyVal"
},
"uniqueItems": true
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -2310,6 +2329,91 @@
},
"additionalProperties": false,
"definitions": {
"collectorConfKeyVal": {
"if": {
"properties": {
"discrete": {
"type": "boolean",
"enum": [
false
]
}
}
},
"then": {
"additionalProperties": false,
"properties": {
"discrete": {
"type": "boolean"
},
"value": {
"type": [
"object",
"number",
"null",
"integer",
"array",
"boolean",
"string"
]
},
"key": {
"type": "string",
"minLength": 1
},
"dontOverride": {
"type": "boolean"
},
"coalesceFormat": {
"enum": [
"",
"csv",
"json",
"pipe"
],
"default": ""
}
}
},
"else": {
"additionalProperties": false,
"properties": {
"discrete": {
"type": "boolean"
},
"values": {
"type": "array",
"items": {
"type": [
"object",
"number",
"null",
"integer",
"array",
"boolean",
"string"
]
}
},
"key": {
"type": "string",
"minLength": 1
},
"dontOverride": {
"type": "boolean"
},
"coalesceFormat": {
"enum": [
"",
"csv",
"json",
"pipe"
],
"default": ""
}
}
}
},
"toleration": {
"oneOf": [
{
Expand Down
6 changes: 4 additions & 2 deletions charts/argus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ collector:
pullPolicy: ""
## OPTIONAL VALUES

# On a collector downloading event, either download the latest EA version or the latest GD version.

disableLightweightCollector: false
# collector application configuration such as agent.conf
collectorConf:
agentConf: []
# The Http/s proxy url of the collectors.
proxy:
url: ""
Expand Down
4 changes: 2 additions & 2 deletions charts/collectorset-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ maintainers:
- email: argus@logicmonitor.com
name: LogicMonitor
name: collectorset-controller
version: 1.1.0-rc05
version: 1.1.0-rc06
home: https://logicmonitor.github.io/helm-charts-qa
appVersion: v4.1.0-rc2
appVersion: v4.1.0-rc3
2 changes: 2 additions & 0 deletions charts/collectorset-controller/crds/collectorset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,8 @@ spec:
invalid. For ex: 29.101 is invalid, correct input is 29101)'
minimum: 0
type: integer
collectorConfigMapName:
type: string
required:
- replicas
- clusterName
Expand Down

0 comments on commit ff684c0

Please sign in to comment.