diff --git a/pkg/reconciler/brokercell/resources/deployments.go b/pkg/reconciler/brokercell/resources/deployments.go index 542fb6304c..fa2f848ebd 100644 --- a/pkg/reconciler/brokercell/resources/deployments.go +++ b/pkg/reconciler/brokercell/resources/deployments.go @@ -35,6 +35,19 @@ func MakeIngressDeployment(args IngressArgs) *appsv1.Deployment { // Decorate the container template with ingress port. container.Env = append(container.Env, corev1.EnvVar{Name: "PORT", Value: strconv.Itoa(args.Port)}) container.Ports = append(container.Ports, corev1.ContainerPort{Name: "http", ContainerPort: int32(args.Port)}) + container.ReadinessProbe = &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/healthz", + Port: intstr.FromInt(args.Port), + Scheme: corev1.URISchemeHTTP, + }, + }, + FailureThreshold: 3, + PeriodSeconds: 2, + SuccessThreshold: 1, + TimeoutSeconds: 5, + } container.LivenessProbe = &corev1.Probe{ Handler: corev1.Handler{ HTTPGet: &corev1.HTTPGetAction{ diff --git a/pkg/reconciler/brokercell/testingdata/ingress_deployment.yaml b/pkg/reconciler/brokercell/testingdata/ingress_deployment.yaml index 7946fc39a4..a04e0248af 100644 --- a/pkg/reconciler/brokercell/testingdata/ingress_deployment.yaml +++ b/pkg/reconciler/brokercell/testingdata/ingress_deployment.yaml @@ -50,6 +50,15 @@ spec: periodSeconds: 2 successThreshold: 1 timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 5 env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /var/secrets/google/key.json diff --git a/pkg/reconciler/brokercell/testingdata/ingress_deployment_with_status.yaml b/pkg/reconciler/brokercell/testingdata/ingress_deployment_with_status.yaml index 9a15eaf8ee..6aff0f26c3 100644 --- a/pkg/reconciler/brokercell/testingdata/ingress_deployment_with_status.yaml +++ b/pkg/reconciler/brokercell/testingdata/ingress_deployment_with_status.yaml @@ -51,6 +51,15 @@ spec: periodSeconds: 2 successThreshold: 1 timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 5 env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /var/secrets/google/key.json