39

k3s--面向低资源x86和arm平台的轻量级Kubernetes版本

 5 years ago
source link: http://dockone.io/article/8662?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【编者的话】为低资源平台而生的K3s,能否在边缘计算中迅速发展

Kubernetes(K8s) 被描述为 一个"便携式、可扩展的管理容器化负载和服务的开源平台,它可以方便的使用声明式配置和自动化。它有一个很大而且快速发展的生态系统。Kubernetes服务、支持和工具随处可见。2014年谷歌开源了Kubernetes项目"。

然而,Rancher实验室首席执行官梁胜解释说:"现有Kubernetes版本往往是内存密集型和对于边缘计算环境过于复杂"。因此,公司开发并推出了K3s,一个轻量级Kubernetes版本,旨在为开发者和运营商提供一种可以在资源受限的常见硬件平台(x86、arm64-v8a、armeabi-v7a)上运行Kubernetes的方法,而不是云上运行。

k3s.png

Rancher实验室设法减少Kubernetes资源占用,并主要通过以下四个主要步骤来更好的适应入门级硬件:

  • 删除旧的、非必须的代码:K3s不包括任何默认禁用的Alpha功能或者所有非默认许可控制器,in-tree云提供商和存储驱动程序也被默认禁用,但允许用户添加任何他们需要的驱动程序。
  • 整合正在运行进程的打包:为了节省RAM,通常在Kubernetes管理服务器上运行的多个进程合并为单个进程,包括的kubelet、kubeproxy和flannel代理进程。
  • 使用containerd代替Docker作为运行时的容器引擎:切换到containderd,删除libnetwork、swarm、Docker存储驱动程序和其他插件等功能,Rancher大大降低了资源占用。
  • 引入SQLite作为可选的数据库:Rancher在K3s中添加了SQLite作为可选的数据库,作为etcd的一个轻量级的替代方案。

这个使得很容易安装轻量级Kubernetes版本,不到40MB的二进制档案,只需要512MB的RAM来运行服务器,每个节点运行需要75MB的RAM,基于Linux 3.10或更高版本。

一个公司的使用案例是:管理30000多个风力涡轮机的金风科技智能能源,利用K3s使得他们在成千上万的边缘设备上部署Kubernetes集群。

在树莓派上安装K3s的指令可以在 Medium 找到,基本上如果你已经有一个为板子配置好镜像,你所要做的是运行:

curl -sfL https://get.k3s.io | sh -

这将自动根据你的架构平台安装K3s架构(arm64、armhf),更多细节可以访问 官方网站K3s github repo .

运行服务器:

sudo k3s server &

sudo k3s kubectl get node

和一个代理:

sudo k3s agent --server https://myserver:6443 --token ${NODE_TOKEN}1

NODE_TOKEN来自服务器的

/var/lib/rancher/k3s/server/node-token

作为“ CI/CD for embedded development with an ESP8266, Arduino-cli, Gitlab-ci, Raspberry Pi, and Kubernetes ”讨论的一部分,K3s在 FOSDEM 2019 也有介绍。

原文链接: K3s Lightweight Kubernetes Distribution Targets Low Resources x86 and Arm Platforms (译者:姜俊厚)


Recommend

  • 37
    • www.infoq.cn 5 years ago
    • Cache

    KubeEdge 向左,K3S 向右

    边缘计算场景分类与挑战 这里要讨论的“边缘”特指计算资源在地理分布上更加靠近设备,而远离云数据中心的资源节点。典型的边缘计算分为物联网(例如:下一代工业自动化,智慧城市,智能家居,大型商超等)和非物联网(例如:游...

  • 31
    • 微信 mp.weixin.qq.com 4 years ago
    • Cache

    刚刚 GA 的 k3s 究竟是什么?

    2019年11月19日,业界应用最为广泛的Kubernetes管理平台创建者Rancher Labs(以下简称Rancher)宣布,Rancher打造的轻量级Kubernetes发行版 k3s正式GA ,这是k3s一个里程碑版本。K3s是一个通过了CNCF一致性认证的轻量级Kubernetes发行版...

  • 19

    一个 API 资源对象的 Schema 的唯一标识由 apiVersion 和 kind 组成,其中 apiVersion 又分为 Group 和 Version。例如: Group Version Kind apps v1 Deployment kubernetes 的 apiVersion 有很多,...

  • 17
    • www.infoq.cn 4 years ago
    • Cache

    轻量级 Kubernetes k3s 初探

    1 k3s 简介–5 less than K8s k3s [1] 是 rancher®开源的一个 Kubernetes 发行版,从名字上就可以看出 k3s 相对 k8s 做了很多裁剪和优化,二进制程序不足 50MB,占用资源更少,只需要 512MB 内存即可运行。 而之所以...

  • 22

    面向Windows 10的4款轻量级浏览器 本文选出了面向Windows 10的几款轻量级浏览器。虽然是轻量级,您可以在不牺牲基本功能的情况下将它们全用作常规浏览器。它们都通过多个防病毒引擎加以扫描,确保百分之百安全,随带有效的隐...

  • 13
    • blog.kubernauts.io 3 years ago
    • Cache

    K3s with k3d and MetalLB

    K3s with k3d and MetalLB

  • 40
    • blog.alexellis.io 3 years ago
    • Cache

    Bare-metal Kubernetes with K3s

    Bare-metal Kubernetes with K3s Learn how to configure K3s on bare-metal to run a Kubernetes cluster with just as much resilience and fault tolerance as a managed service. This tu...

  • 7

    K3s - Lightweight Kubernetes Lightweight Kubernetes. Production ready, easy to install, half the memory, all in a binary less than 100 MB. Great for: Development Embedding k8s Situations where a...

  • 11

    k0s vs k3s vs microk8s Kubernetes Distributions ComparisonThe journey into the land of microservices where most people concur that it is paved with the warmth of glory can be hard to go through. As the philosophies, tools, skills and technolo...

  • 5

    kwebio/kweb-core:面向后端的轻量级 Kotlin Web 框架 解道Jdon ...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK