add prometheus
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 49s

This commit is contained in:
matst80
2024-11-09 11:46:00 +01:00
parent cb96e75f99
commit cfbb2e29c2
8 changed files with 260 additions and 16 deletions

View File

@@ -6,7 +6,7 @@ metadata:
app: cart-actor
name: cart-actor
spec:
replicas: 3
replicas: 2
selector:
matchLabels:
app: cart-actor
@@ -50,11 +50,23 @@ spec:
env:
- name: TZ
value: "Europe/Stockholm"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
---
kind: Service
apiVersion: v1
metadata:
name: cart-actor
annotations:
prometheus.io/port: "8080"
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
spec:
selector:
app: cart-actor
@@ -89,4 +101,16 @@ spec:
service:
name: cart-actor
port:
number: 8080
number: 8080
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: cart-scaler
spec:
scaleTargetRef:
kind: Deployment
name: cart-actor
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 50