mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
feat: Implement Altinity clickhouse-operator CRD health checks (#24017)
Signed-off-by: Szymon Kośla <szymon.kosla@gmail.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
local hs = {}
|
||||
if obj.status ~= nil and obj.status.status ~= nil then
|
||||
if obj.status.status == "Completed" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "ClickHouseKeeper installation completed successfully"
|
||||
elseif obj.status.status == "InProgress" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "ClickHouseKeeper installation in progress"
|
||||
else
|
||||
hs.status = "Degraded"
|
||||
hs.message = "ClickHouseKeeper status: " .. obj.status.status
|
||||
end
|
||||
else
|
||||
hs.status = "Progressing"
|
||||
hs.message = "ClickHouseKeeper status not yet available"
|
||||
end
|
||||
return hs
|
||||
@@ -0,0 +1,17 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: ClickHouseKeeper installation completed successfully
|
||||
inputPath: testdata/healthy_completed.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: ClickHouseKeeper installation in progress
|
||||
inputPath: testdata/progressing_inprogress.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "ClickHouseKeeper status: Failed"
|
||||
inputPath: testdata/degraded_failed.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: ClickHouseKeeper status not yet available
|
||||
inputPath: testdata/progressing_nostatus.yaml
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: clickhouse-keeper.altinity.com/v1
|
||||
kind: ClickHouseKeeperInstallation
|
||||
metadata:
|
||||
name: test-clickhouse-keeper
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9181
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse-keeper
|
||||
image: clickhouse/clickhouse-keeper:latest
|
||||
status:
|
||||
status: Failed
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: clickhouse-keeper.altinity.com/v1
|
||||
kind: ClickHouseKeeperInstallation
|
||||
metadata:
|
||||
name: test-clickhouse-keeper
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9181
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse-keeper
|
||||
image: clickhouse/clickhouse-keeper:latest
|
||||
status:
|
||||
status: Completed
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: clickhouse-keeper.altinity.com/v1
|
||||
kind: ClickHouseKeeperInstallation
|
||||
metadata:
|
||||
name: test-clickhouse-keeper
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9181
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse-keeper
|
||||
image: clickhouse/clickhouse-keeper:latest
|
||||
status:
|
||||
status: InProgress
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: clickhouse-keeper.altinity.com/v1
|
||||
kind: ClickHouseKeeperInstallation
|
||||
metadata:
|
||||
name: test-clickhouse-keeper
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9181
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse-keeper
|
||||
image: clickhouse/clickhouse-keeper:latest
|
||||
@@ -0,0 +1,17 @@
|
||||
local hs = {}
|
||||
if obj.status ~= nil and obj.status.status ~= nil then
|
||||
if obj.status.status == "Completed" then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "ClickHouse installation completed successfully"
|
||||
elseif obj.status.status == "InProgress" then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "ClickHouse installation in progress"
|
||||
else
|
||||
hs.status = "Degraded"
|
||||
hs.message = "ClickHouse status: " .. obj.status.status
|
||||
end
|
||||
else
|
||||
hs.status = "Progressing"
|
||||
hs.message = "ClickHouse status not yet available"
|
||||
end
|
||||
return hs
|
||||
@@ -0,0 +1,17 @@
|
||||
tests:
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: ClickHouse installation completed successfully
|
||||
inputPath: testdata/healthy_completed.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: ClickHouse installation in progress
|
||||
inputPath: testdata/progressing_inprogress.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "ClickHouse status: Failed"
|
||||
inputPath: testdata/degraded_failed.yaml
|
||||
- healthStatus:
|
||||
status: Progressing
|
||||
message: ClickHouse status not yet available
|
||||
inputPath: testdata/progressing_nostatus.yaml
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: clickhouse.altinity.com/v1
|
||||
kind: ClickHouseInstallation
|
||||
metadata:
|
||||
name: test-clickhouse
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9000
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse
|
||||
image: clickhouse/clickhouse-server:latest
|
||||
status:
|
||||
status: Failed
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: clickhouse.altinity.com/v1
|
||||
kind: ClickHouseInstallation
|
||||
metadata:
|
||||
name: test-clickhouse
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9000
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse
|
||||
image: clickhouse/clickhouse-server:latest
|
||||
status:
|
||||
status: Completed
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: clickhouse.altinity.com/v1
|
||||
kind: ClickHouseInstallation
|
||||
metadata:
|
||||
name: test-clickhouse
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9000
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse
|
||||
image: clickhouse/clickhouse-server:latest
|
||||
status:
|
||||
status: InProgress
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: clickhouse.altinity.com/v1
|
||||
kind: ClickHouseInstallation
|
||||
metadata:
|
||||
name: test-clickhouse
|
||||
namespace: default
|
||||
spec:
|
||||
configuration:
|
||||
clusters:
|
||||
- name: cluster
|
||||
layout:
|
||||
shards:
|
||||
- name: shard
|
||||
replicas:
|
||||
- name: replica
|
||||
port: 9000
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: clickhouse
|
||||
image: clickhouse/clickhouse-server:latest
|
||||
Reference in New Issue
Block a user