apiVersion: apps/v1 kind: DaemonSet metadata: name: alloy namespace: observability labels: app: alloy spec: selector: matchLabels: app: alloy template: metadata: labels: app: alloy spec: serviceAccountName: alloy hostNetwork: true hostPID: true dnsPolicy: ClusterFirstWithHostNet containers: - name: alloy image: grafana/alloy:v1.5.1 args: - run - /etc/alloy/config.alloy - --storage.path=/var/lib/alloy - --server.http.listen-addr=0.0.0.0:12345 ports: - name: http-metrics containerPort: 12345 protocol: TCP - name: otlp-grpc containerPort: 4317 protocol: TCP - name: otlp-http containerPort: 4318 protocol: TCP env: - name: HOSTNAME valueFrom: fieldRef: fieldPath: spec.nodeName securityContext: privileged: true runAsUser: 0 resources: requests: cpu: 100m memory: 256Mi limits: cpu: 500m memory: 512Mi volumeMounts: - name: config mountPath: /etc/alloy - name: varlog mountPath: /var/log readOnly: true - name: varlibdockercontainers mountPath: /var/lib/docker/containers readOnly: true - name: etcmachineid mountPath: /etc/machine-id readOnly: true tolerations: - effect: NoSchedule operator: Exists volumes: - name: config configMap: name: alloy-config - name: varlog hostPath: path: /var/log - name: varlibdockercontainers hostPath: path: /var/lib/docker/containers - name: etcmachineid hostPath: path: /etc/machine-id --- apiVersion: v1 kind: Service metadata: name: alloy namespace: observability labels: app: alloy spec: type: ClusterIP ports: - port: 12345 targetPort: http-metrics protocol: TCP name: http-metrics - port: 4317 targetPort: otlp-grpc protocol: TCP name: otlp-grpc - port: 4318 targetPort: otlp-http protocol: TCP name: otlp-http selector: app: alloy