From c50a771a20059da673d585bba25a8c97f93ed8f9 Mon Sep 17 00:00:00 2001 From: Lluis Gifre <lluis.gifre@cttc.es> Date: Thu, 5 Aug 2021 14:41:02 +0200 Subject: [PATCH] Add manifest of prometeus for used for monitoring --- manifests/prometheus.yaml | 78 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 manifests/prometheus.yaml diff --git a/manifests/prometheus.yaml b/manifests/prometheus.yaml new file mode 100644 index 000000000..311cb28b0 --- /dev/null +++ b/manifests/prometheus.yaml @@ -0,0 +1,78 @@ +--- +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: + - teraflow-development + - job_name: 'teraflow-metrics-service' + kubernetes_sd_configs: + - role: service + namespaces: + names: + - teraflow-development + - job_name: 'teraflow-metrics-endpoints' + kubernetes_sd_configs: + - role: endpoints + namespaces: + names: + - teraflow-development +--- +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: + - name: prometheus-http + protocol: TCP + port: 9090 + targetPort: 9090 +--- -- GitLab