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 124dac6 commit 8843053
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
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 8843053

Please sign in to comment.