forked from atlassian/gostatsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
85 lines (83 loc) · 1.89 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
76
77
78
79
80
81
82
83
84
85
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gostatsd-cfg
namespace: default
data:
config.toml: |
# Example: don't actually do anything with the metrics
backends=['null']
default-tags=[]
internal-tags=['in_cluster:true']
statser-type='internal'
flush-interval='1s'
bad-lines-per-minute=1000
metrics-addr=':8125'
filters='no-hostname'
[k8s]
# Include any annotation beginning with myapp.company.com as a tag, using the part after the / as the tag name
annotation-tag-regex = '^myapp\.company\.com/(?P<tag>.*)$'
# Include the 'app' label as a tag
label-tag-regex = '^app$'
[filter.no-hostname]
# Drop the hostname from metrics because it can be very noisy with pod churn on Kubernetes
drop-host=true
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gostatsd
namespace: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gostatsd
namespace: default
labels:
app: gostatsd
spec:
replicas: 1
selector:
matchLabels:
app: gostatsd
template:
metadata:
labels:
app: gostatsd
annotations:
myapp.company.com/imageVersion: "latest"
spec:
serviceAccountName: gostatsd
containers:
- name: gostatsd
imagePullPolicy: IfNotPresent
image: atlassianlabs/gostatsd:latest
ports:
- containerPort: 8125
command: ['/bin/gostatsd', '--cloud-provider', 'k8s', '--config-path', '/etc/gostatsd-cfg/config.toml']
volumeMounts:
- name: config
mountPath: /etc/gostatsd-cfg
volumes:
- name: config
configMap:
name: gostatsd-cfg
---
apiVersion: v1
kind: Service
metadata:
labels:
app: gostatsd
name: gostatsd
namespace: default
spec:
ports:
- name: udp-metrics
port: 8125
protocol: UDP
targetPort: 8125
selector:
app: gostatsd
type: ClusterIP