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

Fix fluent-bit extraVolumes and extraVolumeMounts migration for v2 #1342

Merged
merged 1 commit into from
Jan 15, 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
7 changes: 0 additions & 7 deletions deploy/helm/sumologic/upgrade-2.0.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -657,13 +657,6 @@ function migrate_fluent_bit() {
yq w -i "${TEMP_FILE}" 'fluent-bit.service.labels."sumologic.com/scrape"' --style double true
fi

yq w -i "${TEMP_FILE}" 'fluent-bit.extraVolumeMounts[+].mountPath' '/tail-db'
yq w -i "${TEMP_FILE}" 'fluent-bit.extraVolumeMounts[0].name' 'tail-db'

yq w -i "${TEMP_FILE}" 'fluent-bit.extraVolumes[+].hostPath.path' '/var/lib/fluent-bit'
yq w -i "${TEMP_FILE}" 'fluent-bit.extraVolumes[0].hostPath.type' 'DirectoryOrCreate'
yq w -i "${TEMP_FILE}" 'fluent-bit.extraVolumes[0].name' 'tail-db'

local CONFIG_KEY_WIDTH
readonly CONFIG_KEY_WIDTH="22"

Expand Down
21 changes: 21 additions & 0 deletions tests/upgrade_v2_script/static/fluent_bit.input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ fluent-bit:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
extraVolumes:
- name: project2-db
emptyDir: {}
- name: project-db
emptyDir: {}
- name: project2-alerts
hostPath:
path: /var/project2/logs/alerts/alerts.json
type: File
- name: company-db
emptyDir: {}
extraVolumeMounts:
- name: project2-db
mountPath: /fluent-bit/project2
- name: project-db
mountPath: /fluent-bit/project
- name: project2-alerts
mountPath: /var/project2/logs/alerts/alerts.json
readOnly: true
- name: company-db
mountPath: /fluent-bit/company
tolerations:
- effect: NoSchedule
operator: Exists
Expand Down
29 changes: 21 additions & 8 deletions tests/upgrade_v2_script/static/fluent_bit.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ fluent-bit:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
extraVolumes:
pmalek-sumo marked this conversation as resolved.
Show resolved Hide resolved
- name: project2-db
emptyDir: {}
- name: project-db
emptyDir: {}
- name: project2-alerts
hostPath:
path: /var/project2/logs/alerts/alerts.json
type: File
- name: company-db
emptyDir: {}
extraVolumeMounts:
- name: project2-db
mountPath: /fluent-bit/project2
- name: project-db
mountPath: /fluent-bit/project
- name: project2-alerts
mountPath: /var/project2/logs/alerts/alerts.json
readOnly: true
- name: company-db
mountPath: /fluent-bit/company
tolerations:
- effect: NoSchedule
operator: Exists
Expand All @@ -19,14 +40,6 @@ fluent-bit:
service:
labels:
sumologic.com/scrape: "true"
extraVolumeMounts:
- mountPath: /tail-db
name: tail-db
extraVolumes:
- hostPath:
path: /var/lib/fluent-bit
type: DirectoryOrCreate
name: tail-db
config:
inputs: |-
[INPUT]
Expand Down