mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
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>
This commit is contained in:
@@ -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
|
||||
@@ -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
resource_customizations/core.humio.com/HumioAction/testdata/configerror.yaml
vendored
Normal file
23
resource_customizations/core.humio.com/HumioAction/testdata/configerror.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAction/testdata/healthy.yaml
vendored
Normal file
23
resource_customizations/core.humio.com/HumioAction/testdata/healthy.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAction/testdata/notfound.yaml
vendored
Normal file
23
resource_customizations/core.humio.com/HumioAction/testdata/notfound.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAction/testdata/progressing.yaml
vendored
Normal file
21
resource_customizations/core.humio.com/HumioAction/testdata/progressing.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAction/testdata/unknown.yaml
vendored
Normal file
23
resource_customizations/core.humio.com/HumioAction/testdata/unknown.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAlert/health.lua
Normal file
30
resource_customizations/core.humio.com/HumioAlert/health.lua
Normal file
@@ -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
|
||||
@@ -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
resource_customizations/core.humio.com/HumioAlert/testdata/configerror.yaml
vendored
Normal file
29
resource_customizations/core.humio.com/HumioAlert/testdata/configerror.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAlert/testdata/healthy.yaml
vendored
Normal file
29
resource_customizations/core.humio.com/HumioAlert/testdata/healthy.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAlert/testdata/notfound.yaml
vendored
Normal file
29
resource_customizations/core.humio.com/HumioAlert/testdata/notfound.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAlert/testdata/progressing.yaml
vendored
Normal file
27
resource_customizations/core.humio.com/HumioAlert/testdata/progressing.yaml
vendored
Normal file
@@ -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
resource_customizations/core.humio.com/HumioAlert/testdata/unknown.yaml
vendored
Normal file
29
resource_customizations/core.humio.com/HumioAlert/testdata/unknown.yaml
vendored
Normal file
@@ -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
|
||||
@@ -0,0 +1,67 @@
|
||||
|
||||
hs = {
|
||||
status = "Progressing",
|
||||
message = "Update in progress"
|
||||
}
|
||||
|
||||
if obj.status == nil then
|
||||
hs.status= "Progressing"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
end
|
||||
end
|
||||
|
||||
if obj.status ~= nil then
|
||||
if obj.status.state ~= nil then
|
||||
if obj.status.state == "Running" then
|
||||
hs.status = "Healthy"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
else
|
||||
hs.message = "Cluster is in a healthy running state"
|
||||
end
|
||||
end
|
||||
if obj.status.state == "Restarting" then
|
||||
hs.status = "Progressing"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
else
|
||||
hs.message = "Cluster pods are being restarted"
|
||||
end
|
||||
end
|
||||
if obj.status.state == "Upgrading" then
|
||||
hs.status = "Progressing"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
else
|
||||
hs.message = "Cluster pods are being upgraded"
|
||||
end
|
||||
end
|
||||
if obj.status.state == "ConfigError" then
|
||||
hs.status = "Degraded"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
else
|
||||
hs.message = "User-provided cluster specification resulted in a configuration error"
|
||||
end
|
||||
end
|
||||
if obj.status.state == "Pending" then
|
||||
hs.status = "Progressing"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
else
|
||||
hs.message = "Cluster is waiting on resources to be provisioned"
|
||||
end
|
||||
end
|
||||
if obj.status.state == "Unknown" then
|
||||
hs.status = "Unknown"
|
||||
if obj.status.message ~= nil then
|
||||
hs.message = obj.status.message
|
||||
else
|
||||
hs.message = "Component state: Unknown."
|
||||
end
|
||||
end
|
||||
end
|
||||
return hs
|
||||
end
|
||||
return hs
|
||||
@@ -0,0 +1,29 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "Cluster is in a healthy running state"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Cluster pods are being restarted"
|
||||
inputPath: testdata/restarting.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Cluster pods are being upgraded"
|
||||
inputPath: testdata/upgrading.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Cluster is waiting on resources to be provisioned"
|
||||
inputPath: testdata/pending.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: 'Secret "example-humiocluster-license" not found'
|
||||
inputPath: testdata/configerror_custom.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: 'User-provided cluster specification resulted in a configuration error'
|
||||
inputPath: testdata/configerror.yaml
|
||||
- healthStatus:
|
||||
status: Unknown
|
||||
message: "Component state: Unknown."
|
||||
inputPath: testdata/unknown.yaml
|
||||
30
resource_customizations/core.humio.com/HumioCluster/testdata/configerror.yaml
vendored
Normal file
30
resource_customizations/core.humio.com/HumioCluster/testdata/configerror.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
state: ConfigError
|
||||
33
resource_customizations/core.humio.com/HumioCluster/testdata/configerror_custom.yaml
vendored
Normal file
33
resource_customizations/core.humio.com/HumioCluster/testdata/configerror_custom.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
licenseStatus: {}
|
||||
message: Secret "example-humiocluster-license" not found
|
||||
observedGeneration: '1'
|
||||
state: ConfigError
|
||||
30
resource_customizations/core.humio.com/HumioCluster/testdata/healthy.yaml
vendored
Normal file
30
resource_customizations/core.humio.com/HumioCluster/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
state: Running
|
||||
30
resource_customizations/core.humio.com/HumioCluster/testdata/pending.yaml
vendored
Normal file
30
resource_customizations/core.humio.com/HumioCluster/testdata/pending.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
state: Pending
|
||||
28
resource_customizations/core.humio.com/HumioCluster/testdata/progressing.yaml
vendored
Normal file
28
resource_customizations/core.humio.com/HumioCluster/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
30
resource_customizations/core.humio.com/HumioCluster/testdata/restarting.yaml
vendored
Normal file
30
resource_customizations/core.humio.com/HumioCluster/testdata/restarting.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
state: Restarting
|
||||
33
resource_customizations/core.humio.com/HumioCluster/testdata/unknown.yaml
vendored
Normal file
33
resource_customizations/core.humio.com/HumioCluster/testdata/unknown.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
state: Unknown
|
||||
|
||||
|
||||
|
||||
33
resource_customizations/core.humio.com/HumioCluster/testdata/upgrading.yaml
vendored
Normal file
33
resource_customizations/core.humio.com/HumioCluster/testdata/upgrading.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioCluster
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-09T05:48:10Z'
|
||||
generation: 1
|
||||
labels:
|
||||
app: humio
|
||||
app.kubernetes.io/instance: humio-cluster-failtest
|
||||
name: example-humiocluster
|
||||
namespace: failtes
|
||||
spec:
|
||||
dataVolumePersistentVolumeClaimSpecTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: longhorn
|
||||
digestPartitionsCount: 2
|
||||
image: 'humio/humio-core:latest'
|
||||
license:
|
||||
secretKeyRef:
|
||||
key: data
|
||||
name: example-humiocluster-license
|
||||
storagePartitionsCount: 2
|
||||
targetReplicationFactor: 1
|
||||
tls:
|
||||
enabled: false
|
||||
status:
|
||||
state: Upgrading
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/configerror.yaml
vendored
Normal file
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/configerror.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioIngestToken
|
||||
metadata:
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: test-token-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768058'
|
||||
uid: f0a51e3d-8b64-483c-99fa-d7184a840707
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: test-token
|
||||
parserName: json
|
||||
repositoryName: example-1
|
||||
tokenSecretName: example-test-token-1
|
||||
status:
|
||||
state: ConfigError
|
||||
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/healthy.yaml
vendored
Normal file
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioIngestToken
|
||||
metadata:
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: test-token-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768058'
|
||||
uid: f0a51e3d-8b64-483c-99fa-d7184a840707
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: test-token
|
||||
parserName: json
|
||||
repositoryName: example-1
|
||||
tokenSecretName: example-test-token-1
|
||||
status:
|
||||
state: Exists
|
||||
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/notfound.yaml
vendored
Normal file
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/notfound.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioIngestToken
|
||||
metadata:
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: test-token-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768058'
|
||||
uid: f0a51e3d-8b64-483c-99fa-d7184a840707
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: test-token
|
||||
parserName: json
|
||||
repositoryName: example-1
|
||||
tokenSecretName: example-test-token-1
|
||||
status:
|
||||
state: NotFound
|
||||
18
resource_customizations/core.humio.com/HumioIngestToken/testdata/progressing.yaml
vendored
Normal file
18
resource_customizations/core.humio.com/HumioIngestToken/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioIngestToken
|
||||
metadata:
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: test-token-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768058'
|
||||
uid: f0a51e3d-8b64-483c-99fa-d7184a840707
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: test-token
|
||||
parserName: json
|
||||
repositoryName: example-1
|
||||
tokenSecretName: example-test-token-1
|
||||
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/unknown.yaml
vendored
Normal file
20
resource_customizations/core.humio.com/HumioIngestToken/testdata/unknown.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioIngestToken
|
||||
metadata:
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: test-token-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768058'
|
||||
uid: f0a51e3d-8b64-483c-99fa-d7184a840707
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: test-token
|
||||
parserName: json
|
||||
repositoryName: example-1
|
||||
tokenSecretName: example-test-token-1
|
||||
status:
|
||||
state: Unknown
|
||||
@@ -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
|
||||
@@ -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
|
||||
39
resource_customizations/core.humio.com/HumioParser/testdata/configerror.yaml
vendored
Normal file
39
resource_customizations/core.humio.com/HumioParser/testdata/configerror.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioParser
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-1-parser
|
||||
namespace: humio
|
||||
resourceVersion: '10768079'
|
||||
uid: 5641590d-b8e9-42e8-a544-d0673bf0e1a2
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-1
|
||||
parserScript: >
|
||||
/(?<client>\S+)\s+-\s+(?<userid>\S+)\s+\[(?<@timestamp>.*)\]\s+"((?<method>\S+)\s+(?<url>\S+)?\s+(?<httpversion>\S+)?|-)"\s+(?<statuscode>\d+)\s+(?<responsesize>\S+)\s+"(?<referrer>[^"]*)"\s+"(?<useragent>[^"]*)"\s*(?<responsetime>(\d|\.)+)?/
|
||||
| parseTimestamp(format="dd/MMM/yyyy:HH:mm:ss Z", field=@timestamp)
|
||||
repositoryName: example-repo
|
||||
tagFields:
|
||||
- statuscode
|
||||
- client
|
||||
testData:
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "POST
|
||||
/administrator/index.php HTTP/1.1" 200 4494
|
||||
"http://github.com/administrator/" "Mozilla/5.0 (Windows NT 6.0;
|
||||
rv:34.0) Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:31:08 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
status:
|
||||
state: ConfigError
|
||||
39
resource_customizations/core.humio.com/HumioParser/testdata/healthy.yaml
vendored
Normal file
39
resource_customizations/core.humio.com/HumioParser/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioParser
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-1-parser
|
||||
namespace: humio
|
||||
resourceVersion: '10768079'
|
||||
uid: 5641590d-b8e9-42e8-a544-d0673bf0e1a2
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-1
|
||||
parserScript: >
|
||||
/(?<client>\S+)\s+-\s+(?<userid>\S+)\s+\[(?<@timestamp>.*)\]\s+"((?<method>\S+)\s+(?<url>\S+)?\s+(?<httpversion>\S+)?|-)"\s+(?<statuscode>\d+)\s+(?<responsesize>\S+)\s+"(?<referrer>[^"]*)"\s+"(?<useragent>[^"]*)"\s*(?<responsetime>(\d|\.)+)?/
|
||||
| parseTimestamp(format="dd/MMM/yyyy:HH:mm:ss Z", field=@timestamp)
|
||||
repositoryName: example-repo
|
||||
tagFields:
|
||||
- statuscode
|
||||
- client
|
||||
testData:
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "POST
|
||||
/administrator/index.php HTTP/1.1" 200 4494
|
||||
"http://github.com/administrator/" "Mozilla/5.0 (Windows NT 6.0;
|
||||
rv:34.0) Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:31:08 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
status:
|
||||
state: Exists
|
||||
39
resource_customizations/core.humio.com/HumioParser/testdata/notfound.yaml
vendored
Normal file
39
resource_customizations/core.humio.com/HumioParser/testdata/notfound.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioParser
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-1-parser
|
||||
namespace: humio
|
||||
resourceVersion: '10768079'
|
||||
uid: 5641590d-b8e9-42e8-a544-d0673bf0e1a2
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-1
|
||||
parserScript: >
|
||||
/(?<client>\S+)\s+-\s+(?<userid>\S+)\s+\[(?<@timestamp>.*)\]\s+"((?<method>\S+)\s+(?<url>\S+)?\s+(?<httpversion>\S+)?|-)"\s+(?<statuscode>\d+)\s+(?<responsesize>\S+)\s+"(?<referrer>[^"]*)"\s+"(?<useragent>[^"]*)"\s*(?<responsetime>(\d|\.)+)?/
|
||||
| parseTimestamp(format="dd/MMM/yyyy:HH:mm:ss Z", field=@timestamp)
|
||||
repositoryName: example-repo
|
||||
tagFields:
|
||||
- statuscode
|
||||
- client
|
||||
testData:
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "POST
|
||||
/administrator/index.php HTTP/1.1" 200 4494
|
||||
"http://github.com/administrator/" "Mozilla/5.0 (Windows NT 6.0;
|
||||
rv:34.0) Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:31:08 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
status:
|
||||
state: NotFound
|
||||
37
resource_customizations/core.humio.com/HumioParser/testdata/progressing.yaml
vendored
Normal file
37
resource_customizations/core.humio.com/HumioParser/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioParser
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-1-parser
|
||||
namespace: humio
|
||||
resourceVersion: '10768079'
|
||||
uid: 5641590d-b8e9-42e8-a544-d0673bf0e1a2
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-1
|
||||
parserScript: >
|
||||
/(?<client>\S+)\s+-\s+(?<userid>\S+)\s+\[(?<@timestamp>.*)\]\s+"((?<method>\S+)\s+(?<url>\S+)?\s+(?<httpversion>\S+)?|-)"\s+(?<statuscode>\d+)\s+(?<responsesize>\S+)\s+"(?<referrer>[^"]*)"\s+"(?<useragent>[^"]*)"\s*(?<responsetime>(\d|\.)+)?/
|
||||
| parseTimestamp(format="dd/MMM/yyyy:HH:mm:ss Z", field=@timestamp)
|
||||
repositoryName: example-repo
|
||||
tagFields:
|
||||
- statuscode
|
||||
- client
|
||||
testData:
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "POST
|
||||
/administrator/index.php HTTP/1.1" 200 4494
|
||||
"http://github.com/administrator/" "Mozilla/5.0 (Windows NT 6.0;
|
||||
rv:34.0) Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:31:08 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
39
resource_customizations/core.humio.com/HumioParser/testdata/unknown.yaml
vendored
Normal file
39
resource_customizations/core.humio.com/HumioParser/testdata/unknown.yaml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioParser
|
||||
metadata:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-1-parser
|
||||
namespace: humio
|
||||
resourceVersion: '10768079'
|
||||
uid: 5641590d-b8e9-42e8-a544-d0673bf0e1a2
|
||||
spec:
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-1
|
||||
parserScript: >
|
||||
/(?<client>\S+)\s+-\s+(?<userid>\S+)\s+\[(?<@timestamp>.*)\]\s+"((?<method>\S+)\s+(?<url>\S+)?\s+(?<httpversion>\S+)?|-)"\s+(?<statuscode>\d+)\s+(?<responsesize>\S+)\s+"(?<referrer>[^"]*)"\s+"(?<useragent>[^"]*)"\s*(?<responsetime>(\d|\.)+)?/
|
||||
| parseTimestamp(format="dd/MMM/yyyy:HH:mm:ss Z", field=@timestamp)
|
||||
repositoryName: example-repo
|
||||
tagFields:
|
||||
- statuscode
|
||||
- client
|
||||
testData:
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:25:11 +0100] "POST
|
||||
/administrator/index.php HTTP/1.1" 200 4494
|
||||
"http://github.com/administrator/" "Mozilla/5.0 (Windows NT 6.0;
|
||||
rv:34.0) Gecko/20100101 Firefox/34.0" "-"
|
||||
- >-
|
||||
4.4.4.4 - - [12/Dec/2015:18:31:08 +0100] "GET /administrator/
|
||||
HTTP/1.1" 200 4263 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0)
|
||||
Gecko/20100101 Firefox/34.0" "-"
|
||||
status:
|
||||
state: Unknown
|
||||
@@ -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
|
||||
@@ -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
|
||||
24
resource_customizations/core.humio.com/HumioRepository/testdata/configerror.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioRepository/testdata/configerror.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioRepository
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 3
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-repo-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768154'
|
||||
uid: bb626adb-1cdd-4db2-baa8-ae5e30132603
|
||||
spec:
|
||||
description: example description
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-repo
|
||||
retention:
|
||||
ingestSizeInGB: 4
|
||||
storageSizeInGB: 50
|
||||
timeInDays: 730
|
||||
status:
|
||||
state: ConfigError
|
||||
24
resource_customizations/core.humio.com/HumioRepository/testdata/healthy.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioRepository/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioRepository
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 3
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-repo-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768154'
|
||||
uid: bb626adb-1cdd-4db2-baa8-ae5e30132603
|
||||
spec:
|
||||
description: example description
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-repo
|
||||
retention:
|
||||
ingestSizeInGB: 4
|
||||
storageSizeInGB: 50
|
||||
timeInDays: 730
|
||||
status:
|
||||
state: Exists
|
||||
24
resource_customizations/core.humio.com/HumioRepository/testdata/notfound.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioRepository/testdata/notfound.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioRepository
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 3
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-repo-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768154'
|
||||
uid: bb626adb-1cdd-4db2-baa8-ae5e30132603
|
||||
spec:
|
||||
description: example description
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-repo
|
||||
retention:
|
||||
ingestSizeInGB: 4
|
||||
storageSizeInGB: 50
|
||||
timeInDays: 730
|
||||
status:
|
||||
state: NotFound
|
||||
22
resource_customizations/core.humio.com/HumioRepository/testdata/progressing.yaml
vendored
Normal file
22
resource_customizations/core.humio.com/HumioRepository/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioRepository
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 3
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-repo-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768154'
|
||||
uid: bb626adb-1cdd-4db2-baa8-ae5e30132603
|
||||
spec:
|
||||
description: example description
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-repo
|
||||
retention:
|
||||
ingestSizeInGB: 4
|
||||
storageSizeInGB: 50
|
||||
timeInDays: 730
|
||||
24
resource_customizations/core.humio.com/HumioRepository/testdata/unknown.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioRepository/testdata/unknown.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioRepository
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 3
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-repo-1
|
||||
namespace: humio
|
||||
resourceVersion: '10768154'
|
||||
uid: bb626adb-1cdd-4db2-baa8-ae5e30132603
|
||||
spec:
|
||||
description: example description
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-repo
|
||||
retention:
|
||||
ingestSizeInGB: 4
|
||||
storageSizeInGB: 50
|
||||
timeInDays: 730
|
||||
status:
|
||||
state: Unknown
|
||||
26
resource_customizations/core.humio.com/HumioView/health.lua
Normal file
26
resource_customizations/core.humio.com/HumioView/health.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
end
|
||||
return hs
|
||||
end
|
||||
return hs
|
||||
@@ -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
|
||||
24
resource_customizations/core.humio.com/HumioView/testdata/configerror.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioView/testdata/configerror.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioView
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-view
|
||||
namespace: humio
|
||||
resourceVersion: '10768121'
|
||||
uid: 2c49ac77-1be2-4e2c-a473-44f3f0e03453
|
||||
spec:
|
||||
connections:
|
||||
- filter: '*'
|
||||
repositoryName: example-1
|
||||
- filter: '*'
|
||||
repositoryName: example-2
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-view
|
||||
status:
|
||||
state: ConfigError
|
||||
24
resource_customizations/core.humio.com/HumioView/testdata/healthy.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioView/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioView
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-view
|
||||
namespace: humio
|
||||
resourceVersion: '10768121'
|
||||
uid: 2c49ac77-1be2-4e2c-a473-44f3f0e03453
|
||||
spec:
|
||||
connections:
|
||||
- filter: '*'
|
||||
repositoryName: example-1
|
||||
- filter: '*'
|
||||
repositoryName: example-2
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-view
|
||||
status:
|
||||
state: Exists
|
||||
24
resource_customizations/core.humio.com/HumioView/testdata/notfound.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioView/testdata/notfound.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioView
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-view
|
||||
namespace: humio
|
||||
resourceVersion: '10768121'
|
||||
uid: 2c49ac77-1be2-4e2c-a473-44f3f0e03453
|
||||
spec:
|
||||
connections:
|
||||
- filter: '*'
|
||||
repositoryName: example-1
|
||||
- filter: '*'
|
||||
repositoryName: example-2
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-view
|
||||
status:
|
||||
state: NotFound
|
||||
22
resource_customizations/core.humio.com/HumioView/testdata/progressing.yaml
vendored
Normal file
22
resource_customizations/core.humio.com/HumioView/testdata/progressing.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioView
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-view
|
||||
namespace: humio
|
||||
resourceVersion: '10768121'
|
||||
uid: 2c49ac77-1be2-4e2c-a473-44f3f0e03453
|
||||
spec:
|
||||
connections:
|
||||
- filter: '*'
|
||||
repositoryName: example-1
|
||||
- filter: '*'
|
||||
repositoryName: example-2
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-view
|
||||
24
resource_customizations/core.humio.com/HumioView/testdata/unknown.yaml
vendored
Normal file
24
resource_customizations/core.humio.com/HumioView/testdata/unknown.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: core.humio.com/v1alpha1
|
||||
kind: HumioView
|
||||
metadata:
|
||||
annotations:
|
||||
creationTimestamp: '2022-12-08T02:03:07Z'
|
||||
finalizers:
|
||||
- core.humio.com/finalizer
|
||||
generation: 1
|
||||
labels:
|
||||
app.kubernetes.io/instance: humio-deploy
|
||||
name: example-view
|
||||
namespace: humio
|
||||
resourceVersion: '10768121'
|
||||
uid: 2c49ac77-1be2-4e2c-a473-44f3f0e03453
|
||||
spec:
|
||||
connections:
|
||||
- filter: '*'
|
||||
repositoryName: example-1
|
||||
- filter: '*'
|
||||
repositoryName: example-2
|
||||
managedClusterName: example-humiocluster
|
||||
name: example-view
|
||||
status:
|
||||
state: Unknown
|
||||
Reference in New Issue
Block a user