@@ -28,7 +28,6 @@ import (
28
28
v1 "k8s.io/api/core/v1"
29
29
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
30
30
"k8s.io/kubernetes/pkg/kubelet/cm/topologymanager"
31
- "k8s.io/kubernetes/pkg/kubelet/metrics"
32
31
"k8s.io/kubernetes/test/e2e/feature"
33
32
"k8s.io/kubernetes/test/e2e/framework"
34
33
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
@@ -84,13 +83,18 @@ var _ = SIGDescribe("Topology Manager Metrics", framework.WithSerial(), feature.
84
83
// being [Serial], we can also assume noone else but us is running pods.
85
84
ginkgo .By ("Checking the topologymanager metrics right after the kubelet restart, with no pods running" )
86
85
86
+ idFn := makeCustomPairID ("scope" , "boundary" )
87
87
matchResourceMetrics := gstruct .MatchKeys (gstruct .IgnoreExtras , gstruct.Keys {
88
88
"kubelet_topology_manager_admission_requests_total" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
89
89
"" : timelessSample (0 ),
90
90
}),
91
91
"kubelet_topology_manager_admission_errors_total" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
92
92
"" : timelessSample (0 ),
93
93
}),
94
+ "kubelet_container_aligned_compute_resources_failure_count" : gstruct .MatchElements (idFn , gstruct .IgnoreExtras , gstruct.Elements {
95
+ "container::numa_node" : timelessSample (0 ),
96
+ "pod::numa_node" : timelessSample (0 ),
97
+ }),
94
98
"kubelet_topology_manager_admission_duration_ms_count" : gstruct .MatchElements (nodeID , gstruct .IgnoreExtras , gstruct.Elements {
95
99
"" : timelessSample (0 ),
96
100
}),
@@ -110,13 +114,18 @@ var _ = SIGDescribe("Topology Manager Metrics", framework.WithSerial(), feature.
110
114
// being [Serial], we can also assume noone else but us is running pods.
111
115
ginkgo .By ("Checking the topologymanager metrics right after the kubelet restart, with pod failed to admit" )
112
116
117
+ idFn := makeCustomPairID ("scope" , "boundary" )
113
118
matchResourceMetrics := gstruct .MatchKeys (gstruct .IgnoreExtras , gstruct.Keys {
114
119
"kubelet_topology_manager_admission_requests_total" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
115
120
"" : timelessSample (1 ),
116
121
}),
117
122
"kubelet_topology_manager_admission_errors_total" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
118
123
"" : timelessSample (1 ),
119
124
}),
125
+ "kubelet_container_aligned_compute_resources_failure_count" : gstruct .MatchElements (idFn , gstruct .IgnoreExtras , gstruct.Elements {
126
+ "container::numa_node" : timelessSample (0 ),
127
+ "pod::numa_node" : timelessSample (1 ),
128
+ }),
120
129
"kubelet_topology_manager_admission_duration_ms_count" : gstruct .MatchElements (nodeID , gstruct .IgnoreExtras , gstruct.Elements {
121
130
"" : checkMetricValueGreaterThan (0 ),
122
131
}),
@@ -136,13 +145,18 @@ var _ = SIGDescribe("Topology Manager Metrics", framework.WithSerial(), feature.
136
145
// being [Serial], we can also assume noone else but us is running pods.
137
146
ginkgo .By ("Checking the topologymanager metrics right after the kubelet restart, with pod should be admitted" )
138
147
148
+ idFn := makeCustomPairID ("scope" , "boundary" )
139
149
matchResourceMetrics := gstruct .MatchKeys (gstruct .IgnoreExtras , gstruct.Keys {
140
150
"kubelet_topology_manager_admission_requests_total" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
141
151
"" : timelessSample (1 ),
142
152
}),
143
153
"kubelet_topology_manager_admission_errors_total" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
144
154
"" : timelessSample (0 ),
145
155
}),
156
+ "kubelet_container_aligned_compute_resources_failure_count" : gstruct .MatchElements (idFn , gstruct .IgnoreExtras , gstruct.Elements {
157
+ "container::numa_node" : timelessSample (0 ),
158
+ "pod::numa_node" : timelessSample (0 ),
159
+ }),
146
160
"kubelet_topology_manager_admission_duration_ms_count" : gstruct .MatchElements (nodeID , gstruct .IgnoreExtras , gstruct.Elements {
147
161
"" : checkMetricValueGreaterThan (0 ),
148
162
}),
@@ -162,9 +176,15 @@ var _ = SIGDescribe("Topology Manager Metrics", framework.WithSerial(), feature.
162
176
// being [Serial], we can also assume noone else but us is running pods.
163
177
ginkgo .By ("Checking the cpumanager metrics right after the kubelet restart, with pod should be admitted" )
164
178
179
+ idFn := makeCustomPairID ("scope" , "boundary" )
165
180
matchAlignmentMetrics := gstruct .MatchKeys (gstruct .IgnoreExtras , gstruct.Keys {
166
- "kubelet_container_aligned_compute_resources_count" : gstruct .MatchAllElements (nodeID , gstruct.Elements {
167
- metrics .AlignedNUMANode : timelessSample (1 ),
181
+ "kubelet_container_aligned_compute_resources_count" : gstruct .MatchAllElements (idFn , gstruct.Elements {
182
+ "container::numa_node" : timelessSample (0 ),
183
+ "pod::numa_node" : timelessSample (1 ),
184
+ }),
185
+ "kubelet_container_aligned_compute_resources_failure_count" : gstruct .MatchElements (idFn , gstruct .IgnoreExtras , gstruct.Elements {
186
+ "container::numa_node" : timelessSample (0 ),
187
+ "pod::numa_node" : timelessSample (0 ),
168
188
}),
169
189
})
170
190
0 commit comments