mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
feat: Implement KafkaConnector,KafkaBridge CRD health checks (#18316)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
local hs = {}
|
||||
if obj.status ~= nil then
|
||||
if obj.status.conditions ~= nil then
|
||||
for i, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "NotReady" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message
|
||||
return hs
|
||||
end
|
||||
if condition.type == "Ready" and condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = ""
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for KafkaBridge"
|
||||
return hs
|
||||
@@ -0,0 +1,12 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for KafkaBridge"
|
||||
inputPath: testdata/progressing_noStatus.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "Error"
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
inputPath: testdata/healthy.yaml
|
||||
54
resource_customizations/kafka.strimzi.io/KafkaBridge/testdata/degraded.yaml
vendored
Normal file
54
resource_customizations/kafka.strimzi.io/KafkaBridge/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
apiVersion: kafka.strimzi.io/v1beta1
|
||||
kind: KafkaBridge
|
||||
metadata:
|
||||
creationTimestamp: "2020-02-13T14:03:15Z"
|
||||
deletionGracePeriodSeconds: 0
|
||||
deletionTimestamp: "2020-05-28T10:29:44Z"
|
||||
finalizers:
|
||||
- foregroundDeletion
|
||||
generation: 25
|
||||
labels:
|
||||
app.kubernetes.io/instance: kafka-bridge
|
||||
name: kafka-bridge
|
||||
namespace: strimzi
|
||||
resourceVersion: "43088521"
|
||||
selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkabridge/kafka
|
||||
uid: 941ae21d-4e69-11ea-a53d-06e66a171f98
|
||||
spec:
|
||||
authentication:
|
||||
passwordSecret:
|
||||
password: password
|
||||
secretName: kafka-bridge
|
||||
type: scram-sha-512
|
||||
username: kafka-bridge
|
||||
bootstrapServers: 'kafka-bootstrap:9095'
|
||||
enableMetrics: true
|
||||
http:
|
||||
port: 8080
|
||||
logging:
|
||||
loggers:
|
||||
kafka.root.logger.level: DEBUG
|
||||
logger.send.level: DEBUG
|
||||
logger.send.name: http.openapi.operation.send
|
||||
type: inline
|
||||
producer:
|
||||
config:
|
||||
ssl.cipher.suites: TLS_AES_256_GCM_SHA384
|
||||
ssl.enabled.protocols: TLSv1.3
|
||||
ssl.protocol: TLSv1.3
|
||||
replicas: 1
|
||||
tls:
|
||||
trustedCertificates:
|
||||
- certificate: ca.crt
|
||||
secretName: kafka-cluster-cluster-ca-cert
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: '2024-05-15T09:34:44.930056634Z'
|
||||
status: "True"
|
||||
type: NotReady
|
||||
message: "Error"
|
||||
labelSelector: >-
|
||||
strimzi.io/cluster=kafka-bridge,strimzi.io/name=kafka-bridge-bridge,strimzi.io/kind=KafkaBridge
|
||||
observedGeneration: 14
|
||||
replicas: 1
|
||||
url: 'http://kafka-bridge-bridge-service.strimzi.svc:8080'
|
||||
53
resource_customizations/kafka.strimzi.io/KafkaBridge/testdata/healthy.yaml
vendored
Normal file
53
resource_customizations/kafka.strimzi.io/KafkaBridge/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
apiVersion: kafka.strimzi.io/v1beta1
|
||||
kind: KafkaBridge
|
||||
metadata:
|
||||
creationTimestamp: "2020-02-13T14:03:15Z"
|
||||
deletionGracePeriodSeconds: 0
|
||||
deletionTimestamp: "2020-05-28T10:29:44Z"
|
||||
finalizers:
|
||||
- foregroundDeletion
|
||||
generation: 25
|
||||
labels:
|
||||
app.kubernetes.io/instance: kafka-bridge
|
||||
name: kafka-bridge
|
||||
namespace: strimzi
|
||||
resourceVersion: "43088521"
|
||||
selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkabridge/kafka
|
||||
uid: 941ae21d-4e69-11ea-a53d-06e66a171f98
|
||||
spec:
|
||||
authentication:
|
||||
passwordSecret:
|
||||
password: password
|
||||
secretName: kafka-bridge
|
||||
type: scram-sha-512
|
||||
username: kafka-bridge
|
||||
bootstrapServers: 'kafka-bootstrap:9095'
|
||||
enableMetrics: true
|
||||
http:
|
||||
port: 8080
|
||||
logging:
|
||||
loggers:
|
||||
kafka.root.logger.level: DEBUG
|
||||
logger.send.level: DEBUG
|
||||
logger.send.name: http.openapi.operation.send
|
||||
type: inline
|
||||
producer:
|
||||
config:
|
||||
ssl.cipher.suites: TLS_AES_256_GCM_SHA384
|
||||
ssl.enabled.protocols: TLSv1.3
|
||||
ssl.protocol: TLSv1.3
|
||||
replicas: 1
|
||||
tls:
|
||||
trustedCertificates:
|
||||
- certificate: ca.crt
|
||||
secretName: kafka-cluster-cluster-ca-cert
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: '2024-05-15T09:34:44.930056634Z'
|
||||
status: 'True'
|
||||
type: Ready
|
||||
labelSelector: >-
|
||||
strimzi.io/cluster=kafka-bridge,strimzi.io/name=kafka-bridge-bridge,strimzi.io/kind=KafkaBridge
|
||||
observedGeneration: 14
|
||||
replicas: 1
|
||||
url: 'http://kafka-bridge-bridge-service.strimzi.svc:8080'
|
||||
43
resource_customizations/kafka.strimzi.io/KafkaBridge/testdata/progressing_noStatus.yaml
vendored
Normal file
43
resource_customizations/kafka.strimzi.io/KafkaBridge/testdata/progressing_noStatus.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
apiVersion: kafka.strimzi.io/v1beta1
|
||||
kind: KafkaBridge
|
||||
metadata:
|
||||
creationTimestamp: "2020-02-13T14:03:15Z"
|
||||
deletionGracePeriodSeconds: 0
|
||||
deletionTimestamp: "2020-05-28T10:29:44Z"
|
||||
finalizers:
|
||||
- foregroundDeletion
|
||||
generation: 25
|
||||
labels:
|
||||
app.kubernetes.io/instance: kafka-bridge
|
||||
name: kafka-bridge
|
||||
namespace: strimzi
|
||||
resourceVersion: "43088521"
|
||||
selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkabridge/kafka
|
||||
uid: 941ae21d-4e69-11ea-a53d-06e66a171f98
|
||||
spec:
|
||||
authentication:
|
||||
passwordSecret:
|
||||
password: password
|
||||
secretName: kafka-bridge
|
||||
type: scram-sha-512
|
||||
username: kafka-bridge
|
||||
bootstrapServers: 'kafka-bootstrap:9095'
|
||||
enableMetrics: true
|
||||
http:
|
||||
port: 8080
|
||||
logging:
|
||||
loggers:
|
||||
kafka.root.logger.level: DEBUG
|
||||
logger.send.level: DEBUG
|
||||
logger.send.name: http.openapi.operation.send
|
||||
type: inline
|
||||
producer:
|
||||
config:
|
||||
ssl.cipher.suites: TLS_AES_256_GCM_SHA384
|
||||
ssl.enabled.protocols: TLSv1.3
|
||||
ssl.protocol: TLSv1.3
|
||||
replicas: 1
|
||||
tls:
|
||||
trustedCertificates:
|
||||
- certificate: ca.crt
|
||||
secretName: kafka-cluster-cluster-ca-cert
|
||||
@@ -0,0 +1,21 @@
|
||||
local hs = {}
|
||||
if obj.status ~= nil then
|
||||
if obj.status.conditions ~= nil then
|
||||
for i, condition in ipairs(obj.status.conditions) do
|
||||
if condition.type == "NotReady" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = condition.message
|
||||
return hs
|
||||
end
|
||||
if condition.type == "Ready" and condition.status == "True" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = ""
|
||||
return hs
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hs.status = "Progressing"
|
||||
hs.message = "Waiting for KafkaConnector"
|
||||
return hs
|
||||
@@ -0,0 +1,12 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: "Waiting for KafkaConnector"
|
||||
inputPath: testdata/progressing_noStatus.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "The following tasks have failed: 0, see connectorStatus for more details."
|
||||
inputPath: testdata/degraded.yaml
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
inputPath: testdata/healthy.yaml
|
||||
51
resource_customizations/kafka.strimzi.io/KafkaConnector/testdata/degraded.yaml
vendored
Normal file
51
resource_customizations/kafka.strimzi.io/KafkaConnector/testdata/degraded.yaml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
apiVersion: kafka.strimzi.io/v1beta1
|
||||
kind: KafkaConnector
|
||||
metadata:
|
||||
creationTimestamp: "2020-02-13T14:03:15Z"
|
||||
deletionGracePeriodSeconds: 0
|
||||
deletionTimestamp: "2020-05-28T10:29:44Z"
|
||||
finalizers:
|
||||
- foregroundDeletion
|
||||
generation: 25
|
||||
labels:
|
||||
app.kubernetes.io/instance: kafka-connect
|
||||
strimzi.io/cluster: strimzi-connect-cluster
|
||||
name: my-connector
|
||||
namespace: strimzi
|
||||
resourceVersion: "43088521"
|
||||
selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkaconnector/kafka
|
||||
uid: 941ae21d-4e69-11ea-a53d-06e66a171f98
|
||||
spec:
|
||||
class: org.apache.kafka.connect.file.FileStreamSourceConnector
|
||||
tasksMax: 2
|
||||
config:
|
||||
file: "/opt/kafka/LICENSE"
|
||||
topic: my-topic
|
||||
status:
|
||||
autoRestart:
|
||||
count: 1
|
||||
lastRestartTimestamp: '2024-05-17T15:55:21.611546835Z'
|
||||
conditions:
|
||||
- lastTransitionTime: '2024-05-17T15:57:09.059039185Z'
|
||||
message: >-
|
||||
The following tasks have failed: 0, see connectorStatus for more
|
||||
details.
|
||||
reason: Throwable
|
||||
status: 'True'
|
||||
type: NotReady
|
||||
connectorStatus:
|
||||
connector:
|
||||
state: RUNNING
|
||||
worker_id: >-
|
||||
kafka-connect-cluster-connect-0.kafka-connect-cluster-connect.strimzi.svc:8083
|
||||
name: my-connector
|
||||
tasks:
|
||||
- id: 0
|
||||
state: FAILED
|
||||
trace: "org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handler..."
|
||||
worker_id: >-
|
||||
kafka-connect-cluster-connect-0.kafka-connect-cluster-connect.strimzi.svc:8083
|
||||
type: source
|
||||
observedGeneration: 1
|
||||
tasksMax: 1
|
||||
topics: []
|
||||
43
resource_customizations/kafka.strimzi.io/KafkaConnector/testdata/healthy.yaml
vendored
Normal file
43
resource_customizations/kafka.strimzi.io/KafkaConnector/testdata/healthy.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
apiVersion: kafka.strimzi.io/v1beta1
|
||||
kind: KafkaConnector
|
||||
metadata:
|
||||
creationTimestamp: "2020-02-13T14:03:15Z"
|
||||
deletionGracePeriodSeconds: 0
|
||||
deletionTimestamp: "2020-05-28T10:29:44Z"
|
||||
finalizers:
|
||||
- foregroundDeletion
|
||||
generation: 25
|
||||
labels:
|
||||
app.kubernetes.io/instance: kafka-connect
|
||||
strimzi.io/cluster: strimzi-connect-cluster
|
||||
name: my-connector
|
||||
namespace: strimzi
|
||||
resourceVersion: "43088521"
|
||||
selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkaconnector/kafka
|
||||
uid: 941ae21d-4e69-11ea-a53d-06e66a171f98
|
||||
spec:
|
||||
class: org.apache.kafka.connect.file.FileStreamSourceConnector
|
||||
tasksMax: 2
|
||||
config:
|
||||
file: "/opt/kafka/LICENSE"
|
||||
topic: my-topic
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: '2024-05-17T15:55:22.356665885Z'
|
||||
status: 'True'
|
||||
type: Ready
|
||||
connectorStatus:
|
||||
connector:
|
||||
state: RUNNING
|
||||
worker_id: >-
|
||||
kafka-connect-cluster-connect-0.kafka-connect-cluster-connect.strimzi.svc:8083
|
||||
name: my-connector
|
||||
tasks:
|
||||
- id: 0
|
||||
state: RUNNING
|
||||
worker_id: >-
|
||||
kafka-connect-cluster-connect-0.kafka-connect-cluster-connect.strimzi.svc:8083
|
||||
type: source
|
||||
observedGeneration: 1
|
||||
tasksMax: 1
|
||||
topics: []
|
||||
23
resource_customizations/kafka.strimzi.io/KafkaConnector/testdata/progressing_noStatus.yaml
vendored
Normal file
23
resource_customizations/kafka.strimzi.io/KafkaConnector/testdata/progressing_noStatus.yaml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: kafka.strimzi.io/v1beta1
|
||||
kind: KafkaConnector
|
||||
metadata:
|
||||
creationTimestamp: "2020-02-13T14:03:15Z"
|
||||
deletionGracePeriodSeconds: 0
|
||||
deletionTimestamp: "2020-05-28T10:29:44Z"
|
||||
finalizers:
|
||||
- foregroundDeletion
|
||||
generation: 25
|
||||
labels:
|
||||
app.kubernetes.io/instance: kafka-connect
|
||||
strimzi.io/cluster: strimzi-connect-cluster
|
||||
name: my-connector
|
||||
namespace: strimzi
|
||||
resourceVersion: "43088521"
|
||||
selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkaconnector/kafka
|
||||
uid: 941ae21d-4e69-11ea-a53d-06e66a171f98
|
||||
spec:
|
||||
class: org.apache.kafka.connect.file.FileStreamSourceConnector
|
||||
tasksMax: 2
|
||||
config:
|
||||
file: "/opt/kafka/LICENSE"
|
||||
topic: my-topic
|
||||
Reference in New Issue
Block a user