Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Confluent Connector Resource Health Checker - #17695 #17697

Merged
merged 5 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Swisscom](https://www.swisscom.ch)
1. [Swissquote](https://github.com/swissquote)
1. [Syncier](https://syncier.com/)
1. [Synergy](https://synergy.net.au)
1. [Syself](https://syself.com)
1. [TableCheck](https://tablecheck.com/)
1. [Tailor Brands](https://www.tailorbrands.com)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
hs = {}
if obj.status ~= nil and obj.status.state ~= nil then
if obj.status.state == "CREATED" and obj.status.connectorState == "RUNNING" and obj.status.failedTasksCount == nil then
hs.status = "Healthy"
hs.message = "Connector running"
return hs
end
if obj.status.state == "ERROR" then
hs.status = "Degraded"
if obj.status.conditions and #obj.status.conditions > 0 then
hs.message = obj.status.conditions[1].message -- Kafka Connector only has one condition and nests the issues in the error message here
else
hs.message = "No conditions available"
end
return hs
end
if obj.status.failedTasksCount ~= nil and obj.status.failedTasksCount > 0 then
hs.status = "Degraded"
hs.message = "Connector has failed tasks"
return hs
end
end
hs.status = "Progressing"
hs.message = "Waiting for Kafka Connector"
return hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tests:
- healthStatus:
status: Healthy
message: 'Connector running'
inputPath: testdata/connector-healthy.yaml
- healthStatus:
status: Degraded
message: 'connect Rest API request failed: Connector configuration is invalid and contains the following 1 error(s): Could not read properties from file'
inputPath: testdata/connector-failure.yaml
- healthStatus:
status: Degraded
message: 'Connector has failed tasks'
inputPath: testdata/connector-task-failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: platform.confluent.io/v1beta1
kind: Connector
metadata:
finalizers:
- connect.finalizers.platform.confluent.io
generation: 1
name: connect
namespace: confluent
spec:
class: io.confluent.connect.sftp.SftpSinkConnector
configs:
topics: test-topic
connectClusterRef:
name: connect
name: test-sftp-connector
taskMax: 3
status:
appState: Failed
conditions:
- lastProbeTime: '2024-04-02T07:43:35Z'
lastTransitionTime: '2024-04-02T07:43:35Z'
message: >-
connect Rest API request failed: Connector configuration is invalid and contains the following 1 error(s): Could not read properties from file
reason: CreateFailed
status: 'False'
type: platform.confluent.io/app-ready
state: ERROR
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: platform.confluent.io/v1beta1
kind: Connector
metadata:
finalizers:
- connect.finalizers.platform.confluent.io
generation: 1
name: connect
namespace: confluent
spec:
class: io.confluent.connect.sftp.SftpSinkConnector
configs:
topics: test-topic
connectClusterRef:
name: connect
name: test-sftp-connector
taskMax: 3
status:
appState: Created
conditions:
- lastProbeTime: '2024-04-02T07:43:35Z'
lastTransitionTime: '2024-04-02T07:43:35Z'
message: Application is created
reason: Created
status: 'True'
type: platform.confluent.io/app-ready
connectorState: RUNNING
restartPolicy:
maxRetry: 10
type: OnFailure
state: CREATED
tasksReady: 3/3
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: platform.confluent.io/v1beta1
kind: Connector
metadata:
finalizers:
- connect.finalizers.platform.confluent.io
generation: 1
name: connect
namespace: confluent
spec:
class: io.confluent.connect.sftp.SftpSinkConnector
configs:
topics: test-topic
connectClusterRef:
name: connect
name: test-sftp-connector
taskMax: 3
status:
appState: Unknown
conditions:
- lastProbeTime: '2024-01-19T06:42:40Z'
lastTransitionTime: '2024-01-19T06:42:40Z'
message: Application is created
reason: Created
status: 'True'
type: platform.confluent.io/app-ready
connectorState: RUNNING
failedTasks:
task-0:
id: 0
retryCount: 10
failedTasksCount: 1
observedGeneration: 1
restartPolicy:
maxRetry: 10
type: OnFailure
state: CREATED
tasksReady: 0/1