forked from traefik/traefik-helm-chart
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice-metrics-config_test.yaml
55 lines (55 loc) · 1.44 KB
/
service-metrics-config_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
suite: Metrics Service configuration
templates:
- service-metrics.yaml
tests:
- it: "should not fail with long name by default"
release:
name: thisisaverylongreleasenameinordertotriggerit
asserts:
- hasDocuments:
count: 0
- it: "should support prometheus: null"
set:
metrics:
prometheus: null
asserts:
- hasDocuments:
count: 0
- it: should not provide a dedicated metrics service by default
asserts:
- hasDocuments:
count: 0
- it: should provide a dedicated metrics service when enabled set to true
set:
metrics:
prometheus:
service:
enabled: true
labels:
custom-label: label-value
annotations:
custom-annotation: annotation-value
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.type
value: ClusterIP
- equal:
path: metadata.labels.custom-label
value: label-value
- equal:
path: metadata.annotations.custom-annotation
value: annotation-value
- equal:
path: spec.selector
value:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: RELEASE-NAME-NAMESPACE
- contains:
path: spec.ports
content:
port: 9100
name: "metrics"
targetPort: metrics
protocol: TCP