-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adding Synergy as a ArgoCD user Signed-off-by: GitHub <[email protected]> * Health checking Kafka Connector resources Signed-off-by: Clint Chester <[email protected]> * Includes Kafka Connect Task Failures Signed-off-by: Clint Chester <[email protected]> --------- Signed-off-by: GitHub <[email protected]> Signed-off-by: Clint Chester <[email protected]>
- Loading branch information
1 parent
fdf539d
commit 99efafb
Showing
6 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
resource_customizations/platform.confluent.io/Connector/health.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
13 changes: 13 additions & 0 deletions
13
resource_customizations/platform.confluent.io/Connector/health_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
27 changes: 27 additions & 0 deletions
27
resource_customizations/platform.confluent.io/Connector/testdata/connector-failure.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: 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 |
31 changes: 31 additions & 0 deletions
31
resource_customizations/platform.confluent.io/Connector/testdata/connector-healthy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
37 changes: 37 additions & 0 deletions
37
resource_customizations/platform.confluent.io/Connector/testdata/connector-task-failure.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |