forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce health checks for MonoVertexRollouts (argoproj#19688)
Signed-off-by: Dillen Padhiar <[email protected]>
- Loading branch information
Showing
6 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
resource_customizations/numaplane.numaproj.io/MonoVertexRollout/health.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
local hs = {} | ||
local healthyCondition = {} | ||
|
||
if obj.status ~= nil then | ||
if obj.status.conditions ~= nil then | ||
for i, condition in ipairs(obj.status.conditions) do | ||
if condition.type == "ChildResourcesHealthy" then | ||
healthyCondition = condition | ||
end | ||
end | ||
end | ||
|
||
if obj.metadata.generation == obj.status.observedGeneration then | ||
if (healthyCondition ~= {} and healthyCondition.status == "False" and (obj.metadata.generation == healthyCondition.observedGeneration) and healthyCondition.reason == "MonoVertexFailed") or obj.status.phase == "Failed" then | ||
hs.status = "Degraded" | ||
if obj.status.phase == "Failed" then | ||
hs.message = obj.status.message | ||
else | ||
hs.message = healthyCondition.message | ||
end | ||
return hs | ||
elseif healthyCondition ~= {} and healthyCondition.status == "True" and (obj.metadata.generation == healthyCondition.observedGeneration) and obj.status.phase == "Deployed" then | ||
hs.status = "Healthy" | ||
hs.message = healthyCondition.message | ||
return hs | ||
end | ||
end | ||
end | ||
|
||
hs.status = "Progressing" | ||
hs.message = "Waiting for MonoVertex status" | ||
return hs |
17 changes: 17 additions & 0 deletions
17
resource_customizations/numaplane.numaproj.io/MonoVertexRollout/health_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tests: | ||
- healthStatus: | ||
status: Progressing | ||
message: "Waiting for MonoVertex status" | ||
inputPath: testdata/progressing.yaml | ||
- healthStatus: | ||
status: Healthy | ||
message: "Successful" | ||
inputPath: testdata/healthy.yaml | ||
- healthStatus: | ||
status: Degraded | ||
message: "MonoVertex Failed" | ||
inputPath: testdata/degraded.yaml | ||
- healthStatus: | ||
status: Progressing | ||
message: "Waiting for MonoVertex status" | ||
inputPath: testdata/progressing-reason.yaml |
47 changes: 47 additions & 0 deletions
47
resource_customizations/numaplane.numaproj.io/MonoVertexRollout/testdata/degraded.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: numaplane.numaproj.io/v1alpha1 | ||
kind: MonoVertexRollout | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/last-applied-configuration: > | ||
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"labels":{"argocd.argoproj.io/instance":"demo-app"},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-java/simple-sink:stable"}}},"source":{"transformer":{"container":{"image":"quay.io/numaio/numaflow-rs/source-transformer-now:stable"}},"udsource":{"container":{"image":"quay.io/numaio/numaflow-java/source-simple-source:stable"}}}}}}} | ||
creationTimestamp: '2024-08-21T20:44:18Z' | ||
finalizers: | ||
- numaplane.numaproj.io/numaplane-controller | ||
generation: 1 | ||
labels: | ||
argocd.argoproj.io/instance: demo-app | ||
name: my-monovertex | ||
namespace: example-namespace | ||
resourceVersion: '947414' | ||
uid: a63f377e-1500-437e-9267-579f4a790518 | ||
spec: | ||
monoVertex: | ||
spec: | ||
sink: | ||
udsink: | ||
container: | ||
image: 'bad-image' | ||
source: | ||
transformer: | ||
container: | ||
image: 'quay.io/numaio/numaflow-rs/source-transformer-now:stable' | ||
udsource: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/source-simple-source:stable' | ||
status: | ||
conditions: | ||
- lastTransitionTime: '2024-08-21T20:44:18Z' | ||
message: Successful | ||
observedGeneration: 1 | ||
reason: Successful | ||
status: 'True' | ||
type: ChildResourceDeployed | ||
- lastTransitionTime: '2024-08-22T21:10:23Z' | ||
message: MonoVertex Failed | ||
observedGeneration: 1 | ||
reason: MonoVertexFailed | ||
status: 'False' | ||
type: ChildResourcesHealthy | ||
message: Deployed | ||
observedGeneration: 1 | ||
phase: Deployed |
47 changes: 47 additions & 0 deletions
47
resource_customizations/numaplane.numaproj.io/MonoVertexRollout/testdata/healthy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: numaplane.numaproj.io/v1alpha1 | ||
kind: MonoVertexRollout | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/last-applied-configuration: > | ||
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"labels":{"argocd.argoproj.io/instance":"demo-app"},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-java/simple-sink:stable"}}},"source":{"transformer":{"container":{"image":"quay.io/numaio/numaflow-rs/source-transformer-now:stable"}},"udsource":{"container":{"image":"quay.io/numaio/numaflow-java/source-simple-source:stable"}}}}}}} | ||
creationTimestamp: '2024-08-21T20:44:18Z' | ||
finalizers: | ||
- numaplane.numaproj.io/numaplane-controller | ||
generation: 1 | ||
labels: | ||
argocd.argoproj.io/instance: demo-app | ||
name: my-monovertex | ||
namespace: example-namespace | ||
resourceVersion: '947414' | ||
uid: a63f377e-1500-437e-9267-579f4a790518 | ||
spec: | ||
monoVertex: | ||
spec: | ||
sink: | ||
udsink: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/simple-sink:stable' | ||
source: | ||
transformer: | ||
container: | ||
image: 'quay.io/numaio/numaflow-rs/source-transformer-now:stable' | ||
udsource: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/source-simple-source:stable' | ||
status: | ||
conditions: | ||
- lastTransitionTime: '2024-08-21T20:44:18Z' | ||
message: Successful | ||
observedGeneration: 1 | ||
reason: Successful | ||
status: 'True' | ||
type: ChildResourceDeployed | ||
- lastTransitionTime: '2024-08-22T21:10:23Z' | ||
message: Successful | ||
observedGeneration: 1 | ||
reason: Successful | ||
status: 'True' | ||
type: ChildResourcesHealthy | ||
message: Deployed | ||
observedGeneration: 1 | ||
phase: Deployed |
47 changes: 47 additions & 0 deletions
47
...e_customizations/numaplane.numaproj.io/MonoVertexRollout/testdata/progressing-reason.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: numaplane.numaproj.io/v1alpha1 | ||
kind: MonoVertexRollout | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/last-applied-configuration: > | ||
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"labels":{"argocd.argoproj.io/instance":"demo-app"},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-java/simple-sink:stable"}}},"source":{"transformer":{"container":{"image":"quay.io/numaio/numaflow-rs/source-transformer-now:stable"}},"udsource":{"container":{"image":"quay.io/numaio/numaflow-java/source-simple-source:stable"}}}}}}} | ||
creationTimestamp: '2024-08-21T20:44:18Z' | ||
finalizers: | ||
- numaplane.numaproj.io/numaplane-controller | ||
generation: 1 | ||
labels: | ||
argocd.argoproj.io/instance: demo-app | ||
name: my-monovertex | ||
namespace: example-namespace | ||
resourceVersion: '947414' | ||
uid: a63f377e-1500-437e-9267-579f4a790518 | ||
spec: | ||
monoVertex: | ||
spec: | ||
sink: | ||
udsink: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/simple-sink:stable' | ||
source: | ||
transformer: | ||
container: | ||
image: 'quay.io/numaio/numaflow-rs/source-transformer-now:stable' | ||
udsource: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/source-simple-source:stable' | ||
status: | ||
conditions: | ||
- lastTransitionTime: '2024-08-21T20:44:18Z' | ||
message: Successful | ||
observedGeneration: 1 | ||
reason: Successful | ||
status: 'True' | ||
type: ChildResourceDeployed | ||
- lastTransitionTime: '2024-08-22T21:10:23Z' | ||
message: Progressing | ||
observedGeneration: 1 | ||
reason: Progressing | ||
status: 'False' | ||
type: ChildResourcesHealthy | ||
message: Deployed | ||
observedGeneration: 1 | ||
phase: Deployed |
47 changes: 47 additions & 0 deletions
47
resource_customizations/numaplane.numaproj.io/MonoVertexRollout/testdata/progressing.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: numaplane.numaproj.io/v1alpha1 | ||
kind: MonoVertexRollout | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/last-applied-configuration: > | ||
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"labels":{"argocd.argoproj.io/instance":"demo-app"},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-java/simple-sink:stable"}}},"source":{"transformer":{"container":{"image":"quay.io/numaio/numaflow-rs/source-transformer-now:stable"}},"udsource":{"container":{"image":"quay.io/numaio/numaflow-java/source-simple-source:stable"}}}}}}} | ||
creationTimestamp: '2024-08-21T20:44:18Z' | ||
finalizers: | ||
- numaplane.numaproj.io/numaplane-controller | ||
generation: 2 | ||
labels: | ||
argocd.argoproj.io/instance: demo-app | ||
name: my-monovertex | ||
namespace: example-namespace | ||
resourceVersion: '947414' | ||
uid: a63f377e-1500-437e-9267-579f4a790518 | ||
spec: | ||
monoVertex: | ||
spec: | ||
sink: | ||
udsink: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/simple-sink:stable' | ||
source: | ||
transformer: | ||
container: | ||
image: 'quay.io/numaio/numaflow-rs/source-transformer-now:stable' | ||
udsource: | ||
container: | ||
image: 'quay.io/numaio/numaflow-java/source-simple-source:stable' | ||
status: | ||
conditions: | ||
- lastTransitionTime: '2024-08-21T20:44:18Z' | ||
message: Successful | ||
observedGeneration: 1 | ||
reason: Successful | ||
status: 'True' | ||
type: ChildResourceDeployed | ||
- lastTransitionTime: '2024-08-22T21:10:23Z' | ||
message: Successful | ||
observedGeneration: 1 | ||
reason: Successful | ||
status: 'True' | ||
type: ChildResourcesHealthy | ||
message: Deployed | ||
observedGeneration: 1 | ||
phase: Deployed |