github.com/google/cadvisor@v0.49.1/deploy/kubernetes/overlays/examples/stackdriver-sidecar.yaml (about)

     1  # This patch adds a sidecar which pushes all metrics to stackdriver
     2  apiVersion: apps/v1 # for Kubernetes versions before 1.9.0 use apps/v1beta2
     3  kind: DaemonSet
     4  metadata:
     5    name: cadvisor
     6    namespace: cadvisor
     7  spec:
     8    template:
     9      spec:
    10        containers:
    11        - name: prometheus-to-sd
    12          image: gcr.io/google-containers/prometheus-to-sd:v0.2.6
    13          ports:
    14            - name: profiler
    15              containerPort: 6061
    16          command:
    17            - /monitor
    18            - --stackdriver-prefix=custom.googleapis.com
    19            - --source=cadvisor:http://localhost:8080
    20            - --pod-id=$(POD_NAME)
    21            - --namespace-id=$(POD_NAMESPACE)
    22          env:
    23            - name: POD_NAME
    24              valueFrom:
    25                fieldRef:
    26                  fieldPath: metadata.name
    27            - name: POD_NAMESPACE
    28              valueFrom:
    29                fieldRef:
    30                  fieldPath: metadata.namespace
    31          securityContext:
    32            runAsNonRoot: true
    33            readOnlyRootFilesystem: true
    34            allowPrivilegeEscalation: false