简体   繁体   中英

Spring Boot Microservice Deployment issue on Google Cloud

I have created a simple microservice using spring boot and want to deploy on google cloud for which I have created one billing account.But when I'am trying to deploy microservice to google cloud using appengine:deploy.It shows following error -

[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Error Response: [8] Flex operation projects/springbootmicroservices-302707/regions/asia-northeast2/operations/f958224e-d3b7-4b27-ac1d-513896ce934b error [RESOURCE_EXHAUSTED]: An internal error occurred while processing task /app-engine-flex/insert_flex_deployment/flex_create_resources>2021-01-24T07:39:53.754Z3254.hq.2: The requested amount of instances has exceeded GCE's default quota. Please see https://cloud.google.com/compute/quotas for more information on GCE resources
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:44 min
[INFO] Finished at: 2021-01-24T13:10:56+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:2.0.0-rc2:deploy (default-cli) on project springBoot: Flexible application deployment failed: com.google.cloud.tools.appengine.cloudsdk.process.ProcessHandlerException: com.google.cloud.tools.appengine.api.AppEngineException: Non zero exit: 1 -> [Help 1]
[ERROR] .

app.yaml

  runtime: java
    env: flex
    runtime_config:
      jdk: openjdk8
    handlers:
    - url: /.*
      script: this field is required, but ignore.

pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>springBoot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springBoot</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
    <groupId>com.google.cloud.tools</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>2.0.0-rc2</version>
    <configuration>
     <deploy.projectId>springbootmicroservices-302707</deploy.projectId>
     <deploy.version>03</deploy.version>
     <cloudSdkHome>C:\Users\utkar\AppData\Local\Google\Cloud SDK\google-cloud-sdk</cloudSdkHome>
     <cloudSdkVersion>324.0.0</cloudSdkVersion>
     <!-- <appId>sample-project-vijay</appId> -->
     <!-- <deployables>
      <param>target/Services-0.0.1/WEB-INF/appengine-web.xml</param>
     </deployables> -->
    </configuration>
   </plugin>
        </plugins>
    </build>

</project>

controller class

    @RestController
public class MainController {

    @GetMapping(value = "utkarsh/details")
      public   Student home() {
          Student s=new Student();
          s.setAge(24);
          s.setCompany("abc");
          s.setGender("Male");
          s.setLocation("Meerut");
          s.setName("Utkarsh Sharma");
          return s;
        }
}

Please resolve the issue.Thanks in advance

This is from your error message:

[RESOURCE_EXHAUSTED]: An internal error occurred while processing task /app-engine-flex/insert_flex_deployment/flex_create_resources>2021-01-24T07:39:53.754Z3254.hq.2: The requested amount of instances has exceeded GCE's default quota. Please see https://cloud.google.com/compute/quotas for more information on GCE resources

I would follow that link and follow the steps to Checking your quota - that would be valuable info to understand the problem.

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