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