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
| apiVersion: batch/v1
kind: CronJob
metadata:
namespace: app
name: cronjob-a
labels:
app: cronjob-a
tags.datadoghq.com/env: environment
tags.datadoghq.com/service: cronjob-a
tags.datadoghq.com/version: v1
spec:
jobTemplate:
spec:
template:
metadata:
labels:
app: cronjob-a
tags.datadoghq.com/service: cronjob-a
tags.datadoghq.com/version: v1
annotations:
ad.datadoghq.com/cronjob-a.logs: '[{"source":"mysource","service":"cronjob-a"}]'
containers:
- name: cronjob-a
image: image:tag
env:
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: DD_ENV
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/env']
- name: DD_SERVICE
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/service']
- name: DD_VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/version']
|