Preparations
Spring Boot is an open-source application development framework based on the Spring framework. It helps you quickly build production-level applications that can run independently.
This best practice uses the sample code provided by Spring to help you quickly deploy, access, and upgrade Spring applications on ServiceStage.
Preparing Resources
To facilitate subsequent operations, ensure that:
- Create a VPC. For details, see Creating a VPC.
- Create a CCE cluster. In a trial scenario, set Cluster Scale to 50 nodes and Master Nodes to Single. For details, see Buying a Cluster.
- The VPC to which the CCE cluster belongs is the one created in 1.
- The cluster contains at least one ECS node with 8 vCPUs and 16 GB memory or two ECS nodes with 4 vCPUs and 8 GB memory, and is bound to an EIP. For details, see Creating a Node.
- The CCE cluster cannot be bound to other environments.
- You have registered and obtained a public domain name from the domain name provider. For details, see Creating a Public Zone.
- In this example, the GitHub source code repository is bound to ServiceStage to implement source code building, archiving, and application creation. You need to register a GitHub account. For details, see Creating an account on GitHub.
Forking Source Code
- Log in to GitHub.
- Go to the source code repository.
- Source code repository address of the baseline version: https://github.com/spring-guides/gs-spring-boot/tree/boot-2.7
- Source code repository address of the dark launch version: https://github.com/herocc19/gs-spring-boot-kubernetes
- Fork the source code repository to your account. For details, see Forking a repository.
Setting GitHub Repository Authorization
You can set GitHub repository authorization so that build projects and application components can use the authorization information to access the GitHub source code repository.
- Log in to ServiceStage.
- Choose Continuous Delivery > Repository Authorization > Create Authorization.
- Retain the default authorization name.
- Set Repository Authorization.
- Select GitHub.
- Select OAuth for Method.
- Click Use OAuth Authorization.
- After reading the service statement, select I understand that the source code building function of the ServiceStage service collects the information above and agree to authorize the collection and use of the information.
- Click OK.
- Enter your GitHub account and password to log in to GitHub for identity authentication. Wait until the authorization is complete.
- Click OK. You can view the created authorization in the repository authorization list.
Creating an Organization
- Choose Deployment Source Management > Organization Management.
- Click Create Organization. On the displayed page, specify Organization Name. For example, org-test.
- Click OK.
Figure 1 Creating an organization
Creating an Environment
- Choose Environment Management > Create Environment and set the environment information by referring to the following table.
Parameter
Description
Environment
Enter an environment name, for example, env-test.
Enterprise Project
Specify Enterprise Project.
Enterprise projects let you manage cloud resources and users by project.
It is available after you enable the enterprise project function.
Description
Retain the default value.
VPC
Select the VPC prepared in Preparing Resources.
NOTE:The VPC cannot be modified after the environment is created.
Environment Type
Select Kubernetes.
Figure 2 Configuring an environment
- Click Create Now.
- In the Resources area, choose Clusters from Compute and click Bind now.
- In the dialog box that is displayed, select the CCE cluster created in Preparing Resources and click OK.
Creating an Application
- Click in the upper left corner to return to the Environment Management page.
- Choose Application Management > Create Application and set basic application information.
- Name: Enter an application name, for example, springGuides.
- Enterprise Project: Enterprise projects let you manage cloud resources and users by project.
It is available after you enable the enterprise project function.
- Click OK.
Figure 3 Creating an application
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot