mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 08:57:17 +00:00
fix: OpenTelemetryCollector health check shows 0/0 for mode: daemonset (#26391)
Signed-off-by: tank.500m <tank.500m@kakaocorp.com>
This commit is contained in:
parent
560d428381
commit
472d50cb19
3 changed files with 28 additions and 2 deletions
|
|
@ -14,8 +14,16 @@ if obj.status ~= nil then
|
|||
total = tonumber(total)
|
||||
|
||||
if ready == 0 then
|
||||
hs.status = "Degraded"
|
||||
hs.message = "No replicas are ready"
|
||||
-- DaemonSet desiredNumberScheduled is based on eligible nodes.
|
||||
-- 0/0 is valid when no nodes match; treat as Healthy.
|
||||
-- https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#how-daemon-pods-are-scheduled
|
||||
if obj.spec ~= nil and obj.spec.mode == "daemonset" and total == 0 then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "DaemonSet has no eligible nodes (0/0)"
|
||||
else
|
||||
hs.status = "Degraded"
|
||||
hs.message = "No replicas are ready"
|
||||
end
|
||||
elseif ready == total then
|
||||
hs.status = "Healthy"
|
||||
hs.message = "All replicas are ready"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ tests:
|
|||
status: Healthy
|
||||
message: "All replicas are ready"
|
||||
inputPath: testdata/healthy.yaml
|
||||
- healthStatus:
|
||||
status: Healthy
|
||||
message: "DaemonSet has no eligible nodes (0/0)"
|
||||
inputPath: testdata/daemonset-no-eligible-node.yaml
|
||||
- healthStatus:
|
||||
status: Degraded
|
||||
message: "No replicas are ready"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
apiVersion: opentelemetry.io/v1beta1
|
||||
kind: OpenTelemetryCollector
|
||||
metadata:
|
||||
name: test-collector-daemonset-no-eligible-node
|
||||
namespace: default
|
||||
spec:
|
||||
mode: daemonset
|
||||
status:
|
||||
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.124.1
|
||||
scale:
|
||||
replicas: 0
|
||||
selector: app.kubernetes.io/component=opentelemetry-collector
|
||||
statusReplicas: 0/0
|
||||
version: 0.124.1
|
||||
Loading…
Reference in a new issue