In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to quickly deploy EMQ X to Kubernetes from KubeSphere. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can get something through the detailed introduction of this article.
KubeSphere application deployment and management
KubeSphere (kubesphere.io) is an open source application-centric container platform, which builds application store and application lifecycle management based on self-developed OpenPitrix, and provides three rapid deployment methods of applications in v2.1:
Private or public application repositories imported under the enterprise space
Platform-wide App Store
Homemade applications, that is, orchestrating and building applications by adding multiple microservices
Third-party application warehouse
The applications supported by KubeSphere are built on the Helm Chart packaging specification and consist of one or more Kubernetes workloads (Workload) and services (Service). You can quickly complete the visual editing, deployment, management and operation and maintenance of Helm applications by importing public or private application repositories with one click.
Application Store
KubeSphere App Store can be used to share middleware, big data, business applications within the enterprise between teams, manage the life cycle of applications from a business point of view, and quickly deploy applications to Kubernetes in the form of application templates. Externally, it can be used as the basis for building industry delivery standards, delivery processes and delivery paths according to industry characteristics, and as a general application store in the industry, it can respond to different business scenarios according to different needs.
Self-made application
KubeSphere supports guided UI. When each component of the application is containerized, it can help developers quickly build a micro-service application and publish it to Kubernetes by adding multiple micro-service components of the application.
This paper first introduces the first way of application deployment and management supported by KubeSphere, by importing a third-party application repository in the enterprise space, quickly deploying an EMQ X cluster to Kubernetes, and finally accessing the Dashboard service of EMQ X. at the same time, it introduces the characteristics and deployment mode of EMQ X.
What is EMQ X?
EMQ X (emqx.io) is a fully open source, highly scalable, highly available distributed MQTT messaging server for IoT, M2M and mobile applications that can handle tens of millions of concurrent clients. EMQ X is designed for massive mobile / Internet of things / vehicle terminal access, and realizes fast and low-delay message routing between massive physical network devices.
Deploy a simple EMQ X cluster to import the application repository
Create an enterprise space (Workspace), then go to the enterprise space to manage the → application repository, and click create Application Warehouse.
After adding the creation of the application repository, enter https://repos.emqx.io/charts, and then you can create it after verification.
Create a sample project (Namespace), then enter the project, and click deploy New Application under Application load → Application.
At this point, you can see the rapid deployment of the three applications supported by KubeSphere, and select the application repository.
Click to view the EMQ X application template.
Preview the configuration file in the Helm Chart of EMQ X, and then select deploy Application.
Edit Helm Chart
KubeSphere supports visual editing Helm Chart. Refer to the following prompt in Values.yaml and modify 3 of them to the specified values:
Tip: for a more detailed explanation of the Helm Chart parameters of EMQ X, please refer to the official EMQ X Chart of EMQ X.
Namespace: demo-project # replace here with the name of the project you actually created: image: emqx/emqx:v3.2.3 # specify image as emqx/emqx: v3.2.3 ·service: type: NodePort # change service from ClusterIP to NodePort
After the modification, click deploy to deploy the EMQ X cluster to Kubernetes.
View EMQ X deployment status
Application details
In the list of applications, you can see the application status of EMQ X. click to enter the application to view the workload and service status of the application.
View the workload → stateful copy set
After the successful deployment of EMQ X, the stateful replica set (Statefulsets) of 3 copies will be deployed. When it shows that it is running (3lap3), it indicates that the application is deployed successfully.
Access the EMQ X Dashboard service
On the application load → service page, you can see the NodePort exposed by EMQ X and the port mapping. Service port 18083 is mapped to the node's NodePort (such as 32688), that is, the port to which EMQ X Dashboard can access outside the cluster.
Using the access EMQ X Dashboard service, log in to Dashboard using the default account secret admin/public.
In the monitoring list on the home page, you can see the system information of EMQ X Broker, including 3 Nodes and 3 Stats monitoring information, and the status shows Running. Users can view server running status, statistics, connection (Connections), session (Sessions), topic (Topics), subscription (Subscriptions), Plugins and other information through the Web console. For more information about the use of EMQ X, please refer to the EMQ X official documentation (docs.emqx.io).
The three Nodes IP of EMQ X correspond to the three Pod IP of EMQ X Statefulsets.
Deploy persistent EMQ X clusters
EMQ X persists Pods by creating a PVC resource mount / opt/emqx/data/mnesia directory. Before deploying EMQ X, users can deploy load balancers such as Haproxy or Nginx-PLUS, and then create PV or StorageClass in Kubernetes.
The steps to deploy a persistent EMQ X cluster in KubeSphere are similar to the steps above, so only the parameters are prompted here. After the load balancer is ready, you only need to specify the StorageClass-related parameters in the Values.yaml of the visual editing Helm Chart.
Namespace: demo-project # replace here with the name of the project you actually created: persistence enabled=true # set here to true storageClass: local # you can view the storage type image: emqx/emqx:v3.2.3 # via the KubeSphere page or kubectl get sc. Specify image as emqx/emqx:v3.2.3 service: type: NodePort # change service from ClusterIP to NodePort
After the deployment is complete, you can see that the ClusterIP of the emqx Service is 10.233.28.52 (whichever is the actual deployment). Forward ports 1883, 8883, 8080, 8083, 8084 and 18083 of the URL that the load balancer listens to to the ClusterIP of emqx Service.
Tip: if there is a need for a TLS connection, it is recommended to terminate the SSL connection in the load balancer. The TLS secure connection between the client and the load balancer, and the normal TCP connection between the load balancer and EMQ X.
Use it after completion or access it within the cluster: you can access the persistent EMQ X cluster service.
Expand EMQ X cluster
KubeSphere supports rapid expansion of EMQ X cluster with one click, enter the workload → stateful replica set, and click the expanded Button to expand the number of EMQ X replicas to 5. Note that the number of nodes for EMQ X is recommended to be odd.
One click to enter the container terminal
If you need to quickly enter the container terminal during the operation and maintenance of EMQ X cluster, you can find one of the Pod in the stateful copy details page of EMQ X, and click to enter the container under the specified Pod.
KubeSphere is an application-centric container platform built on top of Kubernetes, which supports deployment and operation on any infrastructure, and provides an easy-to-use interface and guided operation mode. While reducing the learning cost of using the container scheduling platform, it greatly reduces the complexity of the daily work of development, testing, operation and maintenance, and aims to solve the pain points of storage, network, security and ease of use of Kubernetes. Help enterprises easily cope with agile development, automated operation and maintenance, rapid application delivery, micro-service governance, multi-tenant management, monitoring log alarm, service and network management business scenarios.
The above is how KubeSphere quickly deploy EMQ X to Kubernetes. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.