Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Default PeriodSeconds of the readiness probe to 1 if unset #10992

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/reconciler/revision/resources/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ var (
}},
},
},
PeriodSeconds: 1,
},
SecurityContext: queueSecurityContext,
Env: []corev1.EnvVar{{
Expand Down
11 changes: 9 additions & 2 deletions pkg/reconciler/revision/resources/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container

// After startup we'll directly use the same http health check endpoint the
// execprobe would have used (which will then check the user container).
// Unlike the StartupProbe, we don't need to override any of the
// timeouts/periods/thresholds here.
// Unlike the StartupProbe, we don't need to override any of the other settings
// except period here. See below.
httpProbe := container.ReadinessProbe.DeepCopy()
httpProbe.Handler = corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Expand All @@ -262,6 +262,13 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container
},
}

// Default PeriodSeconds to 1 if not set to make for the quickest possible startup
// time.
// TODO(#10973): Remove this once we're on K8s 1.21
if httpProbe.PeriodSeconds == 0 {
httpProbe.PeriodSeconds = 1
}

return &corev1.Container{
Name: QueueContainerName,
Image: cfg.Deployment.QueueSidecarImage,
Expand Down
5 changes: 1 addition & 4 deletions pkg/reconciler/revision/resources/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,7 @@ func TestTCPProbeGeneration(t *testing.T) {
}},
},
},
// The ReadinessProbe does not override the user's probe parameters.
// (The aggressive probing will have happened on startup, now
// we can probe at the user-requested/default interval).
PeriodSeconds: 0,
PeriodSeconds: 1,
TimeoutSeconds: 0,
SuccessThreshold: 3,
}
Expand Down