Skip to content

Commit 39285f8

Browse files
committed
check if pod is ready before pinger
when node crash, kubelet will not update pod status, goldpinger on crashed node will not work, but other goldpinger instance will continue ping the bad one. this patch remove the not ready goldpinger instance from pinger list. ``` NAME READY STATUS RESTARTS AGE goldpinger-8749c476d-5n7lt 1/1 Running 0 78d goldpinger-8749c476d-bj752 0/1 Terminating 0 78d goldpinger-8749c476d-bzf6t 1/1 Running 0 78d goldpinger-8749c476d-dv28g 1/1 Running 0 4h25m goldpinger-8749c476d-gwhw4 1/1 Running 0 4h25m goldpinger-8749c476d-prgwd 1/1 Running 0 78d { "conditions": [ { "lastProbeTime": null, "lastTransitionTime": "2023-03-29T12:38:40Z", "status": "True", "type": "Initialized" }, { "lastProbeTime": null, "lastTransitionTime": "2023-06-16T02:24:10Z", "message": "containers with unready status: [goldpinger]", "reason": "ContainersNotReady", "status": "False", "type": "Ready" }, { "lastProbeTime": null, "lastTransitionTime": "2023-06-16T02:24:10Z", "message": "containers with unready status: [goldpinger]", "reason": "ContainersNotReady", "status": "False", "type": "ContainersReady" }, { "lastProbeTime": null, "lastTransitionTime": "2023-03-29T12:38:39Z", "status": "True", "type": "PodScheduled" } ], "containerStatuses": [ { "containerID": "docker://xxx", "image": "xxx/goldpinger:v3.5.0", "imageID": "docker-pullable://xxx/goldpinger@sha256:xxx", "lastState": {}, "name": "goldpinger", "ready": false, "restartCount": 0, "started": true, "state": { "running": { "startedAt": "2023-03-29T12:38:56Z" } } } ], "hostIP": "1.2.3.3", "phase": "Running", "podIP": "1.2.3.4", "podIPs": [ { "ip": "1.2.3.4" } ], "qosClass": "Burstable", "startTime": "2023-03-29T12:38:40Z" } ``` Signed-off-by: j4ckstraw <[email protected]>
1 parent 9536355 commit 39285f8

File tree

3 files changed

+555
-131
lines changed

3 files changed

+555
-131
lines changed

go.mod

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,23 @@ module github.com/bloomberg/goldpinger/v3
33
go 1.15
44

55
require (
6-
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
76
github.com/cespare/xxhash v1.1.0
87
github.com/go-openapi/errors v0.20.2
98
github.com/go-openapi/loads v0.19.5
109
github.com/go-openapi/runtime v0.19.26
1110
github.com/go-openapi/spec v0.19.8
1211
github.com/go-openapi/strfmt v0.20.0
13-
github.com/go-openapi/swag v0.19.9
12+
github.com/go-openapi/swag v0.22.3
1413
github.com/go-openapi/validate v0.19.10
1514
github.com/jessevdk/go-flags v1.4.0
16-
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
17-
github.com/prometheus/client_golang v0.9.1
18-
github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39 // indirect
19-
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d // indirect
15+
github.com/prometheus/client_golang v1.14.0
2016
github.com/stuartnelson3/go-rendezvous v0.2.0
21-
go.uber.org/zap v1.14.1
22-
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
17+
go.uber.org/zap v1.19.0
2318
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
24-
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
25-
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
26-
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
27-
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
28-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
29-
honnef.co/go/tools v0.0.1-2020.1.3 // indirect
30-
k8s.io/api v0.19.14
31-
k8s.io/apimachinery v0.19.14
32-
k8s.io/client-go v0.19.14
33-
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
19+
golang.org/x/net v0.8.0
20+
k8s.io/api v0.27.3
21+
k8s.io/apimachinery v0.27.3
22+
k8s.io/client-go v0.27.3
23+
k8s.io/kubectl v0.27.3
24+
k8s.io/utils v0.0.0-20230209194617-a36077c30491
3425
)

0 commit comments

Comments
 (0)