0

For the past week we are seeing the error "Could not determine if the selected GCP project is ready for deployment, please close the dialog and try again", image below: error

It happens more often than not, and it is now impacting our deployment capability. This is from Visual Studio 2019 and 2022.

We tried reinstalling/updating the Cloud Tools add-in, and also upgrading Google SDK and kubectl. Unfortunately, the issue persists.

Any advice on you to troubleshoot and resolve this? Thanks!

fuqyeah
  • 3
  • 2
CJS
  • 1

1 Answers1

0

[UPDATE] google cloud visual studio tool are not supported anymore https://github.com/GoogleCloudPlatform/google-cloud-visualstudio/issues/1121

Here my Workaround

  1. first of all you need to install docker desktop

  2. right click on project -> Add -> Docker Supoport

  3. righ click on project-> open in Terminal

  4. you need first time authentication

gcloud auth login
gcloud container clusters get-credentials {your cluster} --region {region} --project {project} gcloud auth configure-docker

  1. create a script ps1

     $version = [DateTimeOffset]::Now.ToUnixTimeSeconds()
    
     docker build -t gcr.io/{project}/{your deployment name}:$version .
    
     docker push gcr.io/{project}/{your deployment name}:$version
    
     $deployment_yaml = (Get-Content .\Conf\Prod\deployment.yaml) -replace "{{version}}", $version
    
     $deployment_yaml | kubectl apply -f -
    

here an example of deployment.yaml please note the I have added {version} placeholder

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {your deployment name}
spec:
  replicas: 2
  selector:
    matchLabels:
      run: {your deployment name}
  template:
    metadata:
      creationTimestamp: null
      labels:
        run: {your deployment name}
    spec:
      containers:
      - image: gcr.io/{project}/{your deployment name}:{{version}}
        imagePullPolicy: IfNotPresent
        name: {your deployment name}
        ports:
        - containerPort: 8080
          protocol: TCP
        resources:
          limits:
            cpu: "2"
            memory: 2Gi
          requests:
            cpu: "2"
            memory: 2Gi
Riccardo
  • 180
  • 1
  • 12