@@ -35,6 +35,7 @@ import (
35
35
"sync"
36
36
"time"
37
37
38
+ driver "github.com/arangodb/go-driver"
38
39
"github.com/arangodb/go-driver/jwt"
39
40
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1alpha"
40
41
"github.com/arangodb/kube-arangodb/pkg/util/constants"
@@ -353,7 +354,7 @@ func (r *Resources) createLivenessProbe(spec api.DeploymentSpec, group api.Serve
353
354
}
354
355
355
356
// createReadinessProbe creates configuration for a readiness probe of a server in the given group.
356
- func (r * Resources ) createReadinessProbe (spec api.DeploymentSpec , group api.ServerGroup ) (* k8sutil.HTTPProbeConfig , error ) {
357
+ func (r * Resources ) createReadinessProbe (spec api.DeploymentSpec , group api.ServerGroup , version driver. Version ) (* k8sutil.HTTPProbeConfig , error ) {
357
358
if group != api .ServerGroupSingle && group != api .ServerGroupCoordinators {
358
359
return nil , nil
359
360
}
@@ -369,12 +370,22 @@ func (r *Resources) createReadinessProbe(spec api.DeploymentSpec, group api.Serv
369
370
}
370
371
}
371
372
probeCfg := & k8sutil.HTTPProbeConfig {
372
- LocalPath : "/_admin/server/availability " ,
373
+ LocalPath : "/_api/version " ,
373
374
Secure : spec .IsSecure (),
374
375
Authorization : authorization ,
375
376
InitialDelaySeconds : 2 ,
376
377
PeriodSeconds : 2 ,
377
378
}
379
+ switch spec .GetMode () {
380
+ case api .DeploymentModeActiveFailover :
381
+ probeCfg .LocalPath = "/_admin/echo"
382
+ }
383
+
384
+ // /_admin/server/availability is the way to go, it is available since 3.3.9
385
+ if version .CompareTo ("3.3.9" ) >= 0 {
386
+ probeCfg .LocalPath = "/_admin/server/availability"
387
+ }
388
+
378
389
return probeCfg , nil
379
390
}
380
391
@@ -482,7 +493,7 @@ func (r *Resources) createPodForMember(spec api.DeploymentSpec, memberID string,
482
493
if err != nil {
483
494
return maskAny (err )
484
495
}
485
- readinessProbe , err := r .createReadinessProbe (spec , group )
496
+ readinessProbe , err := r .createReadinessProbe (spec , group , imageInfo . ArangoDBVersion )
486
497
if err != nil {
487
498
return maskAny (err )
488
499
}
0 commit comments