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
feat(kubernetes): add apiVersion field to KubernetesCheck (#2860)
* feat(kubernetes): add apiVersion field to KubernetesCheck
Allows specifying apiVersion to distinguish between resources with the
same Kind but different API groups (e.g., v1/Service vs serving.knative.dev/v1/Service).
When apiVersion is set, the check uses the format 'apiVersion/Kind' to query
resources via GetClientByGroupVersionKind for precise GVK targeting.
Closes#2859
* test(kubernetes): add fixture for apiVersion feature
Tests same Kind (Event) with different apiVersions (v1 vs events.k8s.io/v1).
* chore: use local duty with apiVersion/Kind support
Temporary replace directive for flanksource/duty#1757
* chore(deps): update duty and remove local replace
* make manifests & make resources
Copy file name to clipboardExpand all lines: config/schemas/canary.schema.json
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2929,10 +2929,12 @@
2929
2929
"description": "Relationships defines a way to link the check results to components and configs\nusing lookup expressions."
2930
2930
},
2931
2931
"namespaceSelector": {
2932
-
"$ref": "#/$defs/ResourceSelector"
2932
+
"$ref": "#/$defs/ResourceSelector",
2933
+
"description": "Namespace specifies which namespace(s) to search for resources.\nUse empty ResourceSelector to search in canary's namespace."
2933
2934
},
2934
2935
"resource": {
2935
-
"$ref": "#/$defs/ResourceSelector"
2936
+
"$ref": "#/$defs/ResourceSelector",
2937
+
"description": "Resource specifies which resources to select by name, labels, or field selectors."
2936
2938
},
2937
2939
"connection": {
2938
2940
"type": "string"
@@ -2954,18 +2956,23 @@
2954
2956
"type": "string"
2955
2957
},
2956
2958
"type": "array",
2957
-
"description": "Ignore the specified resources from the fetched resources. Can be a glob pattern."
2959
+
"description": "Ignore specifies resources to exclude from the fetched results.\nValues can be glob patterns (e.g., \"kube-*\", \"*-system\")."
2958
2960
},
2959
2961
"kind": {
2960
-
"type": "string"
2962
+
"type": "string",
2963
+
"description": "Kind is the Kubernetes resource Kind to check (e.g., \"Pod\", \"Deployment\", \"Service\").\nThis is a required field."
2964
+
},
2965
+
"apiVersion": {
2966
+
"type": "string",
2967
+
"description": "APIVersion is the Kubernetes API version for the resource (e.g., \"v1\", \"apps/v1\", \"serving.knative.dev/v1\").\nUsed to distinguish between resources with the same Kind but different API groups."
2961
2968
},
2962
2969
"healthy": {
2963
2970
"type": "boolean",
2964
-
"description": "Fail the check if any resources are unhealthy"
2971
+
"description": "Healthy when true, fails the check if any resources are unhealthy."
2965
2972
},
2966
2973
"ready": {
2967
2974
"type": "boolean",
2968
-
"description": "Fail the check if any resources are not ready"
2975
+
"description": "Ready when true, fails the check if any resources are not ready."
Copy file name to clipboardExpand all lines: config/schemas/component.schema.json
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3225,10 +3225,12 @@
3225
3225
"description": "Relationships defines a way to link the check results to components and configs\nusing lookup expressions."
3226
3226
},
3227
3227
"namespaceSelector": {
3228
-
"$ref": "#/$defs/ResourceSelector"
3228
+
"$ref": "#/$defs/ResourceSelector",
3229
+
"description": "Namespace specifies which namespace(s) to search for resources.\nUse empty ResourceSelector to search in canary's namespace."
3229
3230
},
3230
3231
"resource": {
3231
-
"$ref": "#/$defs/ResourceSelector"
3232
+
"$ref": "#/$defs/ResourceSelector",
3233
+
"description": "Resource specifies which resources to select by name, labels, or field selectors."
3232
3234
},
3233
3235
"connection": {
3234
3236
"type": "string"
@@ -3250,18 +3252,23 @@
3250
3252
"type": "string"
3251
3253
},
3252
3254
"type": "array",
3253
-
"description": "Ignore the specified resources from the fetched resources. Can be a glob pattern."
3255
+
"description": "Ignore specifies resources to exclude from the fetched results.\nValues can be glob patterns (e.g., \"kube-*\", \"*-system\")."
3254
3256
},
3255
3257
"kind": {
3256
-
"type": "string"
3258
+
"type": "string",
3259
+
"description": "Kind is the Kubernetes resource Kind to check (e.g., \"Pod\", \"Deployment\", \"Service\").\nThis is a required field."
3260
+
},
3261
+
"apiVersion": {
3262
+
"type": "string",
3263
+
"description": "APIVersion is the Kubernetes API version for the resource (e.g., \"v1\", \"apps/v1\", \"serving.knative.dev/v1\").\nUsed to distinguish between resources with the same Kind but different API groups."
3257
3264
},
3258
3265
"healthy": {
3259
3266
"type": "boolean",
3260
-
"description": "Fail the check if any resources are unhealthy"
3267
+
"description": "Healthy when true, fails the check if any resources are unhealthy."
3261
3268
},
3262
3269
"ready": {
3263
3270
"type": "boolean",
3264
-
"description": "Fail the check if any resources are not ready"
3271
+
"description": "Ready when true, fails the check if any resources are not ready."
Copy file name to clipboardExpand all lines: config/schemas/health_kubernetes.schema.json
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -234,10 +234,12 @@
234
234
"description": "Relationships defines a way to link the check results to components and configs\nusing lookup expressions."
235
235
},
236
236
"namespaceSelector": {
237
-
"$ref": "#/$defs/ResourceSelector"
237
+
"$ref": "#/$defs/ResourceSelector",
238
+
"description": "Namespace specifies which namespace(s) to search for resources.\nUse empty ResourceSelector to search in canary's namespace."
238
239
},
239
240
"resource": {
240
-
"$ref": "#/$defs/ResourceSelector"
241
+
"$ref": "#/$defs/ResourceSelector",
242
+
"description": "Resource specifies which resources to select by name, labels, or field selectors."
241
243
},
242
244
"connection": {
243
245
"type": "string"
@@ -259,18 +261,23 @@
259
261
"type": "string"
260
262
},
261
263
"type": "array",
262
-
"description": "Ignore the specified resources from the fetched resources. Can be a glob pattern."
264
+
"description": "Ignore specifies resources to exclude from the fetched results.\nValues can be glob patterns (e.g., \"kube-*\", \"*-system\")."
263
265
},
264
266
"kind": {
265
-
"type": "string"
267
+
"type": "string",
268
+
"description": "Kind is the Kubernetes resource Kind to check (e.g., \"Pod\", \"Deployment\", \"Service\").\nThis is a required field."
269
+
},
270
+
"apiVersion": {
271
+
"type": "string",
272
+
"description": "APIVersion is the Kubernetes API version for the resource (e.g., \"v1\", \"apps/v1\", \"serving.knative.dev/v1\").\nUsed to distinguish between resources with the same Kind but different API groups."
266
273
},
267
274
"healthy": {
268
275
"type": "boolean",
269
-
"description": "Fail the check if any resources are unhealthy"
276
+
"description": "Healthy when true, fails the check if any resources are unhealthy."
270
277
},
271
278
"ready": {
272
279
"type": "boolean",
273
-
"description": "Fail the check if any resources are not ready"
280
+
"description": "Ready when true, fails the check if any resources are not ready."
Copy file name to clipboardExpand all lines: config/schemas/topology.schema.json
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3237,10 +3237,12 @@
3237
3237
"description": "Relationships defines a way to link the check results to components and configs\nusing lookup expressions."
3238
3238
},
3239
3239
"namespaceSelector": {
3240
-
"$ref": "#/$defs/ResourceSelector"
3240
+
"$ref": "#/$defs/ResourceSelector",
3241
+
"description": "Namespace specifies which namespace(s) to search for resources.\nUse empty ResourceSelector to search in canary's namespace."
3241
3242
},
3242
3243
"resource": {
3243
-
"$ref": "#/$defs/ResourceSelector"
3244
+
"$ref": "#/$defs/ResourceSelector",
3245
+
"description": "Resource specifies which resources to select by name, labels, or field selectors."
3244
3246
},
3245
3247
"connection": {
3246
3248
"type": "string"
@@ -3262,18 +3264,23 @@
3262
3264
"type": "string"
3263
3265
},
3264
3266
"type": "array",
3265
-
"description": "Ignore the specified resources from the fetched resources. Can be a glob pattern."
3267
+
"description": "Ignore specifies resources to exclude from the fetched results.\nValues can be glob patterns (e.g., \"kube-*\", \"*-system\")."
3266
3268
},
3267
3269
"kind": {
3268
-
"type": "string"
3270
+
"type": "string",
3271
+
"description": "Kind is the Kubernetes resource Kind to check (e.g., \"Pod\", \"Deployment\", \"Service\").\nThis is a required field."
3272
+
},
3273
+
"apiVersion": {
3274
+
"type": "string",
3275
+
"description": "APIVersion is the Kubernetes API version for the resource (e.g., \"v1\", \"apps/v1\", \"serving.knative.dev/v1\").\nUsed to distinguish between resources with the same Kind but different API groups."
3269
3276
},
3270
3277
"healthy": {
3271
3278
"type": "boolean",
3272
-
"description": "Fail the check if any resources are unhealthy"
3279
+
"description": "Healthy when true, fails the check if any resources are unhealthy."
3273
3280
},
3274
3281
"ready": {
3275
3282
"type": "boolean",
3276
-
"description": "Fail the check if any resources are not ready"
3283
+
"description": "Ready when true, fails the check if any resources are not ready."
0 commit comments