@@ -21,8 +21,6 @@ package resources
2121import (
2222 "path/filepath"
2323
24- core "k8s.io/api/core/v1"
25-
2624 "github.com/arangodb/go-driver"
2725
2826 api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
@@ -32,34 +30,6 @@ import (
3230 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes"
3331)
3432
35- // ArangodbExporterContainer creates metrics container
36- func ArangodbExporterContainer (image string , args []string , livenessProbe * probes.HTTPProbeConfig ,
37- resources core.ResourceRequirements , securityContext * core.SecurityContext ,
38- spec api.DeploymentSpec ) core.Container {
39-
40- c := core.Container {
41- Name : shared .ExporterContainerName ,
42- Image : image ,
43- Command : append ([]string {"/app/arangodb-exporter" }, args ... ),
44- Ports : []core.ContainerPort {
45- {
46- Name : "exporter" ,
47- ContainerPort : int32 (spec .Metrics .GetPort ()),
48- Protocol : core .ProtocolTCP ,
49- },
50- },
51- Resources : k8sutil .ExtractPodResourceRequirement (resources ),
52- ImagePullPolicy : core .PullIfNotPresent ,
53- SecurityContext : securityContext ,
54- }
55-
56- if livenessProbe != nil {
57- c .LivenessProbe = livenessProbe .Create ()
58- }
59-
60- return c
61- }
62-
6333func createInternalExporterArgs (spec api.DeploymentSpec , groupSpec api.ServerGroupSpec , version driver.Version ) []string {
6434 tokenpath := filepath .Join (shared .ExporterJWTVolumeMountDir , constants .SecretKeyToken )
6535 options := k8sutil .CreateOptionPairs (64 )
@@ -68,10 +38,7 @@ func createInternalExporterArgs(spec api.DeploymentSpec, groupSpec api.ServerGro
6838 options .Add ("--arangodb.jwt-file" , tokenpath )
6939 }
7040
71- path := shared .ArangoExporterInternalEndpoint
72- if version .CompareTo ("3.8.0" ) >= 0 {
73- path = shared .ArangoExporterInternalEndpointV2
74- }
41+ path := getArangoExporterInternalEndpoint (version )
7542
7643 if port := groupSpec .InternalPort ; port == nil {
7744 scheme := "http"
@@ -95,6 +62,14 @@ func createInternalExporterArgs(spec api.DeploymentSpec, groupSpec api.ServerGro
9562 return options .Sort ().AsArgs ()
9663}
9764
65+ func getArangoExporterInternalEndpoint (version driver.Version ) string {
66+ path := shared .ArangoExporterInternalEndpoint
67+ if version .CompareTo ("3.8.0" ) >= 0 {
68+ path = shared .ArangoExporterInternalEndpointV2
69+ }
70+ return path
71+ }
72+
9873func createExporterLivenessProbe (isSecure bool ) * probes.HTTPProbeConfig {
9974 probeCfg := & probes.HTTPProbeConfig {
10075 LocalPath : "/" ,
0 commit comments