Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add optional extra configs for agent and cluster receiver #1330

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ spec:
{{- else }}
- /otelcol
- --config=/conf/relay.yaml
{{- if $agent.extraConfigs.enabled }}
{{- range $key := $agent.extraConfigs.configMapKeys }}
{{ print "- --config=/conf-extra/" $key ".yaml" }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.agent.featureGates }}
- --feature-gates={{ .Values.agent.featureGates }}
Expand Down Expand Up @@ -357,6 +362,8 @@ spec:
volumeMounts:
- mountPath: {{ .Values.isWindows | ternary "C:\\conf" "/conf" }}
name: otel-configmap
- mountPath: {{ .Values.isWindows | ternary "C:\\conf-extra" "/conf-extra" }}
name: otel-configmap-extra
{{- if and .Values.agent.discovery.enabled (not .Values.isWindows) }}
- mountPath: /etc/otel/collector/config.d
name: otel-discovery-properties-configmap
Expand Down Expand Up @@ -543,6 +550,16 @@ spec:
items:
- key: relay
path: relay.yaml
{{- if $agent.extraConfigs.enabled }}
- name: otel-configmap-extra
configMap:
name: {{ $agent.extraConfigs.configMapName }}
items:
{{- range $key := $agent.extraConfigs.configMapKeys }}
{{ print "- key: " $key }}
{{ print " path: " $key ".yaml" }}
{{- end }}
{{- end }}
{{- if and .Values.agent.discovery.enabled (not .Values.isWindows) }}
- name: otel-discovery-properties-configmap
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ spec:
- --config=/splunk-messages/config.yaml
{{- else }}
- --config=/conf/relay.yaml
{{- if $clusterReceiver.extraConfigs.enabled }}
{{- range $key := $clusterReceiver.extraConfigs.configMapKeys }}
{{ print "- --config=/conf-extra/" $key ".yaml" }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.clusterReceiver.featureGates }}
Expand Down Expand Up @@ -191,6 +196,8 @@ spec:
{{- end }}
- mountPath: {{ .Values.isWindows | ternary "C:\\conf" "/conf" }}
name: collector-configmap
- mountPath: {{ .Values.isWindows | ternary "C:\\conf-extra" "/conf-extra" }}
name: collector-configmap-extra
{{- if eq (include "splunk-otel-collector.distribution" .) "eks/fargate" }}
- mountPath: /splunk-messages
name: messages
Expand All @@ -209,6 +216,16 @@ spec:
items:
- key: relay
path: relay.yaml
{{- if $clusterReceiver.extraConfigs.enabled }}
- name: collector-configmap-extra
configMap:
name: {{ $clusterReceiver.extraConfigs.configMapName }}
items:
{{- range $key := $clusterReceiver.extraConfigs.configMapKeys }}
{{ print "- key: " $key }}
{{ print " path: " $key ".yaml" }}
{{- end }}
{{- end }}
- name: run-collectd
emptyDir:
sizeLimit: 25Mi
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/splunk-otel-collector/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@
"type": "object",
"additionalProperties": false,
"properties": {
"extraConfigs": {
"type": "object"
},
"enabled": {
"type": "boolean"
},
Expand Down Expand Up @@ -679,6 +682,9 @@
"enabled": {
"type": "boolean"
},
"extraConfigs": {
"type": "object"
},
"resources": {
"type": "object",
"additionalProperties": false,
Expand Down
8 changes: 8 additions & 0 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ extraAttributes:
################################################################################

agent:
extraConfigs:
enabled: false
configMapName: ""
configMapKeys: []
enabled: true

# Metric collection from k8s control plane components.
Expand Down Expand Up @@ -461,6 +465,10 @@ agent:
# It has to be running on one pod, so it uses its own dedicated deployment with 1 replica.

clusterReceiver:
extraConfigs:
enabled: false
configMapName: ""
configMapKeys: []
enabled: true

# Need to be adjusted based on size of the monitored cluster
Expand Down
Loading