From 552710d7af438625535ef3dcfd9583d02c7ae13a Mon Sep 17 00:00:00 2001 From: Tim Downey Date: Tue, 24 Nov 2020 13:11:48 -0800 Subject: [PATCH] use startupProbe instead of readinessProbe for rake-task based jobs - these jobs briefly listen on a socket while starting up but do not necessarily maintain that socket long-term - these jobs run rake tasks that will crash when something goes wrong so the regular liveness/readiness behavior of Kubernetes should suffice - this was "working" previously because the readiness check probe was connecting to the Istio sidecar instead of the rake task, we noticed issues once switching to a non-mesh ingress solution (like Contour) - addresses https://github.com/cloudfoundry/capi-k8s-release/issues/91 Authored-by: Tim Downey [#175388005](https://www.pivotaltracker.com/story/show/175388005) --- templates/api_server_deployment.yml | 3 --- templates/clock_deployment.yml | 4 +++- templates/deployment_updater_deployment.yml | 4 +++- templates/worker_deployment.yml | 7 +++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/api_server_deployment.yml b/templates/api_server_deployment.yml index 3eedb975..68d92534 100644 --- a/templates/api_server_deployment.yml +++ b/templates/api_server_deployment.yml @@ -84,9 +84,6 @@ spec: - name: registry-buddy image: #@ data.values.images.registry_buddy imagePullPolicy: Always - readinessProbe: - tcpSocket: - port: 8080 volumeMounts: - name: tmp-packages mountPath: /tmp/packages diff --git a/templates/clock_deployment.yml b/templates/clock_deployment.yml index 763ddd31..e5c4acb7 100644 --- a/templates/clock_deployment.yml +++ b/templates/clock_deployment.yml @@ -29,6 +29,8 @@ spec: image: #@ data.values.images.ccng imagePullPolicy: Always command: [ "/cnb/process/clock" ] + ports: + - containerPort: 4446 env: - name: CLOUD_CONTROLLER_NG_CONFIG value: #@ ccng_config_mount_path @@ -41,7 +43,7 @@ spec: limits: cpu: 1000m memory: 1Gi - readinessProbe: + startupProbe: tcpSocket: port: 4446 periodSeconds: 3 diff --git a/templates/deployment_updater_deployment.yml b/templates/deployment_updater_deployment.yml index 705e31b7..6fcb7de3 100644 --- a/templates/deployment_updater_deployment.yml +++ b/templates/deployment_updater_deployment.yml @@ -29,6 +29,8 @@ spec: image: #@ data.values.images.ccng imagePullPolicy: Always command: [ "/cnb/process/deployment-updater" ] + ports: + - containerPort: 4445 env: - name: CLOUD_CONTROLLER_NG_CONFIG value: #@ ccng_config_mount_path @@ -41,7 +43,7 @@ spec: limits: cpu: 1000m memory: 1Gi - readinessProbe: + startupProbe: tcpSocket: port: 4445 periodSeconds: 3 diff --git a/templates/worker_deployment.yml b/templates/worker_deployment.yml index 224ba08e..c67e594d 100644 --- a/templates/worker_deployment.yml +++ b/templates/worker_deployment.yml @@ -25,6 +25,8 @@ spec: image: #@ data.values.images.ccng imagePullPolicy: Always command: [ "/cnb/process/api-worker" ] + ports: + - containerPort: 4444 env: - name: CLOUD_CONTROLLER_NG_CONFIG value: #@ ccng_config_mount_path @@ -37,7 +39,7 @@ spec: limits: cpu: 1000m memory: 1Gi - readinessProbe: + startupProbe: tcpSocket: port: 4444 periodSeconds: 3 @@ -52,9 +54,6 @@ spec: - name: registry-buddy image: #@ data.values.images.registry_buddy imagePullPolicy: Always - readinessProbe: - tcpSocket: - port: 8080 env: - name: REGISTRY_USERNAME valueFrom: