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 to deploy EMQ X edge cluster through K3s on raspberry pie

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to deploy EMQ X edge clusters through K3s on raspberry pie. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Environment

K3s requires that raspberrypi can access google normally. If there are no conditions, it is recommended to try deployment on AWS.

HostnameIP character hardware raspberrypi192.168.1.99server raspberry pie 3emqx1192.168.1.100agent raspberry pie 3emqx2192.168.1.101agent raspberry pie 3 prepare to deploy K3s cluster on raspberry pie

1. Download k3sJing K3s to support x864jinarmhf and arm64. Armhf should be installed on raspberry pie.

$wget https://github.com/rancher/k3s/releases/download/v0.2.0/k3s-armhf$ mv k3s-armhf / usr/local/bin/k3s$ chmod + x / usr/local/bin/k3s

two。 Start Server

$sudo K3s server

3. Join the cluster

a. Check / var/lib/rancher/k3s/server/node-token on the Server node to get node token

$NODE_TOKEN=$ (sudo cat / var/lib/rancher/k3s/server/node-token)

b. On the agent node, execute sudo k3s agent-- server https://192.168.1.99:6443-- token ${NODE_TOKEN} to join the K3s cluster.

4. (optional) external devices use kubectl to manage K3s cluster

a. Select any external device that can communicate with the cluster and have kubectl installed

b. Copy / etc/rancher/k3s/k3s.yaml file to external device ~ / .kube/config

c. Modify ~ / .kube / config to replace https://localhost:6443 with https://192.168.1.99:6443

d. Use kubectl to manage clusters

$kubectl get nodesNAME STATUS ROLES AGE VERSIONemqx2 Ready 29m v1.13.4-k3s.1emqx1 Ready 29m v1.13.4-k3s.1raspberrypi Ready 31m v1.13.4-k3s.1 install HELM install helm client

By visiting: https://github.com/kubernetes/helm/releases. Download the appropriate version of Helm.

1. Download the helm-v2.8.0-linux-amd64.tgz version of this article

two。 Extract the file: tar-zxvf helm-v2.8.0-linux-amd64.tgz

3. Move the extracted helm to the / usr/local/bin directory: mv linux-amd64/helm / usr/local/bin/helm

Note:

It is best to install the Helm client on the machine where the kubectl command line tool is installed, or copy the configuration file generated by installing the kubectl command line tool ($HOME/.kube/config) to the machine installed by the Helm client ($HOME/.kube/config).

Install the Tiller server

Create a Service Account named tiller

$kubectl create serviceaccount tiller-namespace kube-system

Grant the Service Account cluster administrator role named tiller cluster-admin:

The yaml file that binds tiller to the cluster administrator role is as follows:

$cat

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

Internet Technology

Wechat

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

12
Report