diff --git a/.changelog/3348.fixed.txt b/.changelog/3348.fixed.txt new file mode 100644 index 0000000000..c080f81258 --- /dev/null +++ b/.changelog/3348.fixed.txt @@ -0,0 +1 @@ +fix(otel-collector): deploy collector by default on all nodes \ No newline at end of file diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 0bf4156ea0..df2419fb75 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -2216,7 +2216,9 @@ otellogs: - CAP_CHOWN nodeSelector: {} - tolerations: [] + tolerations: + - effect: NoSchedule + operator: Exists affinity: {} ## Extra Environment Values - allows yaml definitions diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/additional.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/additional.output.yaml index 458ba1842b..dad17c5229 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/additional.output.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/additional.output.yaml @@ -1,4 +1,5 @@ --- +# Source: sumologic/templates/logs/collector/otelcol/daemonset.yaml apiVersion: apps/v1 kind: DaemonSet metadata: @@ -33,6 +34,9 @@ spec: operator: NotIn values: - linux + tolerations: + - effect: NoSchedule + operator: Exists securityContext: fsGroup: 0 runAsGroup: 0 @@ -41,7 +45,7 @@ spec: containers: - args: - --config=/etc/otelcol/config.yaml - image: public.ecr.aws/sumologic/sumologic-otel-collector:0.87.0-sumo-0 + image: "public.ecr.aws/sumologic/sumologic-otel-collector:0.87.0-sumo-0" imagePullPolicy: IfNotPresent name: otelcol livenessProbe: @@ -96,149 +100,15 @@ spec: protocol: TCP initContainers: # ensure the host path is owned by the otel user group - name: changeowner + # yamllint disable-line rule:line-length image: public.ecr.aws/docker/library/busybox:1.36.0 imagePullPolicy: IfNotPresent securityContext: capabilities: - drop: - - ALL add: - CAP_CHOWN - command: - - "sh" - - "-c" - - | - chown -R \ - 0:0 \ - /var/lib/storage/otc - volumeMounts: - - mountPath: /var/lib/storage/otc - name: file-storage - volumes: - - configMap: - defaultMode: 420 - items: - - key: config.yaml - path: config.yaml - name: RELEASE-NAME-sumologic-otelcol-logs-collector - name: otelcol-config - - hostPath: - path: /var/log/pods - type: "" - name: varlogpods - - hostPath: - path: /var/lib/docker/containers - type: "" - name: varlibdockercontainers - - hostPath: - path: /var/lib/otc - type: DirectoryOrCreate - name: file-storage - - hostPath: - path: /var/log/journal/ - type: "" - name: varlogjournal - serviceAccountName: RELEASE-NAME-sumologic-otelcol-logs-collector - ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: RELEASE-NAME-sumologic-otelcol-logs-collector-linux - namespace: sumologic - labels: - app: RELEASE-NAME-sumologic-otelcol-logs-collector - chart: "sumologic-%CURRENT_CHART_VERSION%" - release: "RELEASE-NAME" - heritage: "Helm" -spec: - selector: - matchLabels: - app.kubernetes.io/name: RELEASE-NAME-sumologic-otelcol-logs-collector-linux - template: - metadata: - annotations: - checksum/config: "%CONFIG_CHECKSUM%" - labels: - app.kubernetes.io/name: RELEASE-NAME-sumologic-otelcol-logs-collector-linux - app.kubernetes.io/app-name: RELEASE-NAME-sumologic-otelcol-logs-collector - chart: "sumologic-%CURRENT_CHART_VERSION%" - release: "RELEASE-NAME" - heritage: "Helm" - spec: - nodeSelector: - kubernetes.io/os: linux - securityContext: - fsGroup: 0 - runAsGroup: 0 - runAsUser: 0 - priorityClassName: "RELEASE-NAME-sumologic-priorityclass" - containers: - - args: - - --config=/etc/otelcol/config.yaml - image: public.ecr.aws/sumologic/sumologic-otel-collector:0.87.0-sumo-0 - imagePullPolicy: IfNotPresent - name: otelcol - livenessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - readinessProbe: - httpGet: - path: / - port: 13133 # Health Check extension default port. - resources: - limits: - cpu: 6 - memory: 1Gi - requests: - cpu: 2 - memory: 32Mi - volumeMounts: - - mountPath: /etc/otelcol - name: otelcol-config - - mountPath: /var/log/pods - name: varlogpods - readOnly: true - - mountPath: /var/lib/docker/containers - name: varlibdockercontainers - readOnly: true - - mountPath: /var/lib/storage/otc - name: file-storage - - mountPath: /var/log/journal - name: varlogjournal - readOnly: true - env: - - name: LOGS_METADATA_SVC - valueFrom: - configMapKeyRef: - name: sumologic-configmap - key: metadataLogs - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - securityContext: - capabilities: drop: - ALL - ports: - - name: pprof - containerPort: 1777 - protocol: TCP - - name: metrics - containerPort: 8888 - protocol: TCP - initContainers: # ensure the host path is owned by the otel user group - - name: changeowner - image: public.ecr.aws/docker/library/busybox:1.36.0 - imagePullPolicy: IfNotPresent - securityContext: - capabilities: - drop: - - ALL - add: - - CAP_CHOWN command: - "sh" - "-c" diff --git a/tests/helm/testdata/goldenfile/logs_otc_daemonset/basic.output.yaml b/tests/helm/testdata/goldenfile/logs_otc_daemonset/basic.output.yaml index 29f304d85e..b1cefa5e62 100644 --- a/tests/helm/testdata/goldenfile/logs_otc_daemonset/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/logs_otc_daemonset/basic.output.yaml @@ -25,6 +25,9 @@ spec: release: "RELEASE-NAME" heritage: "Helm" spec: + tolerations: + - effect: NoSchedule + operator: Exists securityContext: fsGroup: 0 runAsGroup: 0 @@ -33,7 +36,7 @@ spec: containers: - args: - --config=/etc/otelcol/config.yaml - image: public.ecr.aws/sumologic/sumologic-otel-collector:0.87.0-sumo-0 + image: "public.ecr.aws/sumologic/sumologic-otel-collector:0.87.0-sumo-0" imagePullPolicy: IfNotPresent name: otelcol livenessProbe: @@ -88,14 +91,15 @@ spec: protocol: TCP initContainers: # ensure the host path is owned by the otel user group - name: changeowner + # yamllint disable-line rule:line-length image: public.ecr.aws/docker/library/busybox:1.36.0 imagePullPolicy: IfNotPresent securityContext: capabilities: - drop: - - ALL add: - CAP_CHOWN + drop: + - ALL command: - "sh" - "-c"