Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cloudrun] Unable to attach cloudsql connector #298

Closed
anovis opened this issue Dec 25, 2022 · 2 comments · Fixed by #317
Closed

[Cloudrun] Unable to attach cloudsql connector #298

anovis opened this issue Dec 25, 2022 · 2 comments · Fixed by #317
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@anovis
Copy link
Collaborator

anovis commented Dec 25, 2022

Looking at the docs it looks like the sql connector should be added as an annotation as below. But it seems to not be working. Works with the cloudrun jobs it seems.

        "run.googleapis.com/cloudsql-instances": "projects/PROJECT/locations/LOCATION/connectors/SQL_CONNECTION",
@anovis anovis added bug Something isn't working documentation Improvements or additions to documentation labels Dec 25, 2022
@anovis anovis self-assigned this Dec 25, 2022
@anovis
Copy link
Collaborator Author

anovis commented Jan 23, 2023

Cloud Run API v2 does not support annotations with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.

anovis added a commit that referenced this issue Jan 31, 2023
Cloudsql connectors need to be set as a volumeMount in Cloudrun (closes #298 ). 

```
{
    "cloudrun_revision": {
        "serviceAccount": "SERVICE_ACCOUNT",
        "volumes": [
            {
                "name": "NAME",
                "cloudSqlInstance": {
                    "instances": [
                        "PROJECT:REGION:INSTANCE_NAME"
                    ]
                }
            }
        ]
    },
    "cloudrun_container": {
        "volumeMounts": [
            {
                "name": "NAME",
                "mountPath": "/cloudsql/INSTANCE_NAME"
            }
        ]
    }
}
```
quajones pushed a commit to quajones/goblet that referenced this issue Oct 19, 2023
Cloudsql connectors need to be set as a volumeMount in Cloudrun (closes goblet#298 ). 

```
{
    "cloudrun_revision": {
        "serviceAccount": "SERVICE_ACCOUNT",
        "volumes": [
            {
                "name": "NAME",
                "cloudSqlInstance": {
                    "instances": [
                        "PROJECT:REGION:INSTANCE_NAME"
                    ]
                }
            }
        ]
    },
    "cloudrun_container": {
        "volumeMounts": [
            {
                "name": "NAME",
                "mountPath": "/cloudsql/INSTANCE_NAME"
            }
        ]
    }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant