Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/cmd/grafana-agent-operator/example-prometheus.yaml
4094 views
1
## prometheus.yaml contains a tiny Prometheus deployment used for testing the
2
## Grafana Agent Operator.
3
4
---
5
6
apiVersion: apps/v1
7
kind: StatefulSet
8
metadata:
9
name: prometheus
10
namespace: default
11
labels:
12
app: prometheus
13
spec:
14
serviceName: prometheus
15
replicas: 1
16
selector:
17
matchLabels:
18
app: prometheus
19
template:
20
metadata:
21
labels:
22
app: prometheus
23
spec:
24
containers:
25
- name: prometheus
26
image: prom/prometheus:v2.26.0
27
args:
28
- --config.file=/var/lib/prometheus/prometheus.yml
29
- --enable-feature=remote-write-receiver
30
- --storage.tsdb.path=/var/lib/data
31
ports:
32
- name: http-metrics
33
containerPort: 9090
34
volumeMounts:
35
- mountPath: /var/lib/prometheus
36
name: config
37
readOnly: true
38
- mountPath: /var/lib/data
39
name: data
40
volumes:
41
- name: config
42
configMap:
43
name: prometheus-config
44
- name: data
45
emptyDir: {}
46
47
---
48
49
apiVersion: v1
50
kind: ConfigMap
51
metadata:
52
name: prometheus-config
53
namespace: default
54
labels:
55
app: prometheus
56
data:
57
prometheus.yml: |
58
# Nothing to do, Prometheus is just used for writing to
59
60
---
61
62
apiVersion: v1
63
kind: Service
64
metadata:
65
name: prometheus
66
namespace: default
67
labels:
68
app: prometheus
69
spec:
70
selector:
71
app: prometheus
72
ports:
73
- name: http-metrics
74
port: 9090
75
targetPort: 9090
76
77
---
78
79
apiVersion: networking.k8s.io/v1
80
kind: Ingress
81
metadata:
82
name: prometheus
83
namespace: default
84
labels:
85
app: prometheus
86
spec:
87
rules:
88
- host: prometheus.k3d.localhost
89
http:
90
paths:
91
- path: /
92
pathType: Prefix
93
backend:
94
service:
95
name: prometheus
96
port: { name: 'http-metrics' }
97
98