diff --git a/.changelog/4011.added.txt b/.changelog/4011.added.txt new file mode 100644 index 0000000000..51c0227883 --- /dev/null +++ b/.changelog/4011.added.txt @@ -0,0 +1 @@ +feat: Add support to DaemonSet for extra ports diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml index e2aa47d7a9..ceff34c6c7 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/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index c5cad9d1dc..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,6 +2189,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, @@ -2552,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 09aa7ea905..5374685f7f 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,13 @@ otellogs: - name: es-certs mountPath: /certs readOnly: true + + extraPorts: + - name: otlp-http + containerPort: 4318 + protocol: TCP + hostPort: 4318 + - name: statsd + containerPort: 8125 + hostPort: 8125 + 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..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,6 +114,14 @@ spec: - name: metrics containerPort: 8888 protocol: TCP + - 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 # yamllint disable-line rule:line-length