Skip to content
Snippets Groups Projects
Commit 034a32b0 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1279: Configure prometheus metrics

parent 87b37b2e
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
app.kubernetes.io/instance: {{ include "app.name" . }} app.kubernetes.io/instance: {{ include "app.name" . }}
app.kubernetes.io/managed-by: {{ include "app.managedBy" . }} app.kubernetes.io/managed-by: {{ include "app.managedBy" . }}
app.kubernetes.io/name: {{ include "app.name" . }} app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/part-of: kop
app.kubernetes.io/version: {{ include "app.version" . }} app.kubernetes.io/version: {{ include "app.version" . }}
app.kubernetes.io/namespace: {{ include "app.namespace" . }} app.kubernetes.io/namespace: {{ include "app.namespace" . }}
helm.sh/chart: {{ include "app.chart" . }} helm.sh/chart: {{ include "app.chart" . }}
......
...@@ -21,6 +21,7 @@ spec: ...@@ -21,6 +21,7 @@ spec:
metadata: metadata:
labels: labels:
{{- include "app.defaultLabels" . | indent 8 }} {{- include "app.defaultLabels" . | indent 8 }}
app.kubernetes.io/component: intelliform-adapter
spec: spec:
topologySpreadConstraints: topologySpreadConstraints:
- maxSkew: 1 - maxSkew: 1
......
...@@ -6,9 +6,13 @@ metadata: ...@@ -6,9 +6,13 @@ metadata:
spec: spec:
selector: selector:
{{- include "app.matchLabels" . | indent 4 }} {{- include "app.matchLabels" . | indent 4 }}
app.kubernetes.io/component: intelliform-adapter-service
type: ClusterIP type: ClusterIP
ports: ports:
- name: http - name: http
port: 8080 port: 8080
protocol: TCP protocol: TCP
targetPort: 8080 targetPort: 8080
- name: metrics
port: 8081
protocol: TCP
\ No newline at end of file
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "app.name" . }}
namespace: {{ include "app.namespace" . }}
labels:
{{- include "app.defaultLabels" . | indent 4 }}
spec:
endpoints:
- honorLabels: true
port: metrics
path: /actuator/prometheus
relabelings:
- targetLabel: component
sourceLabels:
- __meta_kubernetes_pod_label_app_kubernetes_io_component
- targetLabel: partOf
sourceLabels:
- __meta_kubernetes_pod_label_app_kubernetes_io_part_of
namespaceSelector:
matchNames:
- {{ include "app.namespace" . }}
selector:
matchLabels:
{{- include "app.matchLabels" . | indent 6 }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment