-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdeployment.yaml
75 lines (75 loc) · 2.32 KB
/
deployment.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
apiVersion: apps/v1
kind: Deployment
metadata:
name: sm-agent-1
namespace: synthetic-monitoring
spec:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
name: sm-agent-1
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
template:
metadata:
labels:
name: sm-agent-1
spec:
containers:
- args:
- --api-server-address=$(API_SERVER)
- --api-token=$(API_TOKEN)
- --verbose=true
# Uncomment to listen on all interfaces. This exposes metrics and debugging endpoints to the cluster, so it
# should only be done on trusted clusters or with network policies set in place.
# - --listen-address=0.0.0.0:4050
env:
- name: API_TOKEN
valueFrom:
secretKeyRef:
key: api-token
name: sm-agent-1
- name: API_SERVER
valueFrom:
secretKeyRef:
key: api-server
name: sm-agent-1
image: grafana/synthetic-monitoring-agent:latest
name: agent
ports:
- containerPort: 4050
name: http-metrics
securityContext:
capabilities:
add:
- NET_RAW # Needed for ICMP (ping and traceroute) checks.
drop:
- all
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 12345 # https://github.com/grafana/synthetic-monitoring-agent/blob/main/Dockerfile#L24
# Readiness/liveness probes can be enabled to show the agent as not ready if it cannot successfully connect
# to the Grafana Synthetic Monitoring API. Enabling this probes requires configuring the agent to listen on
# all interfaces, so they are commented out by default.
# readinessProbe:
# httpGet:
# path: /ready
# port: 4050
# livenessProbe:
# httpGet:
# path: /
# port: 4050
resources:
requests:
cpu: 200m
memory: 500Mi
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}