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

edit default checkpoint path #292

Merged
merged 5 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -15,7 +15,11 @@ guidelines](https://github.com/signalfx/splunk-otel-collector-chart/blob/main/UP

- Extract `container.image.tag` attribute from `container.image.name` (#285)
- Upgrade splunk-otel-collector image to 0.38.1 (#284)
<<<<<<< HEAD
- Change secret names according to the GDI specification (#295)
=======
- Changed the default checkpoint path to `/var/addon/splunk/otel_pos` (#292)
>>>>>>> f8979ec8b53d (add init container for copying old checkpoint)
rockb1017 marked this conversation as resolved.
Show resolved Hide resolved

### Fixed

Expand Down
25 changes: 21 additions & 4 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ spec:
- name: fluentd-config-cri
mountPath: /fluentd/etc/cri
{{- else }}
- name: copy-old-checkpoint
image: {{ template "splunk-otel-collector.image.otelcol" . }}
imagePullPolicy: {{ .Values.image.fluentd.pullPolicy }}
command: [ "sh", "-c"]
securityContext:
runAsUser: 0
args:
- cp -n /var/lib/otel_pos/* /var/addon/splunk/otel_pos/ || true
volumeMounts:
- name: checkpoint
mountPath: /var/addon/splunk/otel_pos
- name: old-checkpoint
mountPath: /var/lib/otel_pos
- name: migrate-checkpoint
image: {{ template "splunk-otel-collector.image.otelcol" . }}
imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }}
Expand All @@ -104,22 +117,22 @@ spec:
- 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_"
value: "/var/addon/splunk/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_"
value: "/var/addon/splunk/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_"
value: "/var/addon/splunk/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
mountPath: /var/addon/splunk/otel_pos
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
Expand Down Expand Up @@ -365,6 +378,10 @@ spec:
hostPath:
path: {{ .Values.logsCollection.checkpointPath }}
type: DirectoryOrCreate
- name: old-checkpoint
hostPath:
path: /var/lib/otel_pos
type: DirectoryOrCreate
{{- end}}
{{- end}}
{{- if eq (include "splunk-otel-collector.metricsEnabled" $) "true" }}
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ logsCollection:
# value: server
# firstEntryRegex: ^[^\s].*

checkpointPath: "/var/lib/otel_pos"
checkpointPath: "/var/addon/splunk/otel_pos"

################################################################################
# Fluentd sidecar configuration for logs collection.
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/otel-logs/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ data:
token: ${SPLUNK_OBSERVABILITY_ACCESS_TOKEN}
extensions:
file_storage:
directory: /var/lib/otel_pos
directory: /var/addon/splunk/otel_pos
health_check: null
k8s_observer:
auth_type: serviceAccount
Expand Down
29 changes: 23 additions & 6 deletions rendered/manifests/otel-logs/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: b0e737e212b52be61476ca135fde715597ec9789743b5c2f2f1078356000613b
checksum/config: 04f50d53a5a07b84b460bc9ff0e9411318a737d71a3823711b2ad694fce644fe
kubectl.kubernetes.io/default-container: otel-collector
spec:
hostNetwork: true
Expand All @@ -40,6 +40,19 @@ spec:
- effect: NoSchedule
key: node-role.kubernetes.io/master
initContainers:
- name: copy-old-checkpoint
image: quay.io/signalfx/splunk-otel-collector:0.38.1
imagePullPolicy: IfNotPresent
command: [ "sh", "-c"]
securityContext:
runAsUser: 0
args:
- cp -n /var/lib/otel_pos/* /var/addon/splunk/otel_pos/ || true
volumeMounts:
- name: checkpoint
mountPath: /var/addon/splunk/otel_pos
- name: old-checkpoint
mountPath: /var/lib/otel_pos
- name: migrate-checkpoint
image: quay.io/signalfx/splunk-otel-collector:0.38.1
imagePullPolicy: IfNotPresent
Expand All @@ -50,22 +63,22 @@ spec:
- name: CONTAINER_LOG_PATH_FLUENTD
value: "/var/log/splunk-fluentd-containers.log.pos"
- name: CONTAINER_LOG_PATH_OTEL
value: "/var/lib/otel_pos/receiver_filelog_"
value: "/var/addon/splunk/otel_pos/receiver_filelog_"
- name: CUSTOM_LOG_PATH_FLUENTD
value: "/var/log/splunk-fluentd-*.pos"
- name: CUSTOM_LOG_PATH_OTEL
value: "/var/lib/otel_pos/receiver_filelog_"
value: "/var/addon/splunk/otel_pos/receiver_filelog_"
- name: CUSTOM_LOG_CAPTURE_REGEX
value: '\/var\/log\/splunk\-fluentd\-(?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_"
value: "/var/addon/splunk/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
mountPath: /var/addon/splunk/otel_pos
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
Expand Down Expand Up @@ -203,7 +216,7 @@ spec:
mountPath: /var/lib/docker/containers
readOnly: true
- name: checkpoint
mountPath: /var/lib/otel_pos
mountPath: /var/addon/splunk/otel_pos
terminationGracePeriodSeconds: 600
volumes:
- name: varlog
Expand All @@ -213,6 +226,10 @@ spec:
hostPath:
path: /var/lib/docker/containers
- name: checkpoint
hostPath:
path: /var/addon/splunk/otel_pos
type: DirectoryOrCreate
- name: old-checkpoint
hostPath:
path: /var/lib/otel_pos
type: DirectoryOrCreate
Expand Down