-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathapp_deployment.yaml
70 lines (69 loc) · 1.62 KB
/
app_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
apiVersion: apps/v1
kind: Deployment
metadata:
name: flaskapp
spec:
replicas: 1
selector:
matchLabels:
app: flaskapp
template:
metadata:
labels:
app: flaskapp
# annotations:
# ad.datadoghq.com/flaskapp.check_names: '["prometheus"]'
# ad.datadoghq.com/flaskapp.init_configs: '[{}]'
# ad.datadoghq.com/flaskapp.instances: '[{"prometheus_url":"%%host%%/metrics","metrics":["*"],"namespace":"apple"}]'
# 6.5 ad.datadoghq.com/flaskapp.logs: '[{"type":"file","path":"/var/log/mylog.json","service":"flask","source":"python","sourcecategory":"sourcecode"}]'
spec:
containers:
- name: flaskapp
image: sample_flask:007
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000
env:
- name: DD_AGENT_SERVICE_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: DD_AGENT_SERVICE_PORT
value: '8126'
- name: DD_AGENT_STATSD_PORT
value: '8125'
volumeMounts:
- name: flasklogs
mountPath: /var/log
volumes:
- hostPath:
path: /var/log
name: flasklogs
---
apiVersion: v1
kind: Service
metadata:
name: flaskapp
spec:
selector:
app: flaskapp
ports:
- name: http
protocol: TCP
port: 5000
---
kind: ConfigMap
apiVersion: v1
metadata:
name: cm-datadog-confd
namespace: default
data:
flasklogs.yaml: |-
init_config:
instances:
logs:
- type: file
path: /var/log/mylog.json
service: flask
source: python
sourcecategory: sourcecode