@@ -6,6 +6,11 @@ import (
6
6
"github.com/cortexproject/cortex/integration/e2e"
7
7
)
8
8
9
+ const (
10
+ HTTPPort = 80
11
+ GRPCPort = 9095
12
+ )
13
+
9
14
// GetDefaultImage returns the Docker image to use to run Cortex.
10
15
func GetDefaultImage () string {
11
16
// Get the cortex image from the CORTEX_IMAGE env variable,
@@ -34,8 +39,8 @@ func NewDistributor(name string, consulAddress string, flags map[string]string,
34
39
"-ring.store" : "consul" ,
35
40
"-consul.hostname" : consulAddress ,
36
41
}, flags ))... ),
37
- e2e .NewReadinessProbe (80 , "/ring" , 200 ),
38
- 80 ,
42
+ e2e .NewReadinessProbe (HTTPPort , "/ring" , 200 ),
43
+ HTTPPort ,
39
44
)
40
45
}
41
46
@@ -49,14 +54,19 @@ func NewQuerier(name string, consulAddress string, flags map[string]string, imag
49
54
image ,
50
55
e2e .NewCommandWithoutEntrypoint ("cortex" , e2e .BuildArgs (e2e .MergeFlags (map [string ]string {
51
56
"-target" : "querier" ,
52
- "-log.level" : "warn" ,
57
+ "-log.level" : "info" , // TODO warn
53
58
"-distributor.replication-factor" : "1" ,
54
59
// Configure the ingesters ring backend
55
60
"-ring.store" : "consul" ,
56
61
"-consul.hostname" : consulAddress ,
62
+ // Query-frontend worker
63
+ "-querier.frontend-client.backoff-min-period" : "100ms" ,
64
+ "-querier.frontend-client.backoff-max-period" : "100ms" ,
65
+ "-querier.frontend-client.backoff-retries" : "1" ,
66
+ "-querier.worker-parallelism" : "1" ,
57
67
}, flags ))... ),
58
- e2e .NewReadinessProbe (80 , "/ready" , 204 ),
59
- 80 ,
68
+ e2e .NewReadinessProbe (HTTPPort , "/ready" , 204 ),
69
+ HTTPPort ,
60
70
)
61
71
}
62
72
@@ -81,8 +91,8 @@ func NewIngester(name string, consulAddress string, flags map[string]string, ima
81
91
"-ring.store" : "consul" ,
82
92
"-consul.hostname" : consulAddress ,
83
93
}, flags ))... ),
84
- e2e .NewReadinessProbe (80 , "/ready" , 204 ),
85
- 80 ,
94
+ e2e .NewReadinessProbe (HTTPPort , "/ready" , 204 ),
95
+ HTTPPort ,
86
96
)
87
97
}
88
98
@@ -99,8 +109,27 @@ func NewTableManager(name string, flags map[string]string, image string) *e2e.HT
99
109
"-log.level" : "warn" ,
100
110
}, flags ))... ),
101
111
// The table-manager doesn't expose a readiness probe, so we just check if the / returns 404
102
- e2e .NewReadinessProbe (80 , "/" , 404 ),
103
- 80 ,
112
+ e2e .NewReadinessProbe (HTTPPort , "/" , 404 ),
113
+ HTTPPort ,
114
+ )
115
+ }
116
+
117
+ func NewQueryFrontend (name string , flags map [string ]string , image string ) * e2e.HTTPService {
118
+ if image == "" {
119
+ image = GetDefaultImage ()
120
+ }
121
+
122
+ return e2e .NewHTTPService (
123
+ name ,
124
+ image ,
125
+ e2e .NewCommandWithoutEntrypoint ("cortex" , e2e .BuildArgs (e2e .MergeFlags (map [string ]string {
126
+ "-target" : "query-frontend" ,
127
+ "-log.level" : "info" , // TODO warn
128
+ }, flags ))... ),
129
+ // The query-frontend doesn't expose a readiness probe, so we just check if the / returns 404
130
+ e2e .NewReadinessProbe (HTTPPort , "/" , 404 ),
131
+ HTTPPort ,
132
+ GRPCPort ,
104
133
)
105
134
}
106
135
@@ -134,7 +163,7 @@ func NewAlertmanager(name string, flags map[string]string, image string) *e2e.HT
134
163
"-log.level" : "warn" ,
135
164
}, flags ))... ),
136
165
// The alertmanager doesn't expose a readiness probe, so we just check if the / returns 404
137
- e2e .NewReadinessProbe (80 , "/" , 404 ),
138
- 80 ,
166
+ e2e .NewReadinessProbe (HTTPPort , "/" , 404 ),
167
+ HTTPPort ,
139
168
)
140
169
}
0 commit comments