Kubic 现在支持 ARM
2019年1月30日 | Guillaume Gardet | 无许可

我们很高兴地宣布,Kubic 官方支持 AArch64,即 64 位 ARMv8!这意味着什么?它与 x86_64 有什么不同?如何安装和使用它?请阅读这篇博文以解答这些问题!
Kubic 支持 AArch64 - 这意味着什么?
这仅仅意味着 Kubic 在 AArch64 上使用的源代码与 Kubic 在 x86_64 上使用的源代码相同,并遵循相同的流程。它在 OBS 中与 openSUSE Tumbleweed 一起构建,在 openQA 中进行测试,如果测试结果足够好,则发布到 官方 openSUSE 下载服务器。
感谢 新的 AArch64 机器,这些机器用于 OBS,以及 openQA 中的一台新的强大机器,但最重要的是,感谢 Kubic 和 openSUSE 社区中许多人的辛勤工作,openSUSE Tumbleweed for AArch64 现在已正式支持,不再是尽力移植的版本。Kubic 是 openSUSE Tumbleweed 的一个版本,也获得了这种新状态。
Kubic 的 AArch64 和 x86_64 版本有什么区别?
这些区别与 Tumbleweed for x86_64 和 Tumbleweed for AArch64 相同,因为 Kubic 完全基于 Tumbleweed 包,并且与 Tumbleweed 同时发布。这意味着
- 由于 openQA 中发现的错误或 ARM 获取 Factory 快照的时间,x86 和 ARM 快照可能会有所不同
- 某些软件包是特定于架构的或可能无法为 aarch64 构建:例如 kubernetes-dashboard
- 某些 ARM 系统不支持 UEFI 并且无法从 Kubic ISO 启动,例如:Pine64 和 Raspberry Pi 3 板。
如何在 AArch64 上安装 Kubic?
支持 UEFI 的系统
如果您的 AArch64 系统支持 UEFI,就像大多数服务器级系统一样,包括 Overdrive 1000、D05 或 ThunderX2(最常见的),您只需像在 x86_64 上一样使用 ISO 安装程序,并按照 Kubic 文档中的说明进行操作,以获取任何 Kubic 特定的信息,网址为 Portal:Kubic。
此外,您可以使用 AutoYaST 配置文件进行自动化安装,还可以使用 PXE/tftpboot。
在 AArch64 上,Kubic 的使用方式,以及文档,与 x86_64 唯一的区别在于下载链接和 RPM 仓库。因此,如果您熟悉 Kubic 在 x86_64 上的使用,那么过渡到 AArch64 将会非常顺利。
不支持 UEFI 的系统:Raspberry Pi 3 和 Pine64 板的 WIP 镜像
如果您的 AArch64 系统不支持 UEFI,则无法使用 ISO 安装 Kubic,您需要一个特殊的镜像才能启动。Kubic 为某些不支持 UEFI 的板提供 MicroOS 和 kubeadm 镜像。目前只有 Pine64 和 Raspberry Pi 3 镜像已构建。这些镜像可在 devel:kubic:images ARM 仓库 中找到,但仍然是 正在进行中。有关详细信息,请参阅 Kubic:MicroOS#Images_for_non-UEFI_ARM_boards wiki 页面。请注意,这些镜像未在 openQA 中进行测试,并在构建完成后立即发布。因此,质量可能因构建而异。请注意,当前的 Pine64 Kubic 镜像需要手动更新 u-boot 才能正确启动。稍后将修复此问题。
以下是在 Raspberry Pi 3 板上启动 cri-o MicroOS 镜像的快速 操作指南
- 从 devel:kubic:images ARM 仓库 下载目标镜像
- 解压缩镜像:
unxz -k openSUSE-Tumbleweed-Kubic.aarch64-*-MicroOS-cri-o-RaspberryPi-Build*.raw.xz - 使用
dd工具将其复制到 µSD 卡:dd if=openSUSE-Tumbleweed-Kubic.aarch64-*-MicroOS-cri-o-RaspberryPi-Build*.raw of=/dev/sdcard_device bs=2M; sync(仔细检查 sdcard 设备,以免覆盖您的 HDD!) - 使用
meta-data和user-data文件创建一个 USB 存储器(分区标签必须为cidata)。这允许您至少设置网络并定义 root/user 详细信息。有关详细信息,请参阅 Kubic:MicroOS/cloud-init - 将 µSD 卡插入您的 Raspberry Pi 3,以及用于 cloud-init 配置的 USB 存储器,可选地是屏幕和 USB 键盘和/或串行电缆,然后通电。您可以在屏幕和/或串行上跟踪启动过程。首次启动会稍长一些,因为需要自动重新分区 µSD 卡。
- 您将最终看到以下屏幕,并能够登录到系统
Welcome to openSUSE Tumbleweed Kubic (aarch64) - Kernel 4.20.0-1-default (ttyS0).
SSH host key: SHA256:N9/yefOKr4MDWfBCieWCtsksJaqEsBQ2DvR1lC4ZBJo (DSA)
SSH host key: SHA256:AFWw989O4kNZBxzo8RSiYG9c7dQwGzIJgwkxQQvKXFg (ECDSA)
SSH host key: SHA256:7z+GpfK8MA+sGqjppiJzC4o2lAlprieYknjAUnJB+fg (ED25519)
SSH host key: SHA256:qMSdqn8z4p7MSQfhh11oXscFrX6rqqCWCVM8etoYacU (RSA)
eth0: 192.168.0.44 2a01:e0a:d7:1620:b070:e21e:e75:6b4
localhost login:
- 您还可以使用 ssh 远程登录到您的系统:
ssh root@RPi3_IP - 现在,MicroOS 已安装在您的 Pi 3 上,您可以开始使用 Kubic MicroOS 了!
接下来是什么?
一旦您的系统安装完成,无论是作为常规 UEFI 系统,还是使用专用即用型镜像,作为 kubeadm 节点还是作为 MicroOS 系统,您就可以开始使用它了。

请记住,Kubic 使用事务更新。因此,请使用 transactional-update 命令代替 zypper,例如:transactional-update dup 代替 zypper dup,并在每次更改后重新启动!有关更多信息,请参阅 Kubic:MicroOS/Design#Transactional_Updates wiki 页面。
kubeadm 测试
- 初始化 kubeadm(根据需要调整网络)
kubeadm init --cri-socket=/var/run/crio/crio.sock --pod-network-cidr=10.244.0.0/16 - 配置 kubectl
mkdir -p ~/.kube cp -i /etc/kubernetes/admin.conf ~/.kube/config - 配置 flannel(podman 网络)
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml - 等待片刻(约 1 分钟)并获取集群信息
kubectl config view --flatten=true kubectl get pods --all-namespaces - 确认节点已准备就绪
kubectl get nodes
MicroOS 测试
Podman
如果您已经熟悉 docker,那么过渡到 podman 将会非常顺利,因为您只需要将大多数命令中的 docker 替换为 podman 即可。
运行 podman hello world 容器
- 使用
podman search --no-trunc hello搜索默认注册表中的 openSUSE 镜像
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/library/hello-world Hello World! (an example of minimal Dockerization) 807 [OK]
docker.io docker.io/library/hello-seattle Hello from DockerCon 2016 (Seattle)! 2 [OK]
docker.io docker.io/tutum/hello-world Image to test docker deployments. Has Apache with a 'Hello World' page listening in port 80. 59 [OK]
docker.io docker.io/dockercloud/hello-world Hello World! 14 [OK]
docker.io docker.io/ansibleplaybookbundle/hello-world-apb An APB which deploys a sample Hello World! app 0 [OK]
docker.io docker.io/ansibleplaybookbundle/hello-world-db-apb An APB which deploys a sample Hello World! app backed with a persistent database. 0 [OK]
docker.io docker.io/wouterm/helloworld A simple Docker image with an Nginx server showing a custom message, based on tutum/hello-world. 0 [OK]
docker.io docker.io/karthequian/helloworld A simple helloworld nginx container to get you started with docker. 12 [OK]
docker.io docker.io/hivesolutions/hello_appier Simple hello world application for Appier. 0 [OK]
docker.io docker.io/microsoft/mcr-hello-world Hello World! (an example of minimal Dockerization). 1
docker.io docker.io/openshift/hello-openshift Simple Example for Running a Container on OpenShift 31
docker.io docker.io/crccheck/hello-world Hello World web server in under 2.5 MB 6 [OK]
docker.io docker.io/seabreeze/sbz-helloworld A HelloWorld example to run on SeaBreeze. 1 [OK]
docker.io docker.io/nginxdemos/hello NGINX webserver that serves a simple page containing its hostname, IP address and port ... 9 [OK]
docker.io docker.io/infrastructureascode/hello-world A tiny "Hello World" web server with a health check endpoint. 0 [OK]
docker.io docker.io/gramercylabs/docker-helloworld hello world 0 [OK]
docker.io docker.io/seabreeze/sbz-helloworld-sidecar Sidecar hello world example for SeaBreeze. 0 [OK]
docker.io docker.io/seabreeze/azure-mesh-helloworld Azure Service Fabric Mesh HelloWorld! 1 [OK]
docker.io docker.io/google/nodejs-hello 24 [OK]
docker.io docker.io/dongxuny/hellotencent Auto build 0 [OK]
docker.io docker.io/ppc64le/hello-world Hello World! (an example of minimal Dockerization) 2
docker.io docker.io/silasbw/hello 0
docker.io docker.io/milsonian/hellohttp Basic hello world http app in golang 0 [OK]
docker.io docker.io/yaros1av/hello-core Hello from ASP.NET Core! 1
docker.io docker.io/widdix/hello Hello World! 0
- 使用
podman pull hello-world拉取hello-world容器
Trying to pull docker.io/hello-world:latest...Getting image source signatures
Copying blob 3b4173355427: 1.05 KiB / 1.05 KiB [============================] 1s
Copying config de6f0c40d4e5: 1.47 KiB / 1.47 KiB [==========================] 0s
Writing manifest to image destination
Storing signatures
de6f0c40d4e5d0eb8e13fa62ccbbdabad63be2753c9b61f495e7f1f486be1443
- 使用
podman run hello-world运行它
Hello from Docker!
This message shows that your installation appears to be working correctly.
您还可以运行 opensuse/tumbleweed 容器
- 使用
podman pull opensuse/tumbleweed拉取opensuse/tumbleweed容器
Trying to pull docker.io/opensuse/tumbleweed:latest...Getting image source signatures
Copying blob 4a91c0fbbc27 41.67 MB / 41.67 MB [=============================] 8s
Copying config 5140b500a548 658 B / 658 B [=================================] 0s
Writing manifest to image destination
Storing signatures
5140b500a5485224cd7c10a6d991b9aa2cfa577ccfc5e325fb0033dd0211a73f
- 使用
podman run -it opensuse/tumbleweed bash启动一个bash(完成操作后,输入exit退出该容器)
:/ #
Docker
由于 docker 不再是 Kubic 的默认设置,但仍然可用,您需要使用 systemctl start docker 手动启动 docker 服务。有关更多信息,请参阅 CRI-O is now our default container runtime interface 博客文章。
运行 docker hello world 容器
- 使用
docker search --no-trunc hello搜索容器列表中的hello
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
hello-world Hello World! (an example of minimal Dockerization) 807 [OK]
tutum/hello-world Image to test docker deployments. Has Apache with a 'Hello World' page listening in port 80. 59 [OK]
openshift/hello-openshift Simple Example for Running a Container on OpenShift 31
google/nodejs-hello 24 [OK]
dockercloud/hello-world Hello World! 14 [OK]
karthequian/helloworld A simple helloworld nginx container to get you started with docker. 12 [OK]
nginxdemos/hello NGINX webserver that serves a simple page containing its hostname, IP address and port ... 9 [OK]
crccheck/hello-world Hello World web server in under 2.5 MB 6 [OK]
hello-seattle Hello from DockerCon 2016 (Seattle)! 2 [OK]
ppc64le/hello-world Hello World! (an example of minimal Dockerization) 2
seabreeze/azure-mesh-helloworld Azure Service Fabric Mesh HelloWorld! 1 [OK]
microsoft/mcr-hello-world Hello World! (an example of minimal Dockerization). 1
yaros1av/hello-core Hello from ASP.NET Core! 1
seabreeze/sbz-helloworld A HelloWorld example to run on SeaBreeze. 1 [OK]
infrastructureascode/hello-world A tiny "Hello World" web server with a health check endpoint. 0 [OK]
gramercylabs/docker-helloworld hello world 0 [OK]
seabreeze/sbz-helloworld-sidecar Sidecar hello world example for SeaBreeze. 0 [OK]
hivesolutions/hello_appier Simple hello world application for Appier. 0 [OK]
wouterm/helloworld A simple Docker image with an Nginx server showing a custom message, based on tutum/hello-world. 0 [OK]
dongxuny/hellotencent Auto build 0 [OK]
ansibleplaybookbundle/hello-world-db-apb An APB which deploys a sample Hello World! app backed with a persistent database. 0 [OK]
silasbw/hello 0
milsonian/hellohttp Basic hello world http app in golang 0 [OK]
ansibleplaybookbundle/hello-world-apb An APB which deploys a sample Hello World! app 0 [OK]
widdix/hello Hello World! 0
- 使用
docker pull hello-world拉取hello-world容器
Using default tag: latest
latest: Pulling from library/hello-world
3b4173355427: Pull complete
Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
Status: Downloaded newer image for hello-world:latest
- 使用
docker run hello-world运行它
Hello from Docker!
This message shows that your installation appears to be working correctly.
您还可以运行 opensuse/tumbleweed 容器
- 使用
docker pull opensuse/tumbleweed拉取opensuse/tumbleweed容器
Using default tag: latest
latest: Pulling from opensuse/tumbleweed
Digest: sha256:c8a83a8333890dc692289441da212270f74525afeb2a37da7a98ab8261060a1b
Status: Downloaded newer image for opensuse/tumbleweed:latest
- 使用
docker run -it opensuse/tumbleweed bash启动一个bash(完成操作后,输入exit退出该容器)
:/ #
接下来是什么?
请记住,小型 ARM 板,例如 Raspberry Pi 3,没有太多 RAM(1 GB 是 MicroOS 的最低推荐配置),如果系统开始交换,您将获得非常低的性能。根据您的需求,您可能需要选择具有更多 RAM 和更强大的 CPU 的系统。有关已知工作系统的列表,请参阅 Portal:ARM wiki 页面。
感谢您使用 Kubic on AArch64,请加入我们,发送您的反馈、代码和其他贡献,并记住,玩得开心!
类别: 博客
标签