Skip to content

Commit 99efafb

Browse files
authoredDec 15, 2024··
feat: Confluent Connector Resource Health Checker - #17695 (#17697)
* Adding Synergy as a ArgoCD user Signed-off-by: GitHub <noreply@github.com> * Health checking Kafka Connector resources Signed-off-by: Clint Chester <clint.chester@synergy.net.au> * Includes Kafka Connect Task Failures Signed-off-by: Clint Chester <clint.chester@synergy.net.au> --------- Signed-off-by: GitHub <noreply@github.com> Signed-off-by: Clint Chester <clint.chester@synergy.net.au>
1 parent fdf539d commit 99efafb

File tree

6 files changed

+134
-0
lines changed

6 files changed

+134
-0
lines changed
 

‎USERS.md

+1
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ Currently, the following organizations are **officially** using Argo CD:
335335
1. [Swisscom](https://www.swisscom.ch)
336336
1. [Swissquote](https://github.com/swissquote)
337337
1. [Syncier](https://syncier.com/)
338+
1. [Synergy](https://synergy.net.au)
338339
1. [Syself](https://syself.com)
339340
1. [TableCheck](https://tablecheck.com/)
340341
1. [Tailor Brands](https://www.tailorbrands.com)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
hs = {}
2+
if obj.status ~= nil and obj.status.state ~= nil then
3+
if obj.status.state == "CREATED" and obj.status.connectorState == "RUNNING" and obj.status.failedTasksCount == nil then
4+
hs.status = "Healthy"
5+
hs.message = "Connector running"
6+
return hs
7+
end
8+
if obj.status.state == "ERROR" then
9+
hs.status = "Degraded"
10+
if obj.status.conditions and #obj.status.conditions > 0 then
11+
hs.message = obj.status.conditions[1].message -- Kafka Connector only has one condition and nests the issues in the error message here
12+
else
13+
hs.message = "No conditions available"
14+
end
15+
return hs
16+
end
17+
if obj.status.failedTasksCount ~= nil and obj.status.failedTasksCount > 0 then
18+
hs.status = "Degraded"
19+
hs.message = "Connector has failed tasks"
20+
return hs
21+
end
22+
end
23+
hs.status = "Progressing"
24+
hs.message = "Waiting for Kafka Connector"
25+
return hs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tests:
2+
- healthStatus:
3+
status: Healthy
4+
message: 'Connector running'
5+
inputPath: testdata/connector-healthy.yaml
6+
- healthStatus:
7+
status: Degraded
8+
message: 'connect Rest API request failed: Connector configuration is invalid and contains the following 1 error(s): Could not read properties from file'
9+
inputPath: testdata/connector-failure.yaml
10+
- healthStatus:
11+
status: Degraded
12+
message: 'Connector has failed tasks'
13+
inputPath: testdata/connector-task-failure.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: platform.confluent.io/v1beta1
2+
kind: Connector
3+
metadata:
4+
finalizers:
5+
- connect.finalizers.platform.confluent.io
6+
generation: 1
7+
name: connect
8+
namespace: confluent
9+
spec:
10+
class: io.confluent.connect.sftp.SftpSinkConnector
11+
configs:
12+
topics: test-topic
13+
connectClusterRef:
14+
name: connect
15+
name: test-sftp-connector
16+
taskMax: 3
17+
status:
18+
appState: Failed
19+
conditions:
20+
- lastProbeTime: '2024-04-02T07:43:35Z'
21+
lastTransitionTime: '2024-04-02T07:43:35Z'
22+
message: >-
23+
connect Rest API request failed: Connector configuration is invalid and contains the following 1 error(s): Could not read properties from file
24+
reason: CreateFailed
25+
status: 'False'
26+
type: platform.confluent.io/app-ready
27+
state: ERROR
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: platform.confluent.io/v1beta1
2+
kind: Connector
3+
metadata:
4+
finalizers:
5+
- connect.finalizers.platform.confluent.io
6+
generation: 1
7+
name: connect
8+
namespace: confluent
9+
spec:
10+
class: io.confluent.connect.sftp.SftpSinkConnector
11+
configs:
12+
topics: test-topic
13+
connectClusterRef:
14+
name: connect
15+
name: test-sftp-connector
16+
taskMax: 3
17+
status:
18+
appState: Created
19+
conditions:
20+
- lastProbeTime: '2024-04-02T07:43:35Z'
21+
lastTransitionTime: '2024-04-02T07:43:35Z'
22+
message: Application is created
23+
reason: Created
24+
status: 'True'
25+
type: platform.confluent.io/app-ready
26+
connectorState: RUNNING
27+
restartPolicy:
28+
maxRetry: 10
29+
type: OnFailure
30+
state: CREATED
31+
tasksReady: 3/3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: platform.confluent.io/v1beta1
2+
kind: Connector
3+
metadata:
4+
finalizers:
5+
- connect.finalizers.platform.confluent.io
6+
generation: 1
7+
name: connect
8+
namespace: confluent
9+
spec:
10+
class: io.confluent.connect.sftp.SftpSinkConnector
11+
configs:
12+
topics: test-topic
13+
connectClusterRef:
14+
name: connect
15+
name: test-sftp-connector
16+
taskMax: 3
17+
status:
18+
appState: Unknown
19+
conditions:
20+
- lastProbeTime: '2024-01-19T06:42:40Z'
21+
lastTransitionTime: '2024-01-19T06:42:40Z'
22+
message: Application is created
23+
reason: Created
24+
status: 'True'
25+
type: platform.confluent.io/app-ready
26+
connectorState: RUNNING
27+
failedTasks:
28+
task-0:
29+
id: 0
30+
retryCount: 10
31+
failedTasksCount: 1
32+
observedGeneration: 1
33+
restartPolicy:
34+
maxRetry: 10
35+
type: OnFailure
36+
state: CREATED
37+
tasksReady: 0/1

0 commit comments

Comments
 (0)
Please sign in to comment.