Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does the smart home giant Aqara build the Internet of things micro-service platform based on KubeSphere?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the smart home giant Aqara based on KubeSphere how to build the Internet of things micro-service platform, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Background

From traditional operation and maintenance to containerized Docker Swarm choreography, from Docker Swarm to Kubernetes, then running SpringCloud micro services family bucket in Kubernetes, finally embracing KubeSphere, and building its own Internet of things micro service platform based on KubeSphere, Lvmi Lianchuang has been running KubeSphere and Kubernetes steadily in production environment for more than half a year, and has accumulated rich experience in micro service application development as well as application platform operation and maintenance. This article is contributed by Wei Hengsheng and Xu Yangbing, operation and maintenance engineers of Shenzhen Lvmi Lianchuang Technology Co., Ltd., and the picture material is from Aqara's official website (https://www.aqara.com/).

Introduction to Aqara

Established in 2009 and headquartered in Shenzhen, Shenzhen Lvmi Lianchuang Technology Co., Ltd. covers ultra-low power wireless sensors, Zigbee wireless network technology, smart home gateway edge computing technology, algorithm and AI, platform openness and access capabilities, etc. In 2016, Shenzhen Lvmi Lianchuang Technology Co., Ltd. launched its own brand Aqara with the concept of "whole house intelligence" (Aqara comes from the Latin word acutula, which means smart, ARA means to go home, and Aqara combines the two means that the family is becoming more and more intelligent). Aqara is committed to building a more intelligent life for users through a series of smart home product technologies and service provider models. Aqara's products include temperature, humidity, doors and windows, human body, flooding, smoke, gas, lighting and sleep sensors, as well as smart switches, sockets, curtain motors, air conditioning controllers, dimmers, door locks and other intelligent controllers, which currently support industry applications of automatic control and big data analysis platform.

Aqara adheres to the vision of "leading IoT technology and serving thousands of families", adheres to the mission of "persevering in the pursuit of user experience and unremitting creation of user experience", innovates constantly in the smart home industry, and finally becomes a leading brand in the industry.

From traditional Operation and maintenance to Container Technology

As soon as he entered the operation and maintenance department, Wei Hengjun, as a senior operation and maintenance engineer with many years of work experience, began to carry the machine to the computer room, unfamiliar with the wire clamp at work, installed the operating system numbly, painstakingly deployed applications and debugged application services, and always felt like a great firefighter when he was awakened by a series of alarms that night.

Data Center (picture from Unsplash)

The rapid iterative update of technology ushered in micro-services, virtualization technology, containerization and cloud native technology. Operation and maintenance has also developed from the initial human flesh operation and maintenance to script operation and maintenance, and then to platform operation and maintenance, and finally to the current container operation and maintenance. The machines I have operated and maintained unwittingly range from dozens of personal maintenance to nearly a thousand servers now, and the traditional application deployment method, each iteration, requires a lot of time to prepare configuration files, operational precautions, databases, and so on, and then go through a group of people for examination and approval, and then send them online. Half a month has passed, in this era of Internet speed. Obviously, the disadvantage of this traditional approach is very obvious, and the container is born of the times.

Using Docker Swarm to build Container choreography system

In the traditional way of deploying applications, the utilization rate of resources is very low, and the time is so long that the bosses gnash their teeth. In this case, I began to come into contact with containers in 2017, trying to develop and test the environment on the company. At that time, the resource utilization rate of the development and test environment directly to the company was increased by 50%. By 2018, Docker Swarm layout containers will be used in the production environment, which will significantly improve the utilization of resources.

It has been arduous step by step from the command line to scripting and finally to platform. When I just joined the Green Rice family, I found that the operation and maintenance of Green Rice was still in the primitive savage stage. Looking back around, I could only analyze the situation under pressure on my sleeves. I found that more than 80% of the micro-service architecture of Green Rice was memory-based services, and the resource utilization was very low, especially CPU and disk storage. And the iterative speed is not satisfactory. After meditation, I decided to change the situation greatly. From continuous integration, Jenkins, Harbor building, to test environment Docker Swarm orchestration. This greatly improved the delivery speed and quality of the test environment, but gradually found that the volume of business had grown too fast, and the disadvantage of Docker Swarm scheduling was obvious:

Cross-platform support is not effective.

During the peak period of traffic access, the problem of timeout will occur during internal Service communication.

From Docker Swarm to Kubernetes

The era of the three carriages is a thing of the past, and Kubernetes beat Docker Swarm and Mesos to become the de facto standard in the field of container orchestration. As a result, our business architecture has shifted from Docker Swarm to Kubernetes. The choice of Kubernetes took root in my heart a few years ago, especially when nearly 1,000 machines are needed for operation and maintenance recently, a container cloud platform that is friendly and unified by operation and maintenance has become a rigid requirement for our primary micro-service applications based on kubernetes.

Open source container platform selection: embrace KubeSphere

But for the native installation and operation and maintenance Kubernetes or with the help of third-party open source solutions, we finally chose to use third-party open source projects after repeated consideration. It seems that Rancher and KubeSphere have become the choice under consideration.

KubeSphere is an open source project initiated by Qingyun QingCloud and developed jointly by many enterprises. Compared with Rancher and KubeSphere, the latter not only has a refreshing user interface, wizard-style resource creation mode, is completely application-centric, is more inclined to the management of Kubernetes cluster resources, provides elegant API interface, and integrates and packages the functional components commonly used in our operation and maintenance development, such as Jenkins, Harbor, Promethues, Apache SkyWalking, but also supports deployment in any infrastructure environment, so we do not hesitate to choose the KubeSphere container platform.

The compatibility of KubeSphere across multi-cloud platforms and the choice of supporting multiple plug-ins have deepened our understanding of each module of Kubernetes and promoted our pace of orchestrating Kubernetes containers in the production environment. Moreover, KubeSphere liberates the repetitive work that our operators face every day, and reduces the overall maintenance cost of the application. It is a sharp weapon for operation and maintenance and a blessing for Internet companies.

Deployment Architecture of Green Rice Internet of things Micro Service platform

Currently, the company mainly uses 7 servers to build clusters on Tencent Cloud. The configuration specifications of cluster machines are as follows.

Currently, all stateless services run on KubeSphere, stateful data storage services. We use Redis, HBase, Flink, Elasticsearch, MySQL and other cluster services on the cloud.

It has been running for more than half a year so far and there are no major problems, which drives us to plan to migrate all stateful and stateless services in the company's development, testing and production environment to KubeSphere in the near future.

The Design Architecture of Green Rice Internet of things Micro-Service platform

First of all, we can take a look at the business architecture diagram of the Green Rice Internet of things. At present, almost all the services of Green Rice overseas are running on KubeSphere, including Gateway micro-service routing and scheduling, Push, Send push, iftt timing and so on.

Because our business is based on Java, the Green Rice Internet of things micro-service platform is based on SpringCloud framework for micro-service, using Apollo distributed configuration center to manage configuration, Eureka registry service registration and discovery.

Microservice load balancing and service invocation are realized by combining Ribbon and Feign. At the same time, we use Hystrix thread pool to achieve isolation, circuit breaker and degradation, sentinel current restriction, while springcloud-gateway gateway routing is used to achieve route scheduling, log uses the classic ELK combination, and APM uses SkyWalking as the application performance monitoring tool of Java micro-service distributed system.

As shown in the figure above, we use Tencent Cloud for IaaS. Platform (platform layer) is mainly the micro-service of the Internet of things business platform. The vast majority of applications in the Platform layer run on the KubeSphere container platform. All sub-devices connect to Hub devices, that is, intelligent gateways, smart socket gateways, cameras, etc., through Zigbee protocols. Hub devices communicate with the micro-service platform of Lvmi Smart Home through RPC protocol. The micro-service platform provides data for App, SaaS and other applications, and the reverse application invokes the green rice micro-service platform through a series of security authentication and authentication to control smart home devices. The service layer has plug-ins such as link tracking, basic monitoring, CI/CD and so on.

KubeSphere makes it easier for us to get started with Kubernetes, accelerate the launch of Kubernetes in the production environment, significantly improve the efficiency of business iterations, and enable R & D to quickly switch functional modules for deployment and verification of each application.

Up to now, this set of Internet of things micro-service platform has been running for more than half a year in our Lvmi Lianchuang production without major problems. Therefore, we plan to migrate all the stateful and stateless services in the company's development, testing and production environment to KubeSphere in the near future.

Question and answer

Q: did you encounter any problems in the process?

A: yes, for example, the DevOps pipeline solves the War/Jar package release problem. The DevOps pipeline not only needs to solve the problem of packaging images to the image repository, but also is compatible with the deployment of old business war packages distributed through Ansible, but there has been no solution at first.

After some research, I understand that the whole process of DevOps is for jenkins-agent to pull the Pod of the corresponding template and run each process of Pipline, but the problem comes again. After the maven Pod execution of the Java template, it exits, but can not get the compiled Jar package.

Finally, we found that we can log in to the Jenkins server, select Manage Jenkins = > Configure System, find the corresponding template, as shown in the screenshot, and specify mav package-Dpath=$ {target_path} in the Pipline to solve the above problem!

Q: what kind of application development platform can carry the future of smart home?

A: perfect audit, monitoring alarm, permission distribution, and the ability to customize elegant resource expansion and expansion policies, elegant plug-in customization, platform's own general problem self-examination policy, and clear logs. Fortunately, all these are supported on the KubeSphere container platform.

What features or designs of Q:KubeSphere need to be improved?

A: the recommendations are as follows:

The interface language switching is too covert.

Granfana template integration can be a little more flexible.

It is easier to expand the capacity of Kubernetes nodes, and it is best to support the expansion of interfaced nodes.

Create pipeline to support copy from

Running pipeline supports multi-selection batch.

Api documents had better have some example. Nowadays, many required parameters of Swagger interfaces are not readable because they are not readable.

So much for the smart home giant Aqara on how to build the Internet of things micro-service platform based on KubeSphere. I hope the above content can be helpful to everyone and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report