Skip to content

Commit

Permalink
Apply agent resources to init containers (#690)
Browse files Browse the repository at this point in the history
Azure Defender throws warnings expecting all containers to have resource limits specified, even on init containers. This change applies the same resources to init containers as allocated to the collector agent. The pod effective limits are not affected because init container limits don't adds up, highest value is applied instead.
  • Loading branch information
dmitryax authored Mar 8, 2023
1 parent 45222e0 commit 8ffd2b9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

- Add functional test coverage for Network Explorer metrics ([#684](https://github.com/signalfx/splunk-otel-collector-chart/pull/684)
- Apply the same resources to init containers as allocated to the otel agent container ([#690](https://github.com/signalfx/splunk-otel-collector-chart/pull/690)

## [0.71.0] - 2023-03-01

Expand Down
4 changes: 4 additions & 0 deletions examples/only-logs-fluentd/rendered_manifests/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ spec:
env:
- name: LOG_FORMAT_TYPE
value: ""
resources:
limits:
cpu: 200m
memory: 500Mi
volumeMounts:
- name: varlogdest
mountPath: /var/lib/docker/containers
Expand Down
4 changes: 4 additions & 0 deletions examples/only-logs-otel/rendered_manifests/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
value: "/var/addon/splunk/otel_pos/receiver_journald_"
- name: JOURNALD_LOG_CAPTURE_REGEX
value: '\/splunkd\-fluentd\-journald\-(?P<name>[\w0-9-_]+)\.pos\.json'
resources:
limits:
cpu: 200m
memory: 500Mi
volumeMounts:
- name: checkpoint
mountPath: /var/addon/splunk/otel_pos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ spec:
env:
- name: LOG_FORMAT_TYPE
value: ""
resources:
limits:
cpu: 200m
memory: 500Mi
volumeMounts:
- name: varlogdest
mountPath: /var/lib/docker/containers
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ spec:
env:
- name: LOG_FORMAT_TYPE
value: "{{ .Values.fluentd.config.containers.logFormatType }}"
resources:
{{- toYaml $agent.resources | nindent 12 }}
volumeMounts:
- name: varlogdest
mountPath: {{ .Values.fluentd.config.containers.pathDest }}
Expand Down Expand Up @@ -121,6 +123,8 @@ spec:
value: "/var/addon/splunk/otel_pos/receiver_journald_"
- name: JOURNALD_LOG_CAPTURE_REGEX
value: '\/splunkd\-fluentd\-journald\-(?P<name>[\w0-9-_]+)\.pos\.json'
resources:
{{- toYaml $agent.resources | nindent 12 }}
volumeMounts:
- name: checkpoint
mountPath: /var/addon/splunk/otel_pos
Expand Down Expand Up @@ -159,6 +163,8 @@ spec:
{{- end }}']
securityContext:
runAsUser: 0
resources:
{{- toYaml $agent.resources | nindent 12 }}
volumeMounts:
- name: checkpoint
mountPath: {{ .Values.logsCollection.checkpointPath }}
Expand Down

0 comments on commit 8ffd2b9

Please sign in to comment.