apiVersion: apps/v1
kind: Deployment
metadata:
  name: otel-collector
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: otel-collector
  replicas: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: otel-collector
    spec:
      serviceAccountName: otel-collector
      containers:
        - name: otel-collector
          image: otel/opentelemetry-collector:latest
          args:
            - "--config=/conf/config.yaml"
          # env:
          #   - name: K8S_NODE_NAME
          #     valueFrom:
          #       fieldRef:
          #         fieldPath: spec.nodeName
          ports:
            # receivers
            - name: otlp
              containerPort: 55680
            - name: grpc-jaeger
              containerPort: 14250
            # exporters
            - name: prometheus
              containerPort: 8889
            # extensions
            - name: metrics # otel own metrics
              containerPort: 8888
            - name: health
              containerPort: 13133
          resources:
            limits:
              cpu: 200m
              memory: 200Mi
            requests:
              cpu: 100m
              memory: 100Mi
          livenessProbe:
            httpGet:
              path: /
              port: 13133
          readinessProbe:
            httpGet:
              path: /
              port: 13133
          volumeMounts:
            - name: conf
              mountPath: /conf
            - name: proc
              mountPath: /host/proc
              readOnly: true
            - name: sys
              mountPath: /host/sys
              readOnly: true
      volumes:
        - name: conf
          configMap:
            name: otel-collector
        - name: proc
          hostPath:
            path: /proc
        - name: sys
          hostPath:
            path: /sys
