Mendix is based on Tencent Cloud deployment best practices

This practice is authorized and released by Tencent Cloud and Siemens Digital Industrial Software, and may not be reproduced without permission.

1.   Overview

This document introduces the best practices for quickly hosting Mendix applications on the Siemens enterprise application development platform to Tencent Cloud Container Service (TKE). This solution is only used for rapid deployment in a non-production environment. If you need a high-availability solution for the production environment, please contact us for consultation.

1.1 Application range

Mendix applications are quickly hosted to Tencent Cloud Container Service TKE.

1.2 Scene description

It is suitable for scenarios where applications developed using Siemens enterprise-level application development platform Mendix can be quickly hosted to Tencent Cloud Container Service TKE.

1.3 Advantages of Mendix Application Hosting to Tencent Cloud Container Service

  •   Simple and easy to use. Just start the container cluster and specify the tasks you want to run, Tencent Cloud Container Service helps users complete all cluster management tasks.

  •   Efficient deployment. Relying on the stable container service of Tencent Cloud, you can quickly host your packaged complete mendix application image to the container environment for efficient deployment.

  •   Safe and reliable. Resources are highly isolated to build highly secure and reliable applications.

  •   low cost. You only need to pay for cloud service resources (such as cloud servers, cloud hard drives, etc.) that store and run applications, and you don't need to invest in building, installing, operating and maintaining your own cluster management infrastructure.

 

2.   Noun explanation

noun

Explanation

Mendix

Mendix is ​​a low-code, high-efficiency development platform of Siemens. Regardless of whether you know the code or not, you can quickly build applications on its platform and realize innovative value.

 

For details, please refer to: https://www.mendix.com/

Tencent microservice platform

TSF

Tencent Service Framework (TSF) is a PaaS platform centered around applications and microservices, providing functions such as application lifecycle management, data-based operations, three-dimensional monitoring, and service governance. TSF embraces the Spring Cloud and Service Mesh microservice frameworks to help enterprise customers solve the difficulties of traditional centralized architecture transformation, build a large-scale and highly available distributed system architecture, and realize the rapid implementation of services and products.

 

For more details: https://cloud.tencent.com/product/tsf

Tencent Cloud Container Service

TKE

Tencent Cloud Container Service (Tencent Kubernetes Engine, TKE) provides highly scalable and high-performance container management services based on native kubernetes. Tencent Cloud Container Service is fully compatible with native kubernetes API, and expands Tencent Cloud's cloud hard disk, load balancing and other kubernetes plug-ins, providing containerized applications with a series of complete functions such as efficient deployment, resource scheduling, service discovery, and dynamic scaling to solve user development The environmental consistency of testing and operation and maintenance processes improves the convenience of large-scale container cluster management, helps users reduce costs and improves efficiency.

 

For details: https://cloud.tencent.com/product/tke

VPC  

Virtual Private Cloud (VPC) is an exclusive cloud-based network space built on Tencent Cloud, which provides network services for users' resources on Tencent Cloud. Different private networks are completely logically isolated. Users can customize the network environment, routing tables, security policies, etc.; at the same time, the private network supports multiple ways to connect to the Internet, connect to other VPCs, and connect to users' local data centers, helping users to easily deploy networks on the cloud.

 

For details: https://cloud.tencent.com/product/vpc

CVM

Cloud Server (Cloud Virtual Machine, CVM) provides users with safe and reliable elastic computing services. In just a few minutes, users can obtain and enable CVM in the cloud to achieve their own computing needs.

For more details: https://cloud.tencent.com/product/cvm

 

3. Mendix

3.1 Introduction to Mendix

Mendix is ​​an enterprise-level and efficient development platform of Siemens, which can help companies quickly build applications and save development time. Regardless of whether you know the code or not, you can quickly build your own creative applications on the platform through visualization.

 

3.2 Deploy Mendix based on Kubernetes

The Mendix official website document describes how to deploy Mendix applications on a kubernetes cluster. The deployment architecture diagram is as follows:

 

The entire operating environment uses PostgesSQL as a database for local file storage and deployment and startup through deployment, which can conveniently and effectively control the running number and life cycle of pods. Pod scheduling can be more convenient through label selection.

The Mendix application itself uses the StatefulSet method to start. The StatefulSet is a controller that provides a unique mark to the Pod, which can guarantee the sequence of deployment and expansion. For data storage applications, each pod is stateful, so it needs to be scheduled through StatefulSet.

For the official documents, please refer to: https://docs.mendix.com/developerportal/deploy/run-mendix-on-kubernetes

Currently, users have the following pain points when using this solution for deployment:

* Self-built container clusters and warehouses are required, and the daily operation and maintenance workload is too heavy

* Start the container by writing a yaml file, which has a higher learning cost for beginners

Therefore, in order to solve the above pain points, this article provides the best practices of Mendix deployment based on Tencent Cloud container cluster service.

The solution makes it easier and faster to deploy Mendix applications.

 

4.   Service Development

Tencent Cloud Container Service TKE supports rapid deployment of mendix applications in a managed manner. Users only need to create a working node to start business immediately. The management node is fully hosted in Tencent Cloud Container Service TKE, saving resources and operation and maintenance costs.

 

5.   Preparation

In order to successfully complete this practice, you need to make the following preparations in advance:

  • Log in to the Tencent Cloud console, after registering and real-name authentication, log in to your Tencent Cloud account (go to the link: https://cloud.tencent.com).

  • Confirm that the Tencent Cloud account balance is greater than 100 yuan.

  • If you log in with the main account, you already have access permissions for all resources by default; if you log in with a sub-account, you need to grant relevant permissions in advance, you can go to (https://cloud.tencent.com/document/product/598/ 10600) Check how to use the CAM policy to authorize a machine that can access the public network (you can purchase it on the Tencent Cloud CVM page) for uploading the Mendix application image container service TKE is based on Kubernetes and is a declarative service, and it does not charge any fees. , Charges are based on resources such as load balancing (CLB) and cloud hard disk (CBS) disks actually used by users. For the billing model of the container service TKE related products, please refer to: https://cloud.tencent.com/document/product/457/6770

 

6.   Create a container service cluster

6.1 Create a VPC

First, log in to Tencent Cloud official website https://cloud.tencent.com, enter "proprietary network" in the search box to search

Click to enter the VPC console, select the region according to the business, this article takes the Guangzhou area as an example, click "New"

Go to the following page and complete the VPC creation according to the actual situation

 

6.2 Create a mirror warehouse


In the console, in the cloud product drop-down box, select "container service" and click to enter

Click "Mirror Repository" -> "My Mirror" -> "Namespace", create a namespace in the corresponding region, and be careful not to have the same name as an existing namespace, then click on "My Mirror" to create a mirror repository "mendix" -test".

 

6.3 Upload Mendix Image

Pull the docker image of the Mendix application that has been built on a machine that can access the public network, and adjust the bandwidth of the public network appropriately to help speed up the download speed of the image.

The image comes from the image of the Docker hub warehouse, see: https://hub.docker.com/r/qs0qdd/heartracking

If you want to build the docker image of Mendix application by yourself, you can refer to: https://github.com/mendix/docker-mendix-buildpack

The following are the specific steps:

6.3.1 Log in to the machine

Log in to the machine used to push the image with the command line tool:

6.3.2 Download Mendix container image

Download the Mendix image file:

wget https://mendix-1300555551.cos.ap-chengdu.myqcloud.com/heartracking.tar

6.3.3 Install Docker

Install Docker and start the service:

yum install -y yum-utils  device-mapper-persistent-data  lvm2   yum-config-manager --add-repohttps://download.docker.com/linux/centos/docker-ce.repoyum install docker-ce-18.09.1 docker-ce-cli-18.09.1 containerd.io systemctl start docker.servicedocker version

6.3.4 Log in to the mirror warehouse

To log in to the Tencent Cloud Mirror Warehouse, you need to set an access password on the console first.

docker login --username=100008538562 ccr.ccs.tencentyun.com

6.3.5 Import and push image

Refer to the instructions on the console to import and push the image.

After the push is complete, click to enter the mirror warehouse Mendix created before to view the mirror information.

6.4 Create a container cluster

In the console, go to the "Cluster" page of "Container Service", select the region, and click "New using template" to create a Kubernetes cluster:

Click "Standard Cluster" to create a standard managed cluster:

On the "Cluster Information" page, select the previously created VPC network, assign the container network CIDR, and click "Next":

In the worker configuration, select the availability zone and node network according to the actual situation. The managed version of Kubernetes only needs to create the Worker node, and the Master node is created and hosted by the container service. To create a Worker node, select one, and then click "Next":

Configure the login method of the worker node cloud server, and then click "Next":

Finally, enter the "Information Confirmation" page and click "Finish" to enter the cluster creation process. This process needs to wait about 10 minutes:

 

7.   Deploy Mendix container cluster

7.1 Deploy the database

Click "Cluster" on the Container Service console to enter the newly created cluster, and then create a new deployment in "Workload".

Fill in the workload name, select the corresponding namespace, select deployment for the type, and then directly search for postgres in the Docker hub image column to select the image when selecting the image.

Then you need to add environment variables POSTGRES_DB, POSTGRES_USER, and POSTGRES_PASSWORD to the container startup.

Finally, set the service. Here, select "Access within the cluster only" as the access method, and then click Create.

 

7.2 Deploy Mendix Application

Back to the cluster page, click New deployment under "Workload", select StatefulSet as the type, and select the image that was pushed on the machine before.

Two new items are added to the environment variables, where ADMIN_PASSWORD is the administrator password of the Mendix application, and DATABASE_ENDPOINT is the connection string for accessing the Mendix application database.

Configure the service, select the public network access method, set the port to 80, and then click Finish and wait for the application to be created.

At this point, you can see that the two container applications are already running normally.

Click "Services and Routing", you can view the access IP of the CLB bound to the Mendix application.

Enter the IP directly on the browser to access, enter the user name mendix and password, and click "Sign in".

As shown in the figure, it is the effect display page of the Mendix application. So far, the deployment process of the mendix application on Tencent Cloud has been completed.


For more information, please visit the following link:

Mendix official website: https://www.mendix.com/zh/

Mendix industry solutions: https://solutions.mendix.com/

Mendix platform guide: https://www.mendix.com/evaluation-guide/

Mendix animation display: https://www.mendix.com/demos/

Mendix public account

 

thanks for reading!

Guess you like

Origin blog.csdn.net/Mendix/article/details/115224567