You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MON-4036: Add NodeExporterConfig to ClusterMonitoring API
Add configuration for the node-exporter agent that runs as a
DaemonSet in openshift-monitoring, collecting hardware and
OS-level metrics from every node in the cluster.
Signed-off-by: Daniel Mellado <dmellado@fedoraproject.org>
- name: Should reject NodeExporterConfig with limit less than request
1267
+
initial: |
1268
+
apiVersion: config.openshift.io/v1alpha1
1269
+
kind: ClusterMonitoring
1270
+
spec:
1271
+
nodeExporterConfig:
1272
+
resources:
1273
+
- name: "cpu"
1274
+
request: "500m"
1275
+
limit: "200m"
1276
+
expectedError: 'spec.nodeExporterConfig.resources[0]: Invalid value: "object": limit must be greater than or equal to request'
1277
+
- name: Should reject NodeExporterConfig with empty resources array
1278
+
initial: |
1279
+
apiVersion: config.openshift.io/v1alpha1
1280
+
kind: ClusterMonitoring
1281
+
spec:
1282
+
nodeExporterConfig:
1283
+
resources: []
1284
+
expectedError: 'spec.nodeExporterConfig.resources: Invalid value: 0: spec.nodeExporterConfig.resources in body should have at least 1 items'
1285
+
- name: Should reject NodeExporterConfig with empty collectors object
1286
+
initial: |
1287
+
apiVersion: config.openshift.io/v1alpha1
1288
+
kind: ClusterMonitoring
1289
+
spec:
1290
+
nodeExporterConfig:
1291
+
collectors: {}
1292
+
expectedError: 'spec.nodeExporterConfig.collectors: Invalid value: 0: spec.nodeExporterConfig.collectors in body should have at least 1 properties'
1293
+
- name: Should accept NodeExporterConfig with empty ignoredNetworkDevices list
1294
+
initial: |
1295
+
apiVersion: config.openshift.io/v1alpha1
1296
+
kind: ClusterMonitoring
1297
+
spec:
1298
+
nodeExporterConfig:
1299
+
ignoredNetworkDevices: []
1300
+
expected: |
1301
+
apiVersion: config.openshift.io/v1alpha1
1302
+
kind: ClusterMonitoring
1303
+
spec:
1304
+
nodeExporterConfig:
1305
+
ignoredNetworkDevices: []
1306
+
- name: Should reject NodeExporterConfig with maxProcs below minimum
1307
+
initial: |
1308
+
apiVersion: config.openshift.io/v1alpha1
1309
+
kind: ClusterMonitoring
1310
+
spec:
1311
+
nodeExporterConfig:
1312
+
maxProcs: -1
1313
+
expectedError: 'spec.nodeExporterConfig.maxProcs'
1314
+
- name: Should reject NodeExporterConfig with maxProcs exceeding maximum
1315
+
initial: |
1316
+
apiVersion: config.openshift.io/v1alpha1
1317
+
kind: ClusterMonitoring
1318
+
spec:
1319
+
nodeExporterConfig:
1320
+
maxProcs: 1025
1321
+
expectedError: 'spec.nodeExporterConfig.maxProcs'
1322
+
- name: Should reject netClass with collect set when collector is DoNotCollect
1323
+
initial: |
1324
+
apiVersion: config.openshift.io/v1alpha1
1325
+
kind: ClusterMonitoring
1326
+
spec:
1327
+
nodeExporterConfig:
1328
+
collectors:
1329
+
netClass:
1330
+
collectionPolicy: DoNotCollect
1331
+
collect:
1332
+
statsGatherer: Netlink
1333
+
expectedError: 'collect configuration is forbidden when collectionPolicy is DoNotCollect'
1334
+
- name: Should accept netClass DoNotCollect without collect
1335
+
initial: |
1336
+
apiVersion: config.openshift.io/v1alpha1
1337
+
kind: ClusterMonitoring
1338
+
spec:
1339
+
nodeExporterConfig:
1340
+
collectors:
1341
+
netClass:
1342
+
collectionPolicy: DoNotCollect
1343
+
expected: |
1344
+
apiVersion: config.openshift.io/v1alpha1
1345
+
kind: ClusterMonitoring
1346
+
spec:
1347
+
nodeExporterConfig:
1348
+
collectors:
1349
+
netClass:
1350
+
collectionPolicy: DoNotCollect
1351
+
- name: Should reject systemd with collect set when collector is DoNotCollect
1352
+
initial: |
1353
+
apiVersion: config.openshift.io/v1alpha1
1354
+
kind: ClusterMonitoring
1355
+
spec:
1356
+
nodeExporterConfig:
1357
+
collectors:
1358
+
systemd:
1359
+
collectionPolicy: DoNotCollect
1360
+
collect:
1361
+
units:
1362
+
- "kubelet.service"
1363
+
expectedError: 'collect configuration is forbidden when collectionPolicy is DoNotCollect'
1364
+
- name: Should accept systemd DoNotCollect without collect
1365
+
initial: |
1366
+
apiVersion: config.openshift.io/v1alpha1
1367
+
kind: ClusterMonitoring
1368
+
spec:
1369
+
nodeExporterConfig:
1370
+
collectors:
1371
+
systemd:
1372
+
collectionPolicy: DoNotCollect
1373
+
expected: |
1374
+
apiVersion: config.openshift.io/v1alpha1
1375
+
kind: ClusterMonitoring
1376
+
spec:
1377
+
nodeExporterConfig:
1378
+
collectors:
1379
+
systemd:
1380
+
collectionPolicy: DoNotCollect
1381
+
- name: Should reject NodeExporterConfig with empty nodeSelector
1382
+
initial: |
1383
+
apiVersion: config.openshift.io/v1alpha1
1384
+
kind: ClusterMonitoring
1385
+
spec:
1386
+
nodeExporterConfig:
1387
+
nodeSelector: {}
1388
+
expectedError: 'spec.nodeExporterConfig.nodeSelector: Invalid value: 0: spec.nodeExporterConfig.nodeSelector in body should have at least 1 properties'
1389
+
- name: Should reject NodeExporterConfig with too many nodeSelector entries
1390
+
initial: |
1391
+
apiVersion: config.openshift.io/v1alpha1
1392
+
kind: ClusterMonitoring
1393
+
spec:
1394
+
nodeExporterConfig:
1395
+
nodeSelector:
1396
+
key1: val1
1397
+
key2: val2
1398
+
key3: val3
1399
+
key4: val4
1400
+
key5: val5
1401
+
key6: val6
1402
+
key7: val7
1403
+
key8: val8
1404
+
key9: val9
1405
+
key10: val10
1406
+
key11: val11
1407
+
expectedError: 'spec.nodeExporterConfig.nodeSelector: Too many: 11: must have at most 10 items'
1408
+
- name: Should reject NodeExporterConfig with empty tolerations array
1409
+
initial: |
1410
+
apiVersion: config.openshift.io/v1alpha1
1411
+
kind: ClusterMonitoring
1412
+
spec:
1413
+
nodeExporterConfig:
1414
+
tolerations: []
1415
+
expectedError: 'spec.nodeExporterConfig.tolerations: Invalid value: 0: spec.nodeExporterConfig.tolerations in body should have at least 1 items'
1416
+
- name: Should reject NodeExporterConfig with too many tolerations
1417
+
initial: |
1418
+
apiVersion: config.openshift.io/v1alpha1
1419
+
kind: ClusterMonitoring
1420
+
spec:
1421
+
nodeExporterConfig:
1422
+
tolerations:
1423
+
- key: "key1"
1424
+
operator: "Exists"
1425
+
- key: "key2"
1426
+
operator: "Exists"
1427
+
- key: "key3"
1428
+
operator: "Exists"
1429
+
- key: "key4"
1430
+
operator: "Exists"
1431
+
- key: "key5"
1432
+
operator: "Exists"
1433
+
- key: "key6"
1434
+
operator: "Exists"
1435
+
- key: "key7"
1436
+
operator: "Exists"
1437
+
- key: "key8"
1438
+
operator: "Exists"
1439
+
- key: "key9"
1440
+
operator: "Exists"
1441
+
- key: "key10"
1442
+
operator: "Exists"
1443
+
- key: "key11"
1444
+
operator: "Exists"
1445
+
expectedError: 'spec.nodeExporterConfig.tolerations: Too many: 11: must have at most 10 items'
1446
+
- name: Should reject systemd collect with empty object
0 commit comments