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 Kubernetes Cluster based on Raspberry pie raspberry pi

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces how to deploy Kubernetes cluster based on raspberry pie raspberry pi, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Kubernetes clusters can be deployed based on raspberry pie (Raspberry Pi), using MicroK8s or K3s distributions.

For the use of MicroK8s or K3s, please refer to:

Simple comparison between MicroK8s and K3s

Getting started with MicroK8s

MicroK8s- deployed to Windows, macOS, and Raspberry Pi

K3s-lightweight container cluster, quick start

K3s-lightweight container cluster, architecture and high availability

Establish an open source technology stack for globally deployed container cluster applications

1. Prepare raspberry pie

Currently, both https://www.raspberrypi.org 's official OS (https://www.raspberrypi.org/downloads/) and third-party systems (such as Hypriot, Ubuntu Core/Server/Mate) can support it. 4B is recommended and a 64-bit system is recommended.

1.1 install the operating system

Now you can burn the SD card directly using Raspberry Pi Imager. Click the link below to download and install it, and then run it:

Raspberry Pi Imager for Windows

Raspberry Pi Imager for macOS

Raspberry Pi Imager for Ubuntu

You can also download an operating system image and burn it to an SD card (see: welfare: an open source super-useful SD card / USB drive burning tool).

Hypriot- supports ARM64 server operating system

Nvidia and arm cooperate to promote the Intelligence of the Internet of things

1.2 Container Image Warehouse

Docker's mirroring service can be used across platforms, but mirroring is different. The same registry service can be used on arm, but the image needs to have a different identity.

Ubuntu installs private Docker Hub service Harbor

Docker Image Warehouse Service-Nexus

1.3 install the container engine

The container engine on arm is different from x86 system and needs to be compiled and installed separately (there is a distribution version, which can be installed directly through get.docker.com. ).

Compilation and installation of Docker on ARM64

Problems and Solutions of Docker compilation on ARM64

How to use Docker in 96Boards (410C)

Visually manage raspberry pie containers using Portainer or UI for Docker

Installation process:

Sudo apt-get install wget git-corecurl-sSL https://get.docker.com | sh# raspberry pie exclusive script benefits, done in one sentence! Sudo docker-- version# confirms the version number and returns something like: Docker version 19.03.5, build 633a0easudo nano / etc/docker/daemon.json# to add a domestic image Write something as follows: {"registry-mirrors": ["https://registry.docker-cn.com"]}# save (ctrl+o) exit (ctrl+x) sudo systemctl restart docker.service sudo systemctl enable docker.service# restart docker and resident service sudo docker pull portainer/portainer# install docker graphical UIsudo docker volume create portainer_datasudo docker run-d-p 9000-- name portainer-- restart always-v / var/run/docker.sock:/var/run/docker .sock-v portainer_data:/data portainer/portainer# creates a UI container You can enter raspberry pie IP:9000 in the browser to access, set the account password and select local (local) 1.4 to install K8s service software.

There are three main versions: Kubernetes, K3s, and MicroK8s. It includes two parts: the server program and the required system container image. The service program is installed through apt, and the system container image needs to be downloaded to each node separately using container tools such as Docker.

2. Get the system image of K8s sent by raspberry

Raspberries are sent with a system image of K8s, which varies depending on the version of K8s. Installation needs to be based on the choice of the distribution.

Reference:

Getting started with MicroK8s

MicroK8s- deployed to Windows, macOS, and Raspberry Pi

K3s-lightweight container cluster, quick start

K3s-lightweight container cluster, architecture and high availability

3. Make the container image of the raspberry pie application

The raspberry pie needs to use the container image created for the corresponding instruction set CPU and add the tag tag.

3.1 available container mirror sources

Many software provide container images under arm.

Docker mirror sources available for raspberry pie:

Raspberry pie only, https://hub.docker.com/search?q=rasp&type=image

Arm and arm64, https://hub.docker.com/search?q=&type=image&architecture=arm%2Carm64

Arm64v8, https://hub.docker.com/u/arm64v8

Https://hub.docker.com/u/arm32v7

Https://hub.docker.com/u/armhf

The above contains a large number of arm images, and different images represent different container images:

Https://hub.docker.com/r/izone/arm/tags/

Above is a separate image, with different tag representing different service images.

3.2 create your own container image

You can use the same Dockerfile to compile container images that are available under multiple architectures.

You can use os/arch as a special tag or use a custom tag to indicate that it is a mirror under the arm architecture.

Note:

You need to mark the mirror as an arm instruction set via tag, and you need to specify tag when using it.

If you download an image that does not correspond to the hardware environment, the container operation will report an error, but will not indicate the cause of the error.

This is the end of how to deploy a Kubernetes cluster based on raspberry pie raspberry pi. I hope the above content can be helpful to you and learn more. 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