From 27fc84e59490aeba6dc6bfe87ee23d79220e6b7a Mon Sep 17 00:00:00 2001 From: Prabhjyot Saluja <ssaluja@prabhjyot.macbook> Date: Wed, 6 Nov 2024 15:24:47 -0500 Subject: [PATCH 1/6] Add readiness health check for cloud-sql-proxy sidecar container The sidecar container "cloud-sql-proxy" was missing a readiness health check. This commit adds the check to the YAML configuration. See [readiness health check documentation](https://github.com/GoogleCloudPlatform/cloud-sql-proxy/tree/main/examples/k8s-health-check#readiness-health-check-configuration) for more details. --- deployment/dev/backstage/backstage.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deployment/dev/backstage/backstage.yaml b/deployment/dev/backstage/backstage.yaml index fdc5e96d..84bca2a8 100644 --- a/deployment/dev/backstage/backstage.yaml +++ b/deployment/dev/backstage/backstage.yaml @@ -103,6 +103,12 @@ spec: # Use auto iam authn to authenticate with the Cloud SQL instance - --auto-iam-authn - bits-backstage-dev:us-east4:backstage-dev # kpt-set: ${instance_connection_name} + readinessProbe: + httpGet: + path: /readiness + port: 5432 + initialDelaySeconds: 30 + periodSeconds: 10 securityContext: # The default Cloud SQL Auth Proxy image runs as the # "nonroot" user and group (uid: 65532) by default. @@ -128,4 +134,4 @@ spec: secretName: github-app-backstage-bits-credentials items: - key: github-app-backstage-bits-credentials.yaml - path: github-app-backstage-bits-credentials.yaml + path: github-app-backstage-bits-credentials.yaml \ No newline at end of file From ac2af1a5ae5878a8548c87f6ee4681fc1a87426d Mon Sep 17 00:00:00 2001 From: Prabhjyot Saluja <ssaluja@prabhjyot.macbook> Date: Wed, 6 Nov 2024 15:49:27 -0500 Subject: [PATCH 2/6] add failureThreshold:6 --- deployment/dev/backstage/backstage.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployment/dev/backstage/backstage.yaml b/deployment/dev/backstage/backstage.yaml index 84bca2a8..0e970761 100644 --- a/deployment/dev/backstage/backstage.yaml +++ b/deployment/dev/backstage/backstage.yaml @@ -108,7 +108,8 @@ spec: path: /readiness port: 5432 initialDelaySeconds: 30 - periodSeconds: 10 + periodSeconds: 30 + failureThreshold: 6 securityContext: # The default Cloud SQL Auth Proxy image runs as the # "nonroot" user and group (uid: 65532) by default. From 232f97fa6782e92f56be2d1544dc58df7c9d92c6 Mon Sep 17 00:00:00 2001 From: Prabhjyot Saluja <ssaluja@prabhjyot.macbook> Date: Fri, 8 Nov 2024 14:18:47 -0500 Subject: [PATCH 3/6] add comments from documentation --- deployment/dev/backstage/backstage.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployment/dev/backstage/backstage.yaml b/deployment/dev/backstage/backstage.yaml index 0e970761..2043a61c 100644 --- a/deployment/dev/backstage/backstage.yaml +++ b/deployment/dev/backstage/backstage.yaml @@ -109,6 +109,7 @@ spec: port: 5432 initialDelaySeconds: 30 periodSeconds: 30 + # to avoid restarting the pod on frequent transient failures. failureThreshold: 6 securityContext: # The default Cloud SQL Auth Proxy image runs as the @@ -135,4 +136,4 @@ spec: secretName: github-app-backstage-bits-credentials items: - key: github-app-backstage-bits-credentials.yaml - path: github-app-backstage-bits-credentials.yaml \ No newline at end of file + path: github-app-backstage-bits-credentials.yaml From c48729cdd664f61d37f9dc5729bc171e0be6f54b Mon Sep 17 00:00:00 2001 From: Prabhjyot Saluja <ssaluja@prabhjyot.macbook> Date: Fri, 8 Nov 2024 14:21:49 -0500 Subject: [PATCH 4/6] feat(Proxy health checks): add comment --- deployment/dev/backstage/backstage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/dev/backstage/backstage.yaml b/deployment/dev/backstage/backstage.yaml index 2043a61c..e8d8af98 100644 --- a/deployment/dev/backstage/backstage.yaml +++ b/deployment/dev/backstage/backstage.yaml @@ -109,7 +109,7 @@ spec: port: 5432 initialDelaySeconds: 30 periodSeconds: 30 - # to avoid restarting the pod on frequent transient failures. + # to avoid restarting the pod on frequent transient failures. failureThreshold: 6 securityContext: # The default Cloud SQL Auth Proxy image runs as the From f1f0ce8c20a34986dcf8611530d76eedc21959bc Mon Sep 17 00:00:00 2001 From: Prabhjyot Saluja <ssaluja@prabhjyot.macbook> Date: Fri, 8 Nov 2024 14:30:50 -0500 Subject: [PATCH 5/6] feat(proxy health check): Add proxy health check Follow the conventional commit guide. --- deployment/dev/backstage/backstage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/dev/backstage/backstage.yaml b/deployment/dev/backstage/backstage.yaml index e8d8af98..9141cccf 100644 --- a/deployment/dev/backstage/backstage.yaml +++ b/deployment/dev/backstage/backstage.yaml @@ -109,7 +109,7 @@ spec: port: 5432 initialDelaySeconds: 30 periodSeconds: 30 - # to avoid restarting the pod on frequent transient failures. + # to avoid restarting the pod on frequent transient failures failureThreshold: 6 securityContext: # The default Cloud SQL Auth Proxy image runs as the From 13766aa1158e750c7165f9f9dbe143bf835bd3a3 Mon Sep 17 00:00:00 2001 From: Prabhjyot Saluja <ssaluja@prabhjyot.macbook> Date: Fri, 8 Nov 2024 14:41:27 -0500 Subject: [PATCH 6/6] remove comment and fix the PR title in GUI --- deployment/dev/backstage/backstage.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/deployment/dev/backstage/backstage.yaml b/deployment/dev/backstage/backstage.yaml index 9141cccf..dbf1a80d 100644 --- a/deployment/dev/backstage/backstage.yaml +++ b/deployment/dev/backstage/backstage.yaml @@ -109,7 +109,6 @@ spec: port: 5432 initialDelaySeconds: 30 periodSeconds: 30 - # to avoid restarting the pod on frequent transient failures failureThreshold: 6 securityContext: # The default Cloud SQL Auth Proxy image runs as the