Skip to content

Commit

Permalink
Refactor agent tolerations for null case and update related changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoravong committed Dec 12, 2024
1 parent 387c3ea commit 7a84359
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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`.
4 changes: 3 additions & 1 deletion helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")) }}
Expand Down
10 changes: 7 additions & 3 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7a84359

Please sign in to comment.