Add timeouts to HealthChecks and retry checks

Fixes issue #3532. Added timeouts for HTTP and TCP checks
and enabled kubelet/probe to kubelet#maxRetries times
before declaring Failure.

Added Probe.TimeoutSecs to API

Probe variants now check container.LivenessProbe.TimeoutSeconds
Also added a test for timeouts in http_test.go.
This commit is contained in:
George Kuan
2015-01-28 20:35:49 -08:00
parent e335e2d3e2
commit e8c33b7916
12 changed files with 60 additions and 21 deletions

View File

@@ -279,6 +279,8 @@ type Probe struct {
Handler `json:",inline"`
// Length of time before health checking is activated. In seconds.
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty"`
// Length of time before health checking times out. In seconds.
TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"`
}
// PullPolicy describes a policy for if/when to pull a container image

View File

@@ -911,6 +911,7 @@ func init() {
return err
}
out.InitialDelaySeconds = in.InitialDelaySeconds
out.TimeoutSeconds = in.TimeoutSeconds
return nil
},
func(in *LivenessProbe, out *newer.Probe, s conversion.Scope) error {
@@ -924,6 +925,7 @@ func init() {
return err
}
out.InitialDelaySeconds = in.InitialDelaySeconds
out.TimeoutSeconds = in.TimeoutSeconds
return nil
},
)

View File

@@ -227,6 +227,8 @@ type LivenessProbe struct {
Exec *ExecAction `json:"exec,omitempty" description:"parameters for exec-based liveness probe"`
// Length of time before health checking is activated. In seconds.
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty" description:"number of seconds after the container has started before liveness probes are initiated"`
// Length of time before health checking times out. In seconds.
TimeoutSeconds int64 `json:"timeoutSeconds,omitempty" description:"number of seconds after which liveness probes timeout; defaults to 1 second"`
}
// PullPolicy describes a policy for if/when to pull a container image

View File

@@ -824,6 +824,7 @@ func init() {
return err
}
out.InitialDelaySeconds = in.InitialDelaySeconds
out.TimeoutSeconds = in.TimeoutSeconds
return nil
},
func(in *LivenessProbe, out *newer.Probe, s conversion.Scope) error {
@@ -837,6 +838,7 @@ func init() {
return err
}
out.InitialDelaySeconds = in.InitialDelaySeconds
out.TimeoutSeconds = in.TimeoutSeconds
return nil
},
)

View File

@@ -191,6 +191,8 @@ type LivenessProbe struct {
Exec *ExecAction `json:"exec,omitempty" description:"parameters for exec-based liveness probe"`
// Length of time before health checking is activated. In seconds.
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty" description:"number of seconds after the container has started before liveness probes are initiated"`
// Length of time before health checking times out. In seconds.
TimeoutSeconds int64 `json:"timeoutSeconds,omitempty" description:"number of seconds after which liveness probes timeout; defaults to 1 second"`
}
// PullPolicy describes a policy for if/when to pull a container image

View File

@@ -297,6 +297,8 @@ type Probe struct {
Handler `json:",inline"`
// Length of time before health checking is activated. In seconds.
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty"`
// Length of time before health checking times out. In seconds.
TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"`
}
// PullPolicy describes a policy for if/when to pull a container image