简体   繁体   中英

How to delete AppEngine default service in the existing Google Cloud project with Firestore

I've the existing Google Cloud project that was created by Firebase and use Firestore in this project. Decided to try AppEngine and run Hello World Example in this project.

Now I want to delete this newly deployed AppEngine Service, but there are 2 problems:

1) Hello World Docs suggest to switch off the AppEngine. In this case Firestore is not working

2) Can't delete this service from CLI/UI as this service was deployed as the default one

 Issue deleting service: [default]
 The default service (module) cannot be deleted.

Is there a way to delete this service from the project and keep Firebase Firestore?

  1. Go to App Engine -> Settings: https://console.cloud.google.com/appengine/settings
  2. Click on "Disable application"

If there's nothing else on your project, you can shut down the project at https://console.cloud.google.com/iam-admin/settings .

As it's displayed in the UI on disabled Stop button:

You only can stop versions that are manually scaled, basic scaled or in flexible environment

The solution is to deploy another default service using flexible env, stop it and then delete the app with Standard env:

1) Change app.yaml:

runtime: nodejs env: flex

2) Run gcloud app deploy

3) Stop new version using UI or CLI

4) Delete old version

2) Can't delete this service from CLI/UI as this service was deployed as the default one

See https://cloud.google.com/nodejs/getting-started/delete-tutorial-resources .

The only way you can delete the default version of your App Engine app is by deleting your project. However, you can stop the default version in the GCP Console. This action shuts down all instances associated with the version. You can restart these instances later if needed. In the App Engine standard environment, you can stop the default version only if your app has manual or basic scaling.

tl;dr: Deploy a hello world app on the flexible environment to replace the default service, and then stop it. No need to delete because the default service cannot be deleted.

I assume that:

  • you wanted to delete the default App Engine service, but
  • you wanted to continue using Google Cloud Firestore in the same project.

Problems that arise:

  • you cannot disable Google App Engine without also disabling Firestore
  • you cannot delete the default service
  • you cannot stop the default service because it may be deployed to the standard environment using some scaling settings that doesn't allow stopping the instance

Workaround:

  1. Deploy a hello world application to the flexible environment. You can do this in Google Cloud Shell.

     git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples cd nodejs-docs-samples/appengine/hello-world/flexible gcloud app deploy
  2. Under Versions , stop the newly-deployed version and delete the old version.

  3. Confirm that the instance count is 0.

So the service is not deleted; it is just stopped and doesn't charge you for instances. You can continue to use Firestore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM