-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathspringboot_deployment.yaml
56 lines (56 loc) · 1.53 KB
/
springboot_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
apiVersion: apps/v1
kind: Deployment
metadata:
name: springbootapp
spec:
replicas: 2
selector:
matchLabels:
app: springbootapp
template:
metadata:
labels:
app: springbootapp
annotations:
ad.datadoghq.com/springbootapp.check_names: '["prometheus"]'
ad.datadoghq.com/springbootapp.init_configs: '[{}]'
ad.datadoghq.com/springbootapp.instances: '[{"prometheus_url":"http://%%host%%:%%port%%/actuator/prometheus","metrics":["*"],"namespace":"springboot"}]'
# 6.5 ad.datadoghq.com/flaskapp.logs: '[{"type":"file","path":"/var/log/mylog.json","service":"flask","source":"python","sourcecategory":"sourcecode"}]'
spec:
containers:
- name: springbootapp
image: zmiao1/sample_springboot:011
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
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'
- name: DD_SERVICE_NAME
value: 'SpringBoot_Service'
# volumeMounts:
# - name: SpringBootLogs
# mountPath: /var/log
# volumes:
# - hostPath:
# path: /var/log
# name: SpringBootLogs
---
apiVersion: v1
kind: Service
metadata:
name: springbootapp
spec:
selector:
app: springbootapp
ports:
- name: http
protocol: TCP
port: 8080
type: LoadBalancer