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:
Togie Mcdogie
2024-05-09 02:21:56 +10:00
committed by GitHub
parent 9bc9ff9c7a
commit 1cd6fcac4f
52 changed files with 1428 additions and 0 deletions

View 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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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

View File

@@ -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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -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

View 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

View 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

View 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

View 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" "-"

View 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

View 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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -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

View 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

View 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

View 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

View 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

View 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