Skip to content

Commit f6d3745

Browse files
committed
Collect common sqlinstance troubleshooting steps
1 parent 8f30e6f commit f6d3745

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

docs/persistence/postgres/how-to/certification-sync-issues.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Certification sync issues
3-
tags: [postgres, certificate, how-to]
3+
tags: [postgres, certificate, how-to, troubleshooting, debugging]
44
---
55

66
If you have deleted your application and recreate it, there might be an issue that your new app will not be able to create a client certificate because the old one still exists.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Failing to assign private IP to an existing Cloud SQL instance
3+
tags: [postgres, private-ip, how-to, troubleshooting, debugging]
4+
---
5+
6+
If you have deleted your application and recreate it, there might be an issue that your new app will not be able to create a client certificate because the old one still exists.
7+
Your deploy may fail with an error message such as the one below:
8+
9+
```
10+
MountVolume.SetUp failed for volume "sqeletor-sql-ssl-cert" : secret "sqeletor-<podname>" not found
11+
```
12+
13+
This message can show up for a number of reasons (see our [troubleshooting guide](../../../workloads/how-to/troubleshooting.md)), so be sure to confirm that the certificate is the issue before proceeding.
14+
15+
```bash
16+
$ kubectl describe sqlsslcert -lapp=<your_app>
17+
```
18+
19+
Under `Events` you should see an error detailing the reason for the failure.
20+
If you see a message that says `Cannot assign a private IP address for an existing Cloud SQL instance in a Shared VPC`,
21+
the problem is that the deletion of the application resulted in a bit of information being lost, which causes nais to attempt to assign a private IP to the instance.
22+
23+
An [SQLInstance](../../persistence/postgres/explanations/cloud-sql-instance.md) created before 2024-04-18 will have a public IP address, and can not be updated to have a private IP address.
24+
This error occurs when the SQLInstance resource in the cluster has been deleted, without the corresponding instance actually being deleted in GCP.
25+
In this case, nais is unable to detect that the instance has a public IP, and will attempt to assign a private IP, which is not possible.
26+
27+
The solution is to edit the SQLInstance resource in the cluster and removing the `ipConfiguration` stanzas:
28+
`kubectl patch sqlinstance <instance name> -n <namespace> --type json -p='[{"op": "remove", "path": "/spec/settings/ipConfiguration/privateNetworkRef"}]'`.
29+
After a few minutes the issue will be resolved and the secrets will be created.

docs/workloads/how-to/troubleshooting.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@ Typically, you should inspect the `Status` parts of the output.
179179

180180
When the SQLInstance is not ready, either because it is still being created, or some modification is being made to it, the `sqluser` and `sqlsslcert` resources will not be updated, which again blocks creation of secrets.
181181

182-
##### `Cannot assign a private IP address for an existing Cloud SQL instance in a Shared VPC`
182+
Possible causes and how to resolve them:
183183

184-
An [SQLInstance](../../persistence/postgres/explanations/cloud-sql-instance.md) created before 2024-04-18 will have a public IP address, and can not be updated to have a private IP address.
185-
This error occurs when the SQLInstance resource in the cluster has been deleted, without the corresponding instance actually being deleted in GCP.
186-
In this case, nais is unable to detect that the instance has a public IP, and will attempt to assign a private IP, which is not possible.
187-
188-
The solution is to edit the SQLInstance resource in the cluster and removing the `ipConfiguration` stanzas: `kubectl edit sqlinstance <instancename>`.
189-
After a few minutes the issue will be resolved and the secrets will be created.
184+
- An existing certificate blocks creation of a new one.
185+
See [Certification sync issues](./postgres/how-to/certification-sync-issues.md) for more information.
186+
- Attempting to assign a private IP to an existing Cloud SQL instance.
187+
See [Failing to assign private IP to an existing Cloud SQL instance](./postgres/how-to/existing-instance-private-ip.md) for more information.
190188

191189
### Step 4. Ask for help
192190

0 commit comments

Comments
 (0)