Skip to content

Commit

Permalink
feat(logs): allow setting daemonset labels and annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Świątek committed Jan 20, 2023
1 parent 5b128ea commit 63722bd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
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

0 comments on commit 63722bd

Please sign in to comment.