CoreOS，一款 Linux 容器发行版
CoreOS 容器
![](/data/attachment/album/201708/11/094115v4k77706788z9yvk.png)



> 
> CoreOS，一款最新的 Linux 发行版本，支持自动升级内核软件，提供各集群间配置的完全控制。
> 
> 
> 


关于使用哪个版本的 Linux 服务器系统的争论，常常是以这样的话题开始的：



> 
> 你是喜欢基于 [Red Hat Enterprise Linux （RHEL）](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) 的 [CentOS](https://www.centos.org/) 或者 [Fedora](https://getfedora.org/)，还是基于 [Debian](https://www.debian.org/) 的 [Ubuntu](https://www.ubuntu.com/)，抑或 [SUSE](https://www.suse.com/) 呢？
> 
> 
> 


但是现在，一款名叫 [CoreOS 容器 Linux](https://coreos.com/os/docs/latest) 的 Linux 发行版加入了这场“圣战”。[这个最近在 Linode 服务器上提供的 CoreOS](https://www.linode.com/docs/platform/use-coreos-container-linux-on-linode)，和它的老前辈比起来，它使用了完全不同的实现方法。


你可能会感到不解，这里有这么多成熟的 Linux 发行版本，为什么要选择用 CoreOS ？借用 Linux 主干分支的维护者，也是 CoreOS 顾问的 Greg Kroah-Hartman 先生的一句话：



> 
> CoreOS 可以控制发行版的升级（基于 ChromeOS 代码），并结合了 Docker 和潜在的核对/修复功能，这意味着不用停止或者重启你的相关进程，就可以[在线升级](https://plus.google.com/+gregkroahhartman/posts/YvWFmPa9kVf)。测试版本已经支持此功能，这是史无前例的。
> 
> 
> 


当 Greg Kroah-Hartman 做出这段评价时，CoreOS 还处于 α 测试阶段，当时也许就是在硅谷的一个车库当中，[开发团队正在紧锣密鼓地开发此产品](https://www.wired.com/2013/08/coreos-the-new-linux/)，但 CoreOS 不像最开始的苹果或者惠普，其在过去的四年当中一直稳步发展。


当我参加在旧金山举办的 [2017 CoreOS 大会](https://coreos.com/fest/)时，CoreOS 已经支持谷歌云、IBM、AWS 和微软的相关服务。现在有超过 1000 位开发人员参与到这个项目中，并为能够成为这个伟大产品的一员而感到高兴。


究其原因，CoreOS 从开始就是为容器而设计的轻量级 Linux 发行版，其起初是作为一个 [Docker](https://www.docker.com/) 平台，随着时间的推移， CoreOS 在容器方面走出了自己的道路，除了 Docker 之外，它也支持它自己的容器 [rkt](https://coreos.com/rkt) （读作 rocket ）。


不像大多数其他的 Linux 发行版，CoreOS 没有包管理器，取而代之的是通过 Google ChromeOS 的页面自动进行软件升级，这样能提高在集群上运行的机器/容器的安全性和可靠性。不用通过系统管理员的干涉，操作系统升级组件和安全补丁可以定期推送到 CoreOS 容器。


你可以通过 [CoreUpdate 和它的 Web 界面](https://coreos.com/products/coreupdate/)上来修改推送周期，这样你就可以控制你的机器何时更新，以及更新以多快的速度滚动分发到你的集群上。


CoreOS 通过一种叫做 [etcd](https://github.com/coreos/etcd) 的分布式配置服务来进行升级，etcd 是一种基于 [YAML](http://yaml.org/) 的开源的分布式哈希存储系统，它可以为 Linux 集群容器提供配置共享和服务发现等功能。


此服务运行在集群上的每一台服务器上，当其中一台服务器需要下线升级时，它会发起领袖选举，以便服务器更新时整个Linux 系统和容器化的应用可以继续运行。


对于集群管理，CoreOS 之前采用的是 [fleet](https://github.com/coreos/fleet) 方法，这将 etcd 和 [systemd](https://www.freedesktop.org/wiki/Software/systemd/) 结合到分布式初始化系统中。虽然 fleet 仍然在使用，但 CoreOS 已经将 etcd 加入到 [Kubernetes](https://kubernetes.io/) 容器编排系统构成了一个更加强有力的管理工具。


CoreOS 也可以让你定制其它的操作系统相关规范，比如用 [cloud-config](https://coreos.com/os/docs/latest/cloud-config.html) 的方式管理网络配置、用户账号和 systemd 单元等。


综上所述，CoreOS 可以不断地自行升级到最新版本，能让你获得从单独系统到集群等各种场景的完全控制。如 CoreOS 宣称的，你再也不用为了改变一个单独的配置而在每一台机器上运行 [Chef](https://insights.hpe.com/articles/what-is-chef-a-primer-for-devops-newbies-1704.html) 了。


假如说你想进一步的扩展你的 DevOps 控制，[CoreOS 能够轻松地帮助你部署 Kubernetes](https://blogs.dxc.technology/2017/06/08/coreos-moves-in-on-cloud-devops-with-kubernetes/)。


CoreOS 从一开始就是构建来易于部署、管理和运行容器的。当然，其它的 Linux　发行版，比如 RedHat 家族的[原子项目](http://www.projectatomic.io/)也可以达到类似的效果，但是对于那些发行版而言是以附加组件的方式出现的，而 CoreOS 从它诞生的第一天就是为容器而设计的。


当前[容器和 Docker 已经逐渐成为商业系统的主流](http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/)，如果在可预见的未来中你要在工作中使用容器，你应该考虑下 CoreOS，不管你的系统是在裸机硬件上、虚拟机还是云上。


如果有任何关于 CoreOS 的观点或者问题，还请在评论栏中留言。如果你觉得这篇博客还算有用的话，还请分享一下~




---


关于博主：Steven J. Vaughan-Nichols 是一位经验丰富的 IT 记者，许多网站中都刊登有他的文章，包括 [ZDNet.com](http://www.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/)、[PC Magazine](http://www.pcmag.com/author-bio/steven-j.-vaughan-nichols)、[InfoWorld](http://www.infoworld.com/author/Steven-J.-Vaughan_Nichols/)、[ComputerWorld](http://www.computerworld.com/author/Steven-J.-Vaughan_Nichols/)、[Linux Today](http://www.linuxtoday.com/author/Steven+J.+Vaughan-Nichols/) 和 [eWEEK](http://www.eweek.com/cp/bio/Steven-J.-Vaughan-Nichols/) 等。他拥有丰富的 IT 知识 - 而且他曾参加过智力竞赛节目 Jeopardy ！他的相关观点都是自身思考的结果，并不代表 Linode 公司，我们对他做出的贡献致以最真诚的感谢。如果想知道他更多的信息，可以关注他的 Twitter [*@sjvn*](http://www.twitter.com/sjvn)。




---


via: <https://medium.com/linode-cube/the-what-why-and-wow-behind-the-coreos-container-linux-fa7ceae5593c>


作者：[Steven J. Vaughan-Nichols](https://medium.com/linode-cube/the-what-why-and-wow-behind-the-coreos-container-linux-fa7ceae5593c) 译者：[吴霄/toyijiu](https://github.com/toyijiu) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
# The What, Why and Wow! Behind the CoreOS Container Linux

By. Steven J. Vaughan-Nichols

## Latest Linux distro automatically updates kernel software and gives full configuration control across clusters.

The usual debate over server Linux distributions begins with:

*Do you use a **Red Hat Enterprise Linux (RHEL)**-based distribution, such as **CentOS** or **Fedora**; a **Debian**-based Linux like **Ubuntu**; or **SUSE**?*

But now, [CoreOS Container Linux](https://coreos.com/os/docs/latest) joins the fracas. [CoreOS, recently offered by Linode on its servers](https://www.linode.com/docs/platform/use-coreos-container-linux-on-linode), takes an entirely different approach than its more conventional, elder siblings.

So, you may be asking yourself: “Why should I bother, when there are so many other solid Linux distros?” Well, I’ll let Greg Kroah-Hartman, the kernel maintainer for the Linux-stable branch and CoreOS advisor, start the conversation:

(CoreOS) handles distro updates (based on the ChromeOS code) combined with Docker and potentially checkpoint/restore, (which) means that you might be

[able to update the distro under your application without stopping/starting the process/container.]I’ve seen it happen in testing, and it’s scary [good].”

And that assessment came when CoreOS was in alpha. Back then, [CoreOS was being developed in — believe it or not — a Silicon Valley garage](https://www.wired.com/2013/08/coreos-the-new-linux/). While CoreOS is no Apple or HPE, it’s grown considerably in the last four years.

When I checked in on them at 2017’s [CoreOS Fest](https://coreos.com/fest/) in San Francisco, CoreOS had support from Google Cloud, IBM, Amazon Web Services, and Microsoft. The project itself now has over a thousand contributors. They think they’re on to something good, and I agree.

Why? Because, CoreOS is a lightweight Linux designed from the get-go for running containers. It started as a [Docker](https://www.docker.com/) platform, but over time CoreOS has taken its own path to containers. It now supports both its own take on containers, [rkt](https://coreos.com/rkt) (pronounced rocket), and Docker.

Unlike most Linux distributions, CoreOS doesn’t have a package manager. Instead it takes a page from Google’s ChromeOS and automates software updates to ensure better security and reliability of machines and containers running on clusters. Both operating system updates and security patches are regularly pushed to CoreOS Container Linux machines without sysadmin intervention.

You control how often patches are pushed using [CoreUpdate, with its web-based interface](https://coreos.com/products/coreupdate/). This enables you to control when your machines update, and how quickly an update is rolled out across your cluster.

Specifically, CoreOS does this with the the distributed configuration service [etcd](https://github.com/coreos/etcd). This is an open-source, distributed key value store based on [YAML](http://yaml.org/). Etcd provides shared configuration and service discovery for Container Linux clusters.

This service runs on each machine in a cluster. When one server goes down, say to update, it handles the leader election so that the overall Linux system and containerized applications keep running as each server is updated.

To handle cluster management, [CoreOS used to use fleet](https://github.com/coreos/fleet). This ties together [systemd](https://www.freedesktop.org/wiki/Software/systemd/) and etcd into a distributed init system. While fleet is still around, CoreOS has joined etcd with [Kubernetes](https://kubernetes.io/) container orchestration to form an even more powerful management tool.

CoreOS also enables you to declaratively customize other operating system specifications, such as network configuration, user accounts, and systemd units, with [cloud-config](https://coreos.com/os/docs/latest/cloud-config.html).

Put it all together and you have a Linux that’s constantly self-updating to the latest patches while giving you full control over its configuration from individual systems to thousand of container instances. Or, as CoreOS puts it, “You’ll never have to run [Chef ](https://insights.hpe.com/articles/what-is-chef-a-primer-for-devops-newbies-1704.html)on every machine in order to change a single config value ever again.”

Let’s say you want to expand your DevOps control even further. [CoreOS helps you there, too, by making it easy to deploy Kubernetes](https://blogs.dxc.technology/2017/06/08/coreos-moves-in-on-cloud-devops-with-kubernetes/).

So, what does all this mean? CoreOS is built from the ground-up to make it easy to deploy, manage and run containers. Yes, other Linux distributions, such as the Red Hat family with [Project Atomic](http://www.projectatomic.io/), also enable you to do this, but for these distributions, it’s an add-on. CoreOS was designed from day one for containers.

If you foresee using containers in your business — and you’d better because [Docker and containers are fast becoming The Way to develop and run business applications](http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/) — then you must consider CoreOS Container Linux, no matter whether you’re running on bare-metal, virtual machines, or the cloud.

*Please feel free to share below any comments or insights about your experience with or questions about CoreOS. And if you found this blog useful, please consider sharing it through social media.*

*About the blogger: Steven J. Vaughan-Nichols is a veteran IT journalist whose estimable work can be found on a host of channels, including **ZDNet.com**, **PC Magazine**, **InfoWorld**, **ComputerWorld**, **Linux Today** and **eWEEK**. Steven’s IT expertise comes without parallel — he has even been a Jeopardy! clue. And while his views and cloud situations are solely his and don’t necessarily reflect those of Linode, we are grateful for his contributions. He can be followed on Twitter (**@sjvn**).*