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
994
+
initial: |
995
+
apiVersion: config.openshift.io/v1alpha1
996
+
kind: ClusterMonitoring
997
+
spec:
998
+
nodeExporterConfig:
999
+
resources:
1000
+
- name: "cpu"
1001
+
request: "500m"
1002
+
limit: "200m"
1003
+
expectedError: 'spec.nodeExporterConfig.resources[0]: Invalid value: "object": limit must be greater than or equal to request'
1004
+
- name: Should reject NodeExporterConfig with empty resources array
1005
+
initial: |
1006
+
apiVersion: config.openshift.io/v1alpha1
1007
+
kind: ClusterMonitoring
1008
+
spec:
1009
+
nodeExporterConfig:
1010
+
resources: []
1011
+
expectedError: 'spec.nodeExporterConfig.resources: Invalid value: 0: spec.nodeExporterConfig.resources in body should have at least 1 items'
1012
+
- name: Should reject NodeExporterConfig with empty collectors object
1013
+
initial: |
1014
+
apiVersion: config.openshift.io/v1alpha1
1015
+
kind: ClusterMonitoring
1016
+
spec:
1017
+
nodeExporterConfig:
1018
+
collectors: {}
1019
+
expectedError: 'spec.nodeExporterConfig.collectors: Invalid value: 0: spec.nodeExporterConfig.collectors in body should have at least 1 properties'
1020
+
- name: Should accept NodeExporterConfig with empty ignoredNetworkDevices list
1021
+
initial: |
1022
+
apiVersion: config.openshift.io/v1alpha1
1023
+
kind: ClusterMonitoring
1024
+
spec:
1025
+
nodeExporterConfig:
1026
+
ignoredNetworkDevices: []
1027
+
expected: |
1028
+
apiVersion: config.openshift.io/v1alpha1
1029
+
kind: ClusterMonitoring
1030
+
spec:
1031
+
nodeExporterConfig:
1032
+
ignoredNetworkDevices: []
1033
+
- name: Should reject NodeExporterConfig with maxProcs below minimum
1034
+
initial: |
1035
+
apiVersion: config.openshift.io/v1alpha1
1036
+
kind: ClusterMonitoring
1037
+
spec:
1038
+
nodeExporterConfig:
1039
+
maxProcs: -1
1040
+
expectedError: 'spec.nodeExporterConfig.maxProcs'
1041
+
- name: Should reject NodeExporterConfig with maxProcs exceeding maximum
1042
+
initial: |
1043
+
apiVersion: config.openshift.io/v1alpha1
1044
+
kind: ClusterMonitoring
1045
+
spec:
1046
+
nodeExporterConfig:
1047
+
maxProcs: 1025
1048
+
expectedError: 'spec.nodeExporterConfig.maxProcs'
1049
+
- name: Should reject netClass with statsGatherer set when collector is DoNotCollect
1050
+
initial: |
1051
+
apiVersion: config.openshift.io/v1alpha1
1052
+
kind: ClusterMonitoring
1053
+
spec:
1054
+
nodeExporterConfig:
1055
+
collectors:
1056
+
netClass:
1057
+
collectionPolicy: DoNotCollect
1058
+
statsGatherer: Netlink
1059
+
expectedError: 'statsGatherer can only be specified when the netclass collector collectionPolicy is Collect'
1060
+
- name: Should accept netClass DoNotCollect without statsGatherer
1061
+
initial: |
1062
+
apiVersion: config.openshift.io/v1alpha1
1063
+
kind: ClusterMonitoring
1064
+
spec:
1065
+
nodeExporterConfig:
1066
+
collectors:
1067
+
netClass:
1068
+
collectionPolicy: DoNotCollect
1069
+
expected: |
1070
+
apiVersion: config.openshift.io/v1alpha1
1071
+
kind: ClusterMonitoring
1072
+
spec:
1073
+
nodeExporterConfig:
1074
+
collectors:
1075
+
netClass:
1076
+
collectionPolicy: DoNotCollect
1077
+
- name: Should reject systemd with units set when collector is DoNotCollect
1078
+
initial: |
1079
+
apiVersion: config.openshift.io/v1alpha1
1080
+
kind: ClusterMonitoring
1081
+
spec:
1082
+
nodeExporterConfig:
1083
+
collectors:
1084
+
systemd:
1085
+
collectionPolicy: DoNotCollect
1086
+
units:
1087
+
- "kubelet.service"
1088
+
expectedError: 'units can only be specified when the systemd collector collectionPolicy is Collect'
1089
+
- name: Should accept systemd DoNotCollect without units
1090
+
initial: |
1091
+
apiVersion: config.openshift.io/v1alpha1
1092
+
kind: ClusterMonitoring
1093
+
spec:
1094
+
nodeExporterConfig:
1095
+
collectors:
1096
+
systemd:
1097
+
collectionPolicy: DoNotCollect
1098
+
expected: |
1099
+
apiVersion: config.openshift.io/v1alpha1
1100
+
kind: ClusterMonitoring
1101
+
spec:
1102
+
nodeExporterConfig:
1103
+
collectors:
1104
+
systemd:
1105
+
collectionPolicy: DoNotCollect
1106
+
- name: Should reject NodeExporterConfig with empty nodeSelector
1107
+
initial: |
1108
+
apiVersion: config.openshift.io/v1alpha1
1109
+
kind: ClusterMonitoring
1110
+
spec:
1111
+
nodeExporterConfig:
1112
+
nodeSelector: {}
1113
+
expectedError: 'spec.nodeExporterConfig.nodeSelector: Invalid value: 0: spec.nodeExporterConfig.nodeSelector in body should have at least 1 properties'
1114
+
- name: Should reject NodeExporterConfig with too many nodeSelector entries
1115
+
initial: |
1116
+
apiVersion: config.openshift.io/v1alpha1
1117
+
kind: ClusterMonitoring
1118
+
spec:
1119
+
nodeExporterConfig:
1120
+
nodeSelector:
1121
+
key1: val1
1122
+
key2: val2
1123
+
key3: val3
1124
+
key4: val4
1125
+
key5: val5
1126
+
key6: val6
1127
+
key7: val7
1128
+
key8: val8
1129
+
key9: val9
1130
+
key10: val10
1131
+
key11: val11
1132
+
expectedError: 'spec.nodeExporterConfig.nodeSelector: Too many: 11: must have at most 10 items'
1133
+
- name: Should reject NodeExporterConfig with empty tolerations array
1134
+
initial: |
1135
+
apiVersion: config.openshift.io/v1alpha1
1136
+
kind: ClusterMonitoring
1137
+
spec:
1138
+
nodeExporterConfig:
1139
+
tolerations: []
1140
+
expectedError: 'spec.nodeExporterConfig.tolerations: Invalid value: 0: spec.nodeExporterConfig.tolerations in body should have at least 1 items'
1141
+
- name: Should reject NodeExporterConfig with too many tolerations
1142
+
initial: |
1143
+
apiVersion: config.openshift.io/v1alpha1
1144
+
kind: ClusterMonitoring
1145
+
spec:
1146
+
nodeExporterConfig:
1147
+
tolerations:
1148
+
- key: "key1"
1149
+
operator: "Exists"
1150
+
- key: "key2"
1151
+
operator: "Exists"
1152
+
- key: "key3"
1153
+
operator: "Exists"
1154
+
- key: "key4"
1155
+
operator: "Exists"
1156
+
- key: "key5"
1157
+
operator: "Exists"
1158
+
- key: "key6"
1159
+
operator: "Exists"
1160
+
- key: "key7"
1161
+
operator: "Exists"
1162
+
- key: "key8"
1163
+
operator: "Exists"
1164
+
- key: "key9"
1165
+
operator: "Exists"
1166
+
- key: "key10"
1167
+
operator: "Exists"
1168
+
- key: "key11"
1169
+
operator: "Exists"
1170
+
expectedError: 'spec.nodeExporterConfig.tolerations: Too many: 11: must have at most 10 items'
0 commit comments