Everything as a Service

☁️Deploying Microservices via Source-Code from your GitHub

Yagiz Ozturk
Huawei Developers

--

Hello everyone, this time I’m here with another article about microservices. In this demo we gonna use microservice engine, kubernetes cluster and a developer service to rule these services.

This demo gonna be happen in Singapore region. If you follow me carefully you can deploy your own microservices architectures in Singapore region with these settings.

We need to make some preparations for this demo. Let’s start with preparation steps.

Step 1:

Create a CCE cluster with two nodes in it. Both nodes needs to have public network access and nodes spec sums should be 8vCPUs and 16GB RAM at least. ServiceStage service doesn’t support containerd engine you can only use docker engine. If you don’t know how to create cluster you can access my basic article from HERE. While creating CCE turn off the high availability option.

Step 2:

Create a Cloud Service Engine. All of the settings shown below.

1.1: CSE Settings

Step 3:

We need to create Organization. You can find this option under the Deployment Source Management tab.

1.2:Organization

Step 4:

While our CCE cluster and CSE creating process goes on at the background. We can fork the source code at Github. Go this link and fork the source code.

Get back to ServiceStage service and create an authorization. You can see this left side of the screen as Repository Authorization under the Continuous Delivery section.

1.3: Repository authorization

We gonna use the source code from the GitHub. Use OAuth to access your GitHub.

1.4:Authorization

Need to create the environment from environment management section. After the creation bind CCE cluster and CSE service.

1.5:Environment Creation

1.Give a name to your environment.
2.Choose your enterprise project if you have this option.
3.Choose your VPC.
4.Select environment type as Kubernetes.

1.6:CCE and CSE binding

Application and Components

1.7:Application Creation

Give a name to your application and choose your enterprise project if you can see this option.

After the application is created its time to create our components. Start with weather component.

1.8:Component

1.Write the component name.
2.Generate the component version
3.Retain the default settings rest of the spaces.

1.9:Component Package

Choose the Java and OpenJDK11 at the component package side.

Now please be careful about the following statements.

1.10: Building Job

We gonna have 4 components and because of this we gonna repeat the processes in the 1.8, 1.9, 1.10 images 4 times. Dockerfile adresses gonna change depends which component we are creating.

1.11: Components and Dockerfile Adresses

In the next page don’t change the resource specifications.

1.12: Resource specifications

Only thing that gonna change in this page is number of Instances as you can see below.

1.13: Component specifications

Expand the advanced settings tab and bind your CSE. Don’t forget we gonna repeat these steps 4 times (for every component).

1.14: Binding microservice engine

After these steps completed we need to see a screen like this.

1.15: End of the component creation

Now click on edge-service and get in access mode and write specifications shown below.

1.16: Adding port to edge-service

After service created succesfully you should see this screen.

1.17: Edge-service adress

We gave a port to our component. Lets build the frontend component right now. Create another component with the specifications as shown below.

1.18: Creating frontend component
1.19: Creating frontend component
1.20: Creating frontend component
1.21: Creating frontend component

In the next page keep follow my specifications.

1.22: Creating frontend component

Expand the advanced settings and component configuration.
Name: SERVICE_ADDR
Variable/Variable Reference: Access Adress in the image 1.17

1.23: Creating frontend component

After create and deploy component management screen should seen like this.

1.24: Component management page

Click on weathermapweb and get in access mode then write the specification shown below.

1.25: Creating port and public address for weathermapweb component

Copy the address shown below and click on it.

1.26: Public address for frontend
1.27: Weathermapweb project

Our weathermap project is done.

NOTE: If your page reloading and not giving any answer back. It is a security group problem, try to open your access address ports but if it is giving an error its a app problem check your configurations.

Conclusion

We deployed application with our source code in the GitHub. While doing this we used CCE, CSE and ServiceStage services. If you have an application in GitHub you can deploy it in Huawei Cloud by following steps in this story. If we want to ingest our workloads we can check them from the CCE service.

References

--

--