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

add initContainer for migrating checkpoint for otel agent #253

Merged
merged 2 commits into from
Oct 27, 2021
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Added

- Add initContainer for log checkpoint migration from Fluentd to Otel agent (#253)

## [0.37.0] - 2021-10-26

[Upgrade
Expand Down
35 changes: 34 additions & 1 deletion helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ spec:
tolerations:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if and (eq (include "splunk-otel-collector.logsEnabled" .) "true") (eq .Values.logsEngine "fluentd") }}
{{- if (eq (include "splunk-otel-collector.logsEnabled" .) "true") }}
initContainers:
{{- if (eq .Values.logsEngine "fluentd") }}
- name: prepare-fluentd-config
image: {{ .Values.image.fluentd.initContainer.image }}
imagePullPolicy: {{ .Values.image.fluentd.initContainer.pullPolicy }}
Expand Down Expand Up @@ -90,6 +91,38 @@ spec:
mountPath: /fluentd/etc/json
- name: fluentd-config-cri
mountPath: /fluentd/etc/cri
{{- else }}
- name: migrate-checkpoint
image: {{ template "splunk-otel-collector.image.otelcol" . }}
imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }}
command: ["/migratecheckpoint"]
securityContext:
runAsUser: 0
env:
- name: CONTAINER_LOG_PATH_FLUENTD
value: "{{ .Values.fluentd.config.posFilePrefix }}-containers.log.pos"
- name: CONTAINER_LOG_PATH_OTEL
value: "/var/lib/otel_pos/receiver_filelog_"
- name: CUSTOM_LOG_PATH_FLUENTD
value: "{{ .Values.fluentd.config.posFilePrefix }}-*.pos"
- name: CUSTOM_LOG_PATH_OTEL
value: "/var/lib/otel_pos/receiver_filelog_"
- name: CUSTOM_LOG_CAPTURE_REGEX
value: '{{ regexReplaceAll "(\\W)" .Values.fluentd.config.posFilePrefix "\\${1}" }}\-(?P<name>[\w0-9-_]+)\.pos'
- name: JOURNALD_LOG_PATH_FLUENTD
value: "/var/log/splunkd-fluentd-journald-*.pos.json"
- name: JOURNALD_LOG_PATH_OTEL
value: "/var/lib/otel_pos/receiver_journald_"
- name: JOURNALD_LOG_CAPTURE_REGEX
value: '\/splunkd\-fluentd\-journald\-(?P<name>[\w0-9-_]+)\.pos\.json'
volumeMounts:
- name: checkpoint
mountPath: /var/lib/otel_pos
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
{{- end }}
{{- end }}
containers:
{{- if and (eq (include "splunk-otel-collector.logsEnabled" .) "true") (eq .Values.logsEngine "fluentd") }}
Expand Down