Add customer name label
This commit is contained in:
@@ -14,6 +14,7 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
app: hello-gin
|
||||
customerName: cocacola
|
||||
spec:
|
||||
securityContext: # podi tase
|
||||
fsGroup: 2000
|
||||
|
||||
25
templates/networkpolicy.yaml
Normal file
25
templates/networkpolicy.yaml
Normal 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
|
||||
@@ -9,3 +9,5 @@ spec:
|
||||
app: hello-gin
|
||||
podMetricsEndpoints:
|
||||
- targetPort: 8000
|
||||
podTargetLabels:
|
||||
- customerName
|
||||
|
||||
17
templates/prometheusrules.yaml
Normal file
17
templates/prometheusrules.yaml
Normal 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)
|
||||
|
||||
Reference in New Issue
Block a user