@@ -986,7 +986,15 @@ def _delete_rc(self, namespace, name):
986986
987987 return response
988988
989- def _healthcheck (self , controller , routable = False , path = '/' , port = 5000 , delay = 30 , timeout = 5 ): # noqa
989+ def _healthcheck (self , controller , routable = False , path = '/' , port = 5000 , delay = 30 , timeout = 5 ,
990+ period_seconds = 1 , success_threshold = 1 , failure_threshold = 3 ): # noqa
991+ """
992+ Apply HTTP GET healthcehck to the application container
993+
994+ http://kubernetes.io/docs/user-guide/walkthrough/k8s201/#health-checking
995+ http://kubernetes.io/docs/user-guide/pod-states/#container-probes
996+ http://kubernetes.io/docs/user-guide/liveness/
997+ """
990998 if not routable :
991999 return controller
9921000
@@ -1011,7 +1019,10 @@ def _healthcheck(self, controller, routable=False, path='/', port=5000, delay=30
10111019 # length of time to wait for a pod to initialize
10121020 # after pod startup, before applying health checking
10131021 'initialDelaySeconds' : delay ,
1014- 'timeoutSeconds' : timeout
1022+ 'timeoutSeconds' : timeout ,
1023+ 'periodSeconds' : period_seconds ,
1024+ 'successThreshold' : success_threshold ,
1025+ 'failureThreshold' : failure_threshold ,
10151026 },
10161027 'readinessProbe' : {
10171028 # an http probe
@@ -1022,7 +1033,10 @@ def _healthcheck(self, controller, routable=False, path='/', port=5000, delay=30
10221033 # length of time to wait for a pod to initialize
10231034 # after pod startup, before applying health checking
10241035 'initialDelaySeconds' : delay ,
1025- 'timeoutSeconds' : timeout
1036+ 'timeoutSeconds' : timeout ,
1037+ 'periodSeconds' : period_seconds ,
1038+ 'successThreshold' : success_threshold ,
1039+ 'failureThreshold' : failure_threshold ,
10261040 },
10271041 }
10281042
0 commit comments