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

feat(logs): allow setting daemonset labels and annotations #2811

Merged
merged 1 commit into from
Jan 20, 2023
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- feat(logs): allow setting daemonset labels and annotations [#2811]

[#2811]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2811
[Unreleased]: https://github.com/SumoLogic/sumologic-kubernetes-collection/compare/v3.0.0-rc.0...main

## [v3.0.0-rc.0]

### Migration from v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ printf "%s%s" (include "sumologic.metadata.name.logs.collector.daemonset" $ctx) $instance | trunc 63 | trimSuffix "-" }}
{{- if $.Values.otellogs.daemonset.annotations }}
annotations:
{{ toYaml $.Values.otellogs.daemonset.annotations| indent 4 }}
{{- end }}
labels:
app: {{ template "sumologic.labels.app.logs.collector.daemonset" $ctx }}
{{- include "sumologic.labels.common" $ctx | nindent 4 }}
{{- if $.Values.otellogs.daemonset.labels }}
{{ toYaml $.Values.otellogs.daemonset.labels | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4267,6 +4267,12 @@ otellogs:
runAsUser: 0
runAsGroup: 0

## Add custom labels to the otelcol daemonset
labels: {}

## Add custom annotations to the otelcol daemonset
annotations: {}

## Add custom labels to all otelcol daemonset pods
podLabels: {}

Expand Down
8 changes: 8 additions & 0 deletions tests/helm/logs_otc_daemonset/static/complex.input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ otellogs:
runAsUser: 0
runAsGroup: 0

## Add custom labels to the otelcol daemonset
labels:
someDaemonsetLabel: someValue

## Add custom annotations to the otelcol daemonset
annotations:
someDaemonsetAnnotation: someValue

## Add custom labels to all otelcol daemonset pods
podLabels:
someLabel: someValue
Expand Down
3 changes: 3 additions & 0 deletions tests/helm/logs_otc_daemonset/static/complex.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
name: RELEASE-NAME-sumologic-otelcol-logs-collector
annotations:
someDaemonsetAnnotation: someValue
labels:
app: RELEASE-NAME-sumologic-otelcol-logs-collector
chart: "sumologic-%CURRENT_CHART_VERSION%"
release: "RELEASE-NAME"
heritage: "Helm"
someDaemonsetLabel: someValue
spec:
selector:
matchLabels:
Expand Down