@@ -220,6 +220,15 @@ func ReadStaticPodFromDisk(manifestPath string) (*v1.Pod, error) {
220
220
221
221
// LivenessProbe creates a Probe object with a HTTPGet handler
222
222
func LivenessProbe (host , path string , port int , scheme v1.URIScheme ) * v1.Probe {
223
+ return createHTTPProbe (host , path , port , scheme , 15 , 15 , 8 , 10 )
224
+ }
225
+
226
+ // ReadinessProbe creates a Probe object with a HTTPGet handler
227
+ func ReadinessProbe (host , path string , port int , scheme v1.URIScheme ) * v1.Probe {
228
+ return createHTTPProbe (host , path , port , scheme , 0 , 15 , 3 , 1 )
229
+ }
230
+
231
+ func createHTTPProbe (host , path string , port int , scheme v1.URIScheme , initialDelaySeconds , timeoutSeconds , failureThreshold , periodSeconds int32 ) * v1.Probe {
223
232
return & v1.Probe {
224
233
Handler : v1.Handler {
225
234
HTTPGet : & v1.HTTPGetAction {
@@ -229,9 +238,10 @@ func LivenessProbe(host, path string, port int, scheme v1.URIScheme) *v1.Probe {
229
238
Scheme : scheme ,
230
239
},
231
240
},
232
- InitialDelaySeconds : 15 ,
233
- TimeoutSeconds : 15 ,
234
- FailureThreshold : 8 ,
241
+ InitialDelaySeconds : initialDelaySeconds ,
242
+ TimeoutSeconds : timeoutSeconds ,
243
+ FailureThreshold : failureThreshold ,
244
+ PeriodSeconds : periodSeconds ,
235
245
}
236
246
}
237
247
0 commit comments