Skip to content

Commit

Permalink
add init container for copying old checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rockb1017 committed Nov 16, 2021
1 parent ba26e22 commit f8979ec
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Extract `container.image.tag` attribute from `container.image.name` (#285)
- Upgrade splunk-otel-collector image to 0.38.1 (#284)
- Changed the default checkpoint path to `/var/addon/splunk/otel_pos` (#292)

### Fixed

Expand Down
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 @@ -94,6 +94,19 @@ spec:
- name: fluentd-config-cri
mountPath: /fluentd/etc/cri
{{- else }}
- name: copy-old-checkpoint
image: {{ template "splunk-otel-collector.image.fluentd" . }}
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 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
17 changes: 17 additions & 0 deletions rendered/manifests/otel-logs/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ spec:
- effect: NoSchedule
key: node-role.kubernetes.io/master
initContainers:
- name: copy-old-checkpoint
image: splunk/fluentd-hec:1.2.8
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 Down Expand Up @@ -216,6 +229,10 @@ spec:
hostPath:
path: /var/addon/splunk/otel_pos
type: DirectoryOrCreate
- name: old-checkpoint
hostPath:
path: /var/lib/otel_pos
type: DirectoryOrCreate
- name: host-dev
hostPath:
path: /dev
Expand Down

0 comments on commit f8979ec

Please sign in to comment.