Add customer name label

This commit is contained in:
2024-08-22 16:25:32 +03:00
parent a38e0c43d4
commit 7531433a68
4 changed files with 45 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ spec:
metadata:
labels:
app: hello-gin
customerName: cocacola
spec:
securityContext: # podi tase
fsGroup: 2000

View File

@@ -0,0 +1,25 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: hello-gin
spec:
podSelector:
matchLabels:
app: hello-gin
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: prometheus
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: default
podSelector:
matchLabels:
app.kubernetes.io/instance: shared
app.kubernetes.io/name: traefik

View File

@@ -9,3 +9,5 @@ spec:
app: hello-gin
podMetricsEndpoints:
- targetPort: 8000
podTargetLabels:
- customerName

View File

@@ -0,0 +1,17 @@
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: hello-gin
spec:
groups:
- name: hello-gin
rules:
- alert: GinIsOutOfBottle
expr: gin_avg_latency > 5
for: 2m
labels:
severity: warning
annotations:
summary: Gin average response latency is high (>5sec)