From 7a843593e468e0cbbe423faba16fec0d6dfcf7ac Mon Sep 17 00:00:00 2001 From: jvoravong Date: Thu, 12 Dec 2024 08:50:35 -0700 Subject: [PATCH] Refactor agent tolerations for null case and update related changelog --- ...n.yaml => refactor-agent-daemonset-toleration.yaml} | 10 +++++++--- .../splunk-otel-collector/templates/daemonset.yaml | 4 +++- helm-charts/splunk-otel-collector/values.yaml | 10 +++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) rename .chloggen/{enhance-agent-daemonset-toleration.yaml => refactor-agent-daemonset-toleration.yaml} (59%) diff --git a/.chloggen/enhance-agent-daemonset-toleration.yaml b/.chloggen/refactor-agent-daemonset-toleration.yaml similarity index 59% rename from .chloggen/enhance-agent-daemonset-toleration.yaml rename to .chloggen/refactor-agent-daemonset-toleration.yaml index 3362b470f7..93777a9988 100644 --- a/.chloggen/enhance-agent-daemonset-toleration.yaml +++ b/.chloggen/refactor-agent-daemonset-toleration.yaml @@ -1,12 +1,16 @@ # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: enhancement +change_type: breaking # The name of the component, or a single word describing the area of concern, (e.g. agent, clusterReceiver, gateway, operator, chart, other) component: agent # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). note: Make it so the default tolerations used to deploy the agent collector account for k8s distribution # One or more tracking issues related to the change -issues: [1562] +issues: [1562,1572] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. # Use pipe (|) for multiline entries. -subtext: OpenShift infra nodes and AKS system nodes will now be monitored by the agent by default +subtext: | + The agent collector now adjusts default tolerations based on Kubernetes distributions. + OpenShift infra nodes and AKS system nodes are included in default monitoring. + Default tolerations are applied when `tolerations: []` is set, instead of being explicitly defined in `values.yaml`. + To disable default tolerations (previously settable using the value `tolerations: []`), now only use the values `tolerations:` or `tolerations: null`. diff --git a/helm-charts/splunk-otel-collector/templates/daemonset.yaml b/helm-charts/splunk-otel-collector/templates/daemonset.yaml index 5109d0b9c8..ddea985e8f 100644 --- a/helm-charts/splunk-otel-collector/templates/daemonset.yaml +++ b/helm-charts/splunk-otel-collector/templates/daemonset.yaml @@ -74,8 +74,9 @@ spec: affinity: {{ toYaml . | nindent 8 }} {{- end }} + {{- if ne .Values.tolerations nil }} tolerations: - {{- if and (.Values.tolerations) (ne (len .Values.tolerations) 0) }} + {{- if (ne (len .Values.tolerations) 0) }} {{ toYaml .Values.tolerations | nindent 8 }} {{- else }} - key: node-role.kubernetes.io/master @@ -95,6 +96,7 @@ spec: operator: Exists {{- end }} {{- end }} + {{- end }} {{- if and (eq (include "splunk-otel-collector.logsEnabled" .) "true") (not .Values.isWindows) (not $agent.skipInitContainers) }} initContainers: {{- if and (eq .Values.logsEngine "fluentd") (not (eq .Values.distribution "gke/autopilot")) }} diff --git a/helm-charts/splunk-otel-collector/values.yaml b/helm-charts/splunk-otel-collector/values.yaml index b975f88bf2..5860f43a07 100644 --- a/helm-charts/splunk-otel-collector/values.yaml +++ b/helm-charts/splunk-otel-collector/values.yaml @@ -1009,9 +1009,13 @@ secret: # Specifies whether secret provided by user should be validated. validateSecret: true -# The tolerations for deploying the agent collector daemonset. By default, it targets control-plane, worker, -# and k8s distribution-specific nodes (infrastructure or system) to ensure logs and metrics collection from nodes. -# If set, the specified tolerations will override the defaults. +# Configures tolerations for deploying the agent collector DaemonSet. +# - Set to null to omit the tolerations section entirely. +# - Set to an empty list to apply the default tolerations defined in the template: +# https://github.com/signalfx/splunk-otel-collector-chart/blob/main/helm-charts/splunk-otel-collector/templates/daemonset.yaml +# By default, it targets control-plane, worker, and k8s distribution-specific nodes +# (infrastructure or system) to ensure logs and metrics collection from all nodes, taking distribution into account. +# - Set custom tolerations and they will explicitly and completely be used as the value for tolerations. tolerations: [] # Defines which nodes should be selected to deploy the agent collector daemonset.