diff --git a/README.en.md b/README.en.md index 6603eac4529f1278718c6ba4080307043280ab3c..8e7f06098db22784a119d47571547abc232f6e7b 100644 --- a/README.en.md +++ b/README.en.md @@ -1,36 +1,17 @@ # KubeOS - -#### Description -Kubernetes Operating System simplifies OS updating - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +## Introduction +KubeOS is a lightweight OS designed for scenarios where services run in containers. KubeOS connects OSs as components to Kubernetes by kubernetes crd and operator, so that the OSs are in the same position as services. With KubeOS, a Kubernetes cluster manages containers and OSs of woker nodes in a unified system. +## Architecture +You can see KubeOS architecture in : [architecture](docs/design/architecture_en.md) +## Getting Started +### Build from source and deploy +You can get how to build from source in : [quick-start.md](docs/quick-start.md). + +### User Guide +You can see KubeOS User Guide in :[user guide](https://docs.openeuler.org/en/docs/22.03_LTS_SP1/docs/KubeOS/about-kubeos.html) + +## How to Contribute +We always welcome new contributors. We are happy to provide guidance for the new contributors. You can contribute via issues and merge requests. + +## Licensing +KubeOS is licensed under the Mulan PSL v2. diff --git a/README.md b/README.md index 6ed6620c3badf96ab237f86543301b44b24cfd07..7f325623e3cfb27eae62273408a3d1ca413c9b2f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # KubeOS -KubeOS is an OS fully designed for Cloud Native environment. It simplifies OS updating by utilizing an operator in kubernetes cluster. The operator updates the whole OS as an entirety in the form of image instead of software packages. So workload and system can be managed in the same way which reduces the complexity of updating. Operator manages OS like deployments in kubernetes, including rolling update. - -## Build from source -Please see [quick-start.md](docs/quick-start.md). - -## Deploy -Please see [quick-start.md](docs/quick-start.md) first and must be very careful about RBAC when deploying in production. KubeOS will let kubernetes to manage node updates and reboots, so use at your own risk. - +## Introduction +KubeOS 是针对业务以容器的形式运行的场景,专门设计的一种轻量级操作系统。KubeOS 通过 kubernetes CRD + operator 扩展机制将将 OS 作为组件接入 kubernetes,使 OS 和业务处于同等地位,用户通过 kubernetes 集群统一管理节点上的容器和节点 OS,实现一套系统管理容器和 OS。 +## Architecture +KubeOS架构的介绍请见: [architecture](docs/design/architecture.md) +## Getting Started +### Build from source and deploy +从源码构建指南请见: [quick-start.md](docs/quick-start.md). +### User Guide +用户指南请见:[user guide](https://docs.openeuler.org/zh/docs/22.03_LTS_SP1/docs/KubeOS/overview.html) ## How to Contribute -We always welcome new contributors. We are happy to provide guidance for the new contributors. You can contribute via issues and merge requests. - +我们非常欢迎新贡献者加入到项目中来,也非常高兴能为新加入贡献者提供指导和帮助。您可以通过issue或者合入PR来贡献 ## Licensing -KubeOS is licensed under the Mulan PSL v2. +KubeOS 使用 Mulan PSL v2. diff --git a/docs/design/architecture.md b/docs/design/architecture.md new file mode 100644 index 0000000000000000000000000000000000000000..69c3c11559594f82f3c1f298710727c610af76b1 --- /dev/null +++ b/docs/design/architecture.md @@ -0,0 +1,42 @@ +# KubeOS + +## 概述 + +在云场景中,容器和 kubernetes 的应用越来越广泛。然而,当前对容器和 OS 进行独立管理的方式,往往面临功能冗余、两套调度系统协同困难的问题。另外,OS 的版本管理比较困难,相同版本的 OS 在使用过程中会各自安装、更新、删除软件包,一段时间后 OS 版本变得不一致,导致版本分裂,并且 OS 可能和业务紧耦合,造成大版本升级等比较困难。为了应对上述问题,openEuler 推出了基于openEuler 的容器操作系统 KubeOS 。 + +容器 OS 是针对业务以容器的形式运行的场景,专门设计的一种轻量级操作系统。基于 openEuler 的 KubeOS 将容器 OS 作为组件接入 kubernetes,使容器 OS 和业务处于同等地位,通过 kubernetes 集群统一管理容器和容器 OS,实现一套系统管理容器和 OS。 + +KubeOS 通过 kubernetes operator 扩展机制控制容器 OS 的升级流程,对容器 OS 进行整体升级,从而实现 OS 管理器和业务协同,该升级方式会在容器 OS 升级前,将业务迁移到其他非升级节点,减少 OS 升级、配置过程中对业务的影响。该升级方式是对容器 OS 进行原子升级,使 OS 一直向预想的状态同步,保证集群里的 OS 版本一致,避免版本分裂问题。 + +## 架构介绍 + +### KubeOS架构 + +**图1** KubeOS 架构 + +![](./figures/kubeos-architecture.png) + +如图所示,KubeOS 主要包含三个组件 os-operator,os-proxy 和 os-agent 。os-operator 和 os-proxy 运行在容器中,部署在 kubernetes 集群内;os-agent 不属于集群,直接作为进程运行在 Worker Node 中。 + +- os-operator:全局的容器 OS 管理器,持续查看所有节点的容器 OS 版本信息,并根据用户配置的信息控制同时进行升级的节点个数,并标记准备升级的节点。 + +- os-proxy:单节点的 OS 管理器,持续查看当前节点的容器 OS 版本信息。如果当前节点被 os-operator 标记为准备升级的节点后,锁定节点并驱逐 pod,转发升级信息到 os-agent 。 + +- os-agent:接收来自 proxy 的信息,从 OSImage Server 下载用于更新的容器 OS 镜像,然后进行升级并重启节点。 + + +### KubeOS 文件系统 + +**图 2** KubeOS 文件系统布局 + +![](./figures/file-system-layout-of-kubeos.png) + + + +如图所示,KubeOS 包含四个分区: + +- boot 分区:grub2 文件分区 +- Persist 分区:用于存放持久性用户数据,容器 OS 升级时,该分区的数据也会保留 +- 两个 root 分区:KubeOS 采用双分区模式,将 root 分区划分为 rootA 和 rootB。假定初始化时,系统运行在 rootA 分区上,当进行系统更新时,会下载新系统到 rootB 分区,grub 会有两个启动项分别为 A,B,将 grub 默认启动项设置为 B,最后会重启虚拟机。虚拟机启动后 KubeOS 将运行在刚更新过的 rootB 分区上。 + +KubeOS 的 root 文件系统为只读,用户的持久化数据存放在 Persist 持久化数据分区。 \ No newline at end of file diff --git a/docs/design/architecture_en.md b/docs/design/architecture_en.md new file mode 100644 index 0000000000000000000000000000000000000000..885bd1ec03db87c8f5e525487cf001c499aa13e1 --- /dev/null +++ b/docs/design/architecture_en.md @@ -0,0 +1,40 @@ +# About KubeOS + +## Introduction + +Containers and Kubernetes are widely used in cloud scenarios. However, a current manner of managing the containers and the OSs separately usually faces problems of function redundancy and difficult collaboration between scheduling systems. In addition, it is difficult to manage OS versions. Software packages are installed, updated, and deleted separately in OSs of the same version. After a period of time, the OS versions become inconsistent, causing version fragmentation. Besides, the OSs may be tightly coupled with services, making it difficult to upgrade major versions. To solve the preceding problems, openEuler provides KubeOS, a container OS upgrade tool based on openEuler. + +Container OSs are lightweight OSs designed for scenarios where services run in containers. KubeOS connects container OSs as components to Kubernetes, so that the container OSs are in the same position as services. With KubeOS, a Kubernetes cluster manages containers and container OSs in a unified system. + +KubeOS is a Kubernetes operator for controlling the container OS upgrade process and upgrading the container OSs as a whole to implement collaboration between the OS managers and services. Before the container OSs are upgraded, services are migrated to other nodes to reduce the impact on services during OS upgrade and configuration. In this upgrade pattern, the container OSs are upgraded atomically so that the OSs remain synchronized with the expected status. This ensures that the OS versions in the cluster are consistent, preventing version fragmentation. + +## Architecture + +### KubeOS Architecture + +**Figure 1** KubeOS architecture + +![](./figures/kubeos-architecture-en.png) + +As shown in the preceding figure, KubeOS consists of three components: os-operator, os-proxy, and os-agent. The os-operator and os-proxy components run in containers and are deployed in the Kubernetes cluster. os-agent is not considered a cluster component. Its instances run on worker nodes as processes. + +- os-operator: global container OS manager, which continuously checks the container OS versions of all nodes, controls the number of nodes to be upgraded concurrently based on the configured information, and marks the nodes to be upgraded. + +- os-proxy: OS manager of a single node, which continuously checks the container OS version of the node. If a node is marked as the node to be upgraded by os-operator, the node is locked, the pod is evicted, and the upgrade information is forwarded to os-agent. + +- os-agent: receives information from os-proxy, downloads the KubeOS image used for upgrade from the OS image server, upgrades the container OS, and restarts the node. + + +### File System of a Container OS + +**Figure 2** File system layout of KubeOS + +![](./figures/file-system-layout-of-kubeos-en.png) + +As shown in the figure,KubeOS comprises four partitions: + +- boot partition: GRUB2 file partition. +- Persist partition: stores persistent user data. When the KubeOS is upgraded, the data in this partition is retained. +- Two root partitions: KubeOS use the dual-partition mode with two root partitions, rootA and rootB. Assume that the container runs the OS stored in the rootA partition after initialization. When the system is upgraded, the new system is downloaded to the rootB partition. GRUB has two boot options: A and B. The default boot option of GRUB is set to B and the node is restarted. After the node is started, the container runs the upgraded OS in the rootB partition. + +The root file system of KubeOS is read-only. Users' persistent data is stored in the Persist partition. diff --git a/docs/design/figures/file-system-layout-of-kubeos-en.png b/docs/design/figures/file-system-layout-of-kubeos-en.png new file mode 100644 index 0000000000000000000000000000000000000000..add62e72f85b103b7dd5780d2e360049f5f712df Binary files /dev/null and b/docs/design/figures/file-system-layout-of-kubeos-en.png differ diff --git a/docs/design/figures/file-system-layout-of-kubeos.png b/docs/design/figures/file-system-layout-of-kubeos.png new file mode 100644 index 0000000000000000000000000000000000000000..7dfdcb3aaef79462ecc196159659b22cb21b9a9d Binary files /dev/null and b/docs/design/figures/file-system-layout-of-kubeos.png differ diff --git a/docs/design/figures/kubeos-architecture-en.png b/docs/design/figures/kubeos-architecture-en.png new file mode 100644 index 0000000000000000000000000000000000000000..7834a3793b73c49ddd046502c65335a08f576c30 Binary files /dev/null and b/docs/design/figures/kubeos-architecture-en.png differ diff --git a/docs/design/figures/kubeos-architecture.png b/docs/design/figures/kubeos-architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..626071e62735bab2e33ec2a6f1a5839409d33319 Binary files /dev/null and b/docs/design/figures/kubeos-architecture.png differ