Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(health): Added Humio Operator Healthchecks (#11628)
* Added Humio Operator Healthchecks Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com> * Retrigger CI pipeline Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com> * Removed duplicate if statement from HumioView Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com> * Add HumioCluster Health Check Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com> --------- Signed-off-by: togie6 <22466611+togie6@users.noreply.github.com> Co-authored-by: pasha-codefresh <pavel@codefresh.io>
- Loading branch information
1 parent
9bc9ff9
commit 1cd6fca
Showing
52 changed files
with
1,428 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
resource_customizations/core.humio.com/HumioAction/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,30 @@ | ||
hs = { | ||
status = "Progressing", | ||
message = "Update in progress" | ||
} | ||
if obj.status ~= nil then | ||
if obj.status.state ~= nil then | ||
if obj.status.state == "Exists" then | ||
hs.status = "Healthy" | ||
hs.message = "Component state: Exists." | ||
end | ||
if obj.status.state == "NotFound" then | ||
hs.status = "Missing" | ||
hs.message = "Component state: NotFound." | ||
end | ||
if obj.status.state == "ConfigError" then | ||
hs.status = "Degraded" | ||
hs.message = "Component state: ConfigError." | ||
end | ||
if obj.status.state == "Unknown" then | ||
hs.status = "Unknown" | ||
hs.message = "Component state: Unknown." | ||
end | ||
if obj.status.state == "Unknown" then | ||
hs.status = "Unknown" | ||
hs.message = "Component state: Unknown." | ||
end | ||
end | ||
return hs | ||
end | ||
return hs |
21 changes: 21 additions & 0 deletions
21
resource_customizations/core.humio.com/HumioAction/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,21 @@ | ||
tests: | ||
- healthStatus: | ||
status: Healthy | ||
message: "Component state: Exists." | ||
inputPath: testdata/healthy.yaml | ||
- healthStatus: | ||
status: Missing | ||
message: "Component state: NotFound." | ||
inputPath: testdata/notfound.yaml | ||
- healthStatus: | ||
status: Degraded | ||
message: "Component state: ConfigError." | ||
inputPath: testdata/configerror.yaml | ||
- healthStatus: | ||
status: Unknown | ||
message: "Component state: Unknown." | ||
inputPath: testdata/unknown.yaml | ||
- healthStatus: | ||
status: Progressing | ||
message: "Update in progress" | ||
inputPath: testdata/progressing.yaml |
23 changes: 23 additions & 0 deletions
23
resource_customizations/core.humio.com/HumioAction/testdata/configerror.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,23 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAction | ||
metadata: | ||
annotations: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
generation: 1 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: test-action-1 | ||
namespace: humio | ||
resourceVersion: '10768054' | ||
uid: f339ddf1-3b3e-49e0-80cc-7f583dce532e | ||
spec: | ||
humioRepositoryProperties: | ||
ingestTokenSource: | ||
secretKeyRef: | ||
key: test-token | ||
name: token | ||
managedClusterName: example-humiocluster | ||
name: trigger_action | ||
viewName: example-1 | ||
status: | ||
state: ConfigError |
23 changes: 23 additions & 0 deletions
23
resource_customizations/core.humio.com/HumioAction/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,23 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAction | ||
metadata: | ||
annotations: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
generation: 1 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: test-action-1 | ||
namespace: humio | ||
resourceVersion: '10768054' | ||
uid: f339ddf1-3b3e-49e0-80cc-7f583dce532e | ||
spec: | ||
humioRepositoryProperties: | ||
ingestTokenSource: | ||
secretKeyRef: | ||
key: test-token | ||
name: token | ||
managedClusterName: example-humiocluster | ||
name: trigger_action | ||
viewName: example-1 | ||
status: | ||
state: Exists |
23 changes: 23 additions & 0 deletions
23
resource_customizations/core.humio.com/HumioAction/testdata/notfound.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,23 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAction | ||
metadata: | ||
annotations: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
generation: 1 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: test-action-1 | ||
namespace: humio | ||
resourceVersion: '10768054' | ||
uid: f339ddf1-3b3e-49e0-80cc-7f583dce532e | ||
spec: | ||
humioRepositoryProperties: | ||
ingestTokenSource: | ||
secretKeyRef: | ||
key: test-token | ||
name: token | ||
managedClusterName: example-humiocluster | ||
name: trigger_action | ||
viewName: example-1 | ||
status: | ||
state: NotFound |
21 changes: 21 additions & 0 deletions
21
resource_customizations/core.humio.com/HumioAction/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,21 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAction | ||
metadata: | ||
annotations: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
generation: 1 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: test-action-1 | ||
namespace: humio | ||
resourceVersion: '10768054' | ||
uid: f339ddf1-3b3e-49e0-80cc-7f583dce532e | ||
spec: | ||
humioRepositoryProperties: | ||
ingestTokenSource: | ||
secretKeyRef: | ||
key: test-token | ||
name: token | ||
managedClusterName: example-humiocluster | ||
name: trigger_action | ||
viewName: example-1 |
23 changes: 23 additions & 0 deletions
23
resource_customizations/core.humio.com/HumioAction/testdata/unknown.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,23 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAction | ||
metadata: | ||
annotations: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
generation: 1 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: test-action-1 | ||
namespace: humio | ||
resourceVersion: '10768054' | ||
uid: f339ddf1-3b3e-49e0-80cc-7f583dce532e | ||
spec: | ||
humioRepositoryProperties: | ||
ingestTokenSource: | ||
secretKeyRef: | ||
key: test-token | ||
name: token | ||
managedClusterName: example-humiocluster | ||
name: trigger_action | ||
viewName: example-1 | ||
status: | ||
state: Unknown |
30 changes: 30 additions & 0 deletions
30
resource_customizations/core.humio.com/HumioAlert/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,30 @@ | ||
hs = { | ||
status = "Progressing", | ||
message = "Update in progress" | ||
} | ||
if obj.status ~= nil then | ||
if obj.status.state ~= nil then | ||
if obj.status.state == "Exists" then | ||
hs.status = "Healthy" | ||
hs.message = "Component state: Exists." | ||
end | ||
if obj.status.state == "NotFound" then | ||
hs.status = "Missing" | ||
hs.message = "Component state: NotFound." | ||
end | ||
if obj.status.state == "ConfigError" then | ||
hs.status = "Degraded" | ||
hs.message = "Component state: ConfigError." | ||
end | ||
if obj.status.state == "Unknown" then | ||
hs.status = "Unknown" | ||
hs.message = "Component state: Unknown." | ||
end | ||
if obj.status.state == "Unknown" then | ||
hs.status = "Unknown" | ||
hs.message = "Component state: Unknown." | ||
end | ||
end | ||
return hs | ||
end | ||
return hs |
21 changes: 21 additions & 0 deletions
21
resource_customizations/core.humio.com/HumioAlert/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,21 @@ | ||
tests: | ||
- healthStatus: | ||
status: Healthy | ||
message: "Component state: Exists." | ||
inputPath: testdata/healthy.yaml | ||
- healthStatus: | ||
status: Missing | ||
message: "Component state: NotFound." | ||
inputPath: testdata/notfound.yaml | ||
- healthStatus: | ||
status: Degraded | ||
message: "Component state: ConfigError." | ||
inputPath: testdata/configerror.yaml | ||
- healthStatus: | ||
status: Unknown | ||
message: "Component state: Unknown." | ||
inputPath: testdata/unknown.yaml | ||
- healthStatus: | ||
status: Progressing | ||
message: "Update in progress" | ||
inputPath: testdata/progressing.yaml |
29 changes: 29 additions & 0 deletions
29
resource_customizations/core.humio.com/HumioAlert/testdata/configerror.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,29 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAlert | ||
metadata: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
finalizers: | ||
- core.humio.com/finalizer | ||
generation: 3 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: example-alert-1 | ||
namespace: humio | ||
resourceVersion: '10768150' | ||
uid: eb138512-0661-47c1-a056-0e53f3b5fa1f | ||
spec: | ||
actions: | ||
- move-to-alerts | ||
description: Error counts | ||
labels: | ||
- test-label | ||
managedClusterName: example-humiocluster | ||
name: example-alert | ||
query: | ||
queryString: '#repo = humio | error = true | count() | _count > 0' | ||
start: 24h | ||
silenced: false | ||
throttleTimeMillis: 60000 | ||
viewName: example-view | ||
status: | ||
state: ConfigError |
29 changes: 29 additions & 0 deletions
29
resource_customizations/core.humio.com/HumioAlert/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,29 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAlert | ||
metadata: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
finalizers: | ||
- core.humio.com/finalizer | ||
generation: 3 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: example-alert-1 | ||
namespace: humio | ||
resourceVersion: '10768150' | ||
uid: eb138512-0661-47c1-a056-0e53f3b5fa1f | ||
spec: | ||
actions: | ||
- move-to-alerts | ||
description: Error counts | ||
labels: | ||
- test-label | ||
managedClusterName: example-humiocluster | ||
name: example-alert | ||
query: | ||
queryString: '#repo = humio | error = true | count() | _count > 0' | ||
start: 24h | ||
silenced: false | ||
throttleTimeMillis: 60000 | ||
viewName: example-view | ||
status: | ||
state: Exists |
29 changes: 29 additions & 0 deletions
29
resource_customizations/core.humio.com/HumioAlert/testdata/notfound.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,29 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAlert | ||
metadata: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
finalizers: | ||
- core.humio.com/finalizer | ||
generation: 3 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: example-alert-1 | ||
namespace: humio | ||
resourceVersion: '10768150' | ||
uid: eb138512-0661-47c1-a056-0e53f3b5fa1f | ||
spec: | ||
actions: | ||
- move-to-alerts | ||
description: Error counts | ||
labels: | ||
- test-label | ||
managedClusterName: example-humiocluster | ||
name: example-alert | ||
query: | ||
queryString: '#repo = humio | error = true | count() | _count > 0' | ||
start: 24h | ||
silenced: false | ||
throttleTimeMillis: 60000 | ||
viewName: example-view | ||
status: | ||
state: NotFound |
27 changes: 27 additions & 0 deletions
27
resource_customizations/core.humio.com/HumioAlert/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,27 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAlert | ||
metadata: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
finalizers: | ||
- core.humio.com/finalizer | ||
generation: 3 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: example-alert-1 | ||
namespace: humio | ||
resourceVersion: '10768150' | ||
uid: eb138512-0661-47c1-a056-0e53f3b5fa1f | ||
spec: | ||
actions: | ||
- move-to-alerts | ||
description: Error counts | ||
labels: | ||
- test-label | ||
managedClusterName: example-humiocluster | ||
name: example-alert | ||
query: | ||
queryString: '#repo = humio | error = true | count() | _count > 0' | ||
start: 24h | ||
silenced: false | ||
throttleTimeMillis: 60000 | ||
viewName: example-view |
29 changes: 29 additions & 0 deletions
29
resource_customizations/core.humio.com/HumioAlert/testdata/unknown.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,29 @@ | ||
apiVersion: core.humio.com/v1alpha1 | ||
kind: HumioAlert | ||
metadata: | ||
creationTimestamp: '2022-12-08T02:03:07Z' | ||
finalizers: | ||
- core.humio.com/finalizer | ||
generation: 3 | ||
labels: | ||
app.kubernetes.io/instance: humio-deploy | ||
name: example-alert-1 | ||
namespace: humio | ||
resourceVersion: '10768150' | ||
uid: eb138512-0661-47c1-a056-0e53f3b5fa1f | ||
spec: | ||
actions: | ||
- move-to-alerts | ||
description: Error counts | ||
labels: | ||
- test-label | ||
managedClusterName: example-humiocluster | ||
name: example-alert | ||
query: | ||
queryString: '#repo = humio | error = true | count() | _count > 0' | ||
start: 24h | ||
silenced: false | ||
throttleTimeMillis: 60000 | ||
viewName: example-view | ||
status: | ||
state: Unknown |
Oops, something went wrong.