Skip to content

Commit d017eea

Browse files
authored
[Feature] Enable Probes for Single & Gateway (#1922)
1 parent 298f1b9 commit d017eea

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- (Feature) (Platform) Packer
1010
- (Feature) Manual Upgrade Mode
1111
- (Feature) (Platform) SchedulerV2 Defaults Revert
12+
- (Bugfix) Enable Probes for Single & Gateway
1213

1314
## [1.2.49](https://github.com/arangodb/kube-arangodb/tree/1.2.49) (2025-06-17)
1415
- (Maintenance) Optimize go.mod

pkg/deployment/deployment_core_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -1441,6 +1441,7 @@ func TestEnsurePod_ArangoDB_Core(t *testing.T) {
14411441

14421442
testCase.ExpectedPod.Spec.Containers[0].LivenessProbe = createTestLivenessProbe(httpProbe, true, authLiveness, shared.ServerPortName)
14431443
testCase.ExpectedPod.Spec.Containers[0].ReadinessProbe = createTestReadinessProbe(httpProbe, true, authReadiness)
1444+
testCase.ExpectedPod.Spec.Containers[0].StartupProbe = createTestStartupProbe(httpProbe, true, authLiveness, 720*6)
14441445
},
14451446
ExpectedEvent: "member single is created",
14461447
ExpectedPod: core.Pod{
@@ -1509,6 +1510,7 @@ func TestEnsurePod_ArangoDB_Core(t *testing.T) {
15091510

15101511
testCase.ExpectedPod.Spec.Containers[0].LivenessProbe = createTestLivenessProbe(httpProbe, true, authLiveness, shared.ServerPortName)
15111512
testCase.ExpectedPod.Spec.Containers[0].ReadinessProbe = createTestReadinessProbe(httpProbe, true, authReadiness)
1513+
testCase.ExpectedPod.Spec.Containers[0].StartupProbe = createTestStartupProbe(httpProbe, true, authLiveness, 720*6)
15121514
},
15131515
ExpectedEvent: "member single is created",
15141516
ExpectedPod: core.Pod{

pkg/deployment/deployment_features_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -364,6 +364,7 @@ func TestEnsurePod_ArangoDB_Features(t *testing.T) {
364364

365365
testCase.ExpectedPod.Spec.Containers[0].LivenessProbe = createTestLivenessProbe(httpProbe, false, "", shared.ServerPortName)
366366
testCase.ExpectedPod.Spec.Containers[0].ReadinessProbe = createTestReadinessProbe(httpProbe, false, "")
367+
testCase.ExpectedPod.Spec.Containers[0].StartupProbe = createTestStartupProbe(httpProbe, false, "", 720*6)
367368
},
368369
ExpectedEvent: "member single is created",
369370
ExpectedPod: core.Pod{
@@ -429,6 +430,7 @@ func TestEnsurePod_ArangoDB_Features(t *testing.T) {
429430

430431
testCase.ExpectedPod.Spec.Containers[0].LivenessProbe = createTestLivenessProbe(httpProbe, false, "", shared.ServerPortName)
431432
testCase.ExpectedPod.Spec.Containers[0].ReadinessProbe = createTestReadinessProbe(httpProbe, false, "")
433+
testCase.ExpectedPod.Spec.Containers[0].StartupProbe = createTestStartupProbe(httpProbe, false, "", 720*6)
432434
},
433435
ExpectedEvent: "member single is created",
434436
ExpectedPod: core.Pod{
@@ -494,6 +496,7 @@ func TestEnsurePod_ArangoDB_Features(t *testing.T) {
494496

495497
testCase.ExpectedPod.Spec.Containers[0].LivenessProbe = createTestLivenessProbe(httpProbe, false, "", shared.ServerPortName)
496498
testCase.ExpectedPod.Spec.Containers[0].ReadinessProbe = createTestReadinessProbe(httpProbe, false, "")
499+
testCase.ExpectedPod.Spec.Containers[0].StartupProbe = createTestStartupProbe(httpProbe, false, "", 720*6)
497500
},
498501
ExpectedEvent: "member single is created",
499502
ExpectedPod: core.Pod{

pkg/deployment/pod/probes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ type probes struct {
5252
// probeMap defines default values and if Probe can be enabled
5353
var probeMap = map[api.ServerGroup]probes{
5454
api.ServerGroupSingle: {
55-
startup: newProbe(true, false),
55+
startup: newProbe(true, true),
5656
liveness: newProbe(true, true),
5757
readiness: newProbe(true, true),
5858
},
@@ -81,9 +81,9 @@ var probeMap = map[api.ServerGroup]probes{
8181
liveness: newProbe(true, true),
8282
readiness: newProbe(false, false),
8383
},
84-
api.ServerGroupGateways: { // TODO: Enable Probes
85-
startup: newProbe(false, false),
86-
liveness: newProbe(false, false),
87-
readiness: newProbe(false, false),
84+
api.ServerGroupGateways: {
85+
startup: newProbe(true, true),
86+
liveness: newProbe(true, false),
87+
readiness: newProbe(true, true),
8888
},
8989
}

pkg/deployment/resources/pod_creator_probes.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -207,6 +207,11 @@ func (r *Resources) probeBuilders(imageInfo api.ImageInfo) map[api.ServerGroup]p
207207
liveness: r.probeBuilderLivenessCoreSelect(api.ServerGroupCoordinators, imageInfo),
208208
readiness: r.probeBuilderReadinessCoreSelect(),
209209
},
210+
api.ServerGroupGateways: {
211+
startup: r.probeBuilderStartupCoreSelect(api.ServerGroupGateways, imageInfo),
212+
liveness: r.probeBuilderLivenessCoreSelect(api.ServerGroupGateways, imageInfo),
213+
readiness: r.probeBuilderReadinessCoreSelect(),
214+
},
210215
api.ServerGroupSyncMasters: {
211216
startup: r.probeBuilderStartupSync,
212217
liveness: r.probeBuilderLivenessSync,
@@ -490,10 +495,10 @@ func getProbeRetries(group api.ServerGroup) (int32, int32) {
490495
// Set default values.
491496
period, howLong := 5*time.Second, 300*time.Second
492497

493-
if group == api.ServerGroupDBServers {
498+
if group == api.ServerGroupDBServers || group == api.ServerGroupSingle {
494499
// Wait 6 hours (in seconds) for WAL replay.
495500
howLong = 6 * time.Hour
496-
} else if group == api.ServerGroupCoordinators {
501+
} else if group == api.ServerGroupCoordinators || group == api.ServerGroupGateways {
497502
// Coordinator should wait for agents, but agents could take more time to spin up.
498503
howLong = time.Hour
499504
}

0 commit comments

Comments
 (0)