Newer
Older
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
kind: ConfigMap
apiVersion: v1
metadata:
name: prometheus-config
data:
prometheus.yml: |
global:
scrape_interval: 15s
external_labels:
monitor: 'teraflow-metrics'
scrape_configs:
- job_name: 'teraflow-metrics-pod'
kubernetes_sd_configs:
- role: pod
namespaces:
names:
Lluis Gifre Renom
committed
- gitlab-ci
- job_name: 'teraflow-metrics-service'
kubernetes_sd_configs:
- role: service
namespaces:
names:
Lluis Gifre Renom
committed
- gitlab-ci
- job_name: 'teraflow-metrics-endpoints'
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
Lluis Gifre Renom
committed
- gitlab-ci
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
86
87
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
spec:
selector:
matchLabels:
app: prometheus
replicas: 1
template:
metadata:
labels:
app: prometheus
version: v1
spec:
#serviceAccountName: prometheus
containers:
- name: prometheus
image: prom/prometheus:v2.28.1
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config-volume
mountPath: /etc/prometheus/prometheus.yml
subPath: prometheus.yml
volumes:
- name: prometheus-config-volume
configMap:
name: prometheus-config
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
labels:
app: prometheus
spec:
type: ClusterIP
selector:
app: prometheus
ports:
Lluis Gifre Renom
committed
- name: http
protocol: TCP
port: 9090
targetPort: 9090
---