diff --git a/pkg/reconciler/revision/resources/deploy_test.go b/pkg/reconciler/revision/resources/deploy_test.go index 6ad0d7338f94..50d298f36d45 100644 --- a/pkg/reconciler/revision/resources/deploy_test.go +++ b/pkg/reconciler/revision/resources/deploy_test.go @@ -983,7 +983,7 @@ func TestMakePodSpec(t *testing.T) { ), }), }, { - name: "propertes allowed by the webhook are passed through", + name: "properties allowed by the webhook are passed through", rev: revision("bar", "foo", withContainers([]corev1.Container{{ Name: servingContainerName, diff --git a/pkg/reconciler/revision/resources/queue.go b/pkg/reconciler/revision/resources/queue.go index 309c1c19dc39..c789640a31c5 100644 --- a/pkg/reconciler/revision/resources/queue.go +++ b/pkg/reconciler/revision/resources/queue.go @@ -260,25 +260,24 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container // During startup we want to poll the container faster than Kubernetes will // allow, so we use an ExecProbe which starts immediately and then polls // every 25ms. We encode the original probe as JSON in an environment - // variable for this exec probe to use. - startupProbe := container.ReadinessProbe.DeepCopy() - applyReadinessProbeDefaultsForExec(startupProbe, userPort) - probeJSON, err := readiness.EncodeProbe(startupProbe) + // variable for this probe to use. + userProbe := container.ReadinessProbe.DeepCopy() + applyReadinessProbeDefaultsForExec(userProbe, userPort) + execProbe := makeExecProbe(userProbe) + userProbeJSON, err := readiness.EncodeProbe(userProbe) if err != nil { return nil, fmt.Errorf("failed to serialize readiness probe: %w", err) } - // After startup we'll directly use the same QP http health check the + // After startup we'll directly use the same http health check endpoint the // execprobe would have used (which will then check the user container). - // This maintains the behaviour of incorporating user-container readiness - // in QP readiness. - readinessProbe := container.ReadinessProbe.DeepCopy() - readinessProbe.Handler = corev1.Handler{ + // Unlike the StartupProbe, we don't need to override any of the + // timeouts/periods/thresholds here. + httpProbe := container.ReadinessProbe.DeepCopy() + httpProbe.Handler = corev1.Handler{ HTTPGet: &corev1.HTTPGetAction{ Port: intstr.FromInt(int(servingPort.ContainerPort)), HTTPHeaders: []corev1.HTTPHeader{{ - // Adding this header causes the Queue Proxy to perform a - // health check of itself and the user container. Name: network.ProbeHeaderName, Value: queue.Name, }}, @@ -290,8 +289,8 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container Image: cfg.Deployment.QueueSidecarImage, Resources: createQueueResources(cfg.Deployment, rev.GetAnnotations(), container), Ports: ports, - StartupProbe: makeExecProbe(startupProbe), - ReadinessProbe: readinessProbe, + StartupProbe: execProbe, + ReadinessProbe: httpProbe, SecurityContext: queueSecurityContext, Env: []corev1.EnvVar{{ Name: "SERVING_NAMESPACE", @@ -369,7 +368,7 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container Value: metrics.Domain(), }, { Name: "SERVING_READINESS_PROBE", - Value: probeJSON, + Value: userProbeJSON, }, { Name: "ENABLE_PROFILING", Value: strconv.FormatBool(cfg.Observability.EnableProfiling),