From 57dc3e535adac971ca3456b9fb299368440832a3 Mon Sep 17 00:00:00 2001 From: Anahera Roestenburg Date: Fri, 10 Oct 2025 16:30:54 +1300 Subject: [PATCH 1/5] feat: Add support to daemonset for extra ports --- .../templates/logs/collector/otelcol/daemonset.yaml | 3 +++ .../goldenfile/logs_otc_daemonset/complex.input.yaml | 6 ++++++ .../goldenfile/logs_otc_daemonset/complex.output.yaml | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml index e2aa47d7a9..f5f9b7b204 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml @@ -140,6 +140,9 @@ spec: - name: metrics containerPort: 8888 protocol: TCP + {{- if $daemonset.extraPorts }} + {{ toYaml $daemonset.extraPorts | nindent 8 }} + {{- end }} initContainers: # ensure the host path is owned by the otel user group - name: changeowner # yamllint disable-line rule:line-length diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml index 09aa7ea905..c8f8d67242 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml @@ -94,3 +94,9 @@ otellogs: - name: es-certs mountPath: /certs readOnly: true + + extraPorts: + - containerPort: 3000 + hostPort: 3001 + - containerPort: 3002 + protocol: UDP diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml index e888bfaba2..64b1eeadec 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml @@ -114,6 +114,11 @@ spec: - name: metrics containerPort: 8888 protocol: TCP + + - containerPort: 3000 + hostPort: 3001 + - containerPort: 3002 + protocol: UDP initContainers: # ensure the host path is owned by the otel user group - name: changeowner # yamllint disable-line rule:line-length From 308034089ae0b64793bdef822f043496d9c6a3c2 Mon Sep 17 00:00:00 2001 From: Anahera Roestenburg Date: Fri, 10 Oct 2025 16:41:51 +1300 Subject: [PATCH 2/5] Add changelog --- .changelog/4011.added.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/4011.added.txt diff --git a/.changelog/4011.added.txt b/.changelog/4011.added.txt new file mode 100644 index 0000000000..62c70d89db --- /dev/null +++ b/.changelog/4011.added.txt @@ -0,0 +1 @@ +feat: Add support to daemonset for extra ports From 6a192ab156756c271349bbc4ef73ee4c21101ece Mon Sep 17 00:00:00 2001 From: Anahera Roestenburg Date: Fri, 10 Oct 2025 16:59:25 +1300 Subject: [PATCH 3/5] Adjust tests to be more realistic, fix indentation fix: try fix newline issue --- .../templates/logs/collector/otelcol/daemonset.yaml | 6 +++--- .../goldenfile/logs_otc_daemonset/complex.input.yaml | 12 ++++++++---- .../logs_otc_daemonset/complex.output.yaml | 11 +++++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml index f5f9b7b204..ceff34c6c7 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml @@ -140,9 +140,9 @@ spec: - name: metrics containerPort: 8888 protocol: TCP - {{- if $daemonset.extraPorts }} - {{ toYaml $daemonset.extraPorts | nindent 8 }} - {{- end }} +{{- if $daemonset.extraPorts }} +{{- toYaml $daemonset.extraPorts | nindent 8 }} +{{- end }} initContainers: # ensure the host path is owned by the otel user group - name: changeowner # yamllint disable-line rule:line-length diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml index c8f8d67242..2e41b55439 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml @@ -96,7 +96,11 @@ otellogs: readOnly: true extraPorts: - - containerPort: 3000 - hostPort: 3001 - - containerPort: 3002 - protocol: UDP + - name: otlp-http + containerPort: 4318 + protocol: TCP + hostPort: 4318 + - name: statsd + containerPort: 8125 + hostPort: 8125 + protocol: UDP \ No newline at end of file diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml index 64b1eeadec..34094619e0 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.output.yaml @@ -114,10 +114,13 @@ spec: - name: metrics containerPort: 8888 protocol: TCP - - - containerPort: 3000 - hostPort: 3001 - - containerPort: 3002 + - name: otlp-http + containerPort: 4318 + protocol: TCP + hostPort: 4318 + - name: statsd + containerPort: 8125 + hostPort: 8125 protocol: UDP initContainers: # ensure the host path is owned by the otel user group - name: changeowner From aedd0c8f68525d498d387a0cbccea158f7c4bfd5 Mon Sep 17 00:00:00 2001 From: Anahera Roestenburg Date: Mon, 13 Oct 2025 14:24:24 +1300 Subject: [PATCH 4/5] docs: Add extraPorts to values.yaml --- deploy/helm/sumologic/values.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index c5cad9d1dc..4d61a6da5b 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -2192,6 +2192,17 @@ otellogs: # maxUnavailable: 1 # type: RollingUpdate + ## Extra Ports - Allows you to open additional ports on the Daemonset + # extraPorts: + # - name: otlp-http + # containerPort: 4318 + # protocol: TCP + # hostPort: 4318 + # - name: statsd + # containerPort: 8125 + # hostPort: 8125 + # protocol: UDP + ## additionalDaemonSets allows to set daemonsets with affinity, nodeSelector and resources ## different than the main DaemonSet ## Be careful and set nodeAffinity for the main DaemonSet, From a5e98ae5e559ddd6883a08a813853281b9bb8e45 Mon Sep 17 00:00:00 2001 From: Anahera Roestenburg Date: Thu, 16 Oct 2025 10:59:14 +1300 Subject: [PATCH 5/5] chore: Lint + spelling fixes --- .changelog/4011.added.txt | 2 +- deploy/helm/sumologic/values.yaml | 16 ++++++---------- .../logs_otc_daemonset/complex.input.yaml | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.changelog/4011.added.txt b/.changelog/4011.added.txt index 62c70d89db..51c0227883 100644 --- a/.changelog/4011.added.txt +++ b/.changelog/4011.added.txt @@ -1 +1 @@ -feat: Add support to daemonset for extra ports +feat: Add support to DaemonSet for extra ports diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 4d61a6da5b..8774293f5d 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -1061,8 +1061,7 @@ kube-prometheus-stack: ## Annotations to add to the operator pod podAnnotations: {} ## Resource limits for prometheus operator - resources: - {} + resources: {} # limits: # cpu: 200m # memory: 200Mi @@ -1095,8 +1094,7 @@ kube-prometheus-stack: customLabels: {} ## Additional annotations for pods in the DaemonSet podAnnotations: {} - resources: - {} + resources: {} # limits: # cpu: 100m # memory: 64Mi @@ -1185,8 +1183,7 @@ kube-prometheus-stack: podLabels: {} ## Additional annotations for pods in the DaemonSet podAnnotations: {} - resources: - {} + resources: {} # limits: # cpu: 200m # memory: 50Mi @@ -2192,7 +2189,7 @@ otellogs: # maxUnavailable: 1 # type: RollingUpdate - ## Extra Ports - Allows you to open additional ports on the Daemonset + ## Extra Ports - Allows you to open additional ports on the DaemonSet # extraPorts: # - name: otlp-http # containerPort: 4318 @@ -2202,7 +2199,7 @@ otellogs: # containerPort: 8125 # hostPort: 8125 # protocol: UDP - + ## additionalDaemonSets allows to set daemonsets with affinity, nodeSelector and resources ## different than the main DaemonSet ## Be careful and set nodeAffinity for the main DaemonSet, @@ -2563,8 +2560,7 @@ opentelemetry-operator: nodejs: repository: public.ecr.aws/sumologic/autoinstrumentation-nodejs tag: 0.54.0 - env: - {} + env: {} # ENABLE_WEBHOOKS: "true" resources: limits: diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml index 2e41b55439..5374685f7f 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/complex.input.yaml @@ -103,4 +103,4 @@ otellogs: - name: statsd containerPort: 8125 hostPort: 8125 - protocol: UDP \ No newline at end of file + protocol: UDP