提升你 Kubernetes 技能的 5 种方式
Kubernetes

> 
> 值此周年纪念之际，来通过这些深度文章和实践项目了解下 Kubernetes。 
> 
> 
> 


![](/data/attachment/album/202006/16/191023lqq0d5zv5vggr2vg.png)


在云原生的成长期，开发者们发现在一个小型的、原子化的、精简的 Linux 镜像里编写应用程序很方便，这些镜像与它们所运行的服务器共享资源。从技术上讲，这些基于内核命名空间的小环境定义被称为[容器](https://opensource.com/article/18/11/behind-scenes-linux-containers)。随着容器的激增，系统管理员们很快意识到，开发一个不仅能帮助他们管理容器，还能帮助他们管理下面的虚拟化基础设施的工具变得至关重要。于是，[Kubernetes](https://opensource.com/resources/what-is-kubernetes) 应运而生。


Kubernetes 是一个可扩展开源平台，用于管理容器。它可以帮助管理员和开发者们围绕容器管理工作负载、服务和进程。它促进了声明式配置，更容易实现自动化。在它相对较短的生命周期中，它已经催生了一个迅速成长的生态系统，其中包括来自大量公司和项目的服务、支持和工具。


如果你想对这项重要的云技术有更多的了解，这里有一些能帮忙你更深入学习的文章。还有 5 个项目可以帮你把学到的东西付诸实践。


### 遏制容器乱象


2016 年，我们发布了《[使用 Kubernetes 遏制容器乱象](https://opensource.com/life/16/9/containing-container-chaos-kubernetes)》，这是一篇由 Terry Ryan 写的关于 Kubernetes 的介绍性文章，讲述了 Kubernetes 如何帮助管理员和架构师们努力应对容器。如果你想找一篇从底层介绍容器是做什么的以及 Kubernetes 是如何实现容器管理的，那么你应该先读下本文。本文适合零基础的读者，解释了所有重要的概念，因此你能迅速了解相关技术。


如果想进阶了解内核层面发生的一些神奇的事情，请阅读 Jessica Cherry 对 [Kubernetes 命名空间](/article-11749-1.html)的解释。


延伸阅读：


* [一文了解 Kubernetes 是什么？](/article-8800-1.html)
* [Kubernetes 是什么？](/article-8858-1.html)


### Kubernetes：为什么它很重要？


Kubernetes 提供了<ruby> 基础设施即服务 <rt>  Infrastructure-as-a-Service </rt></ruby>（IaaS）解决方案（类似 OpenStack）的便利和一个完整的<ruby> 平台即服务 <rt>  Platform as a Service </rt></ruby>（PaaS）。它为你提供了管理基础设施的抽象能力，以及在裸金属基础层面进行故障排除所需的工具。如果你执着于使用单一的裸金属服务器，你可能需要阅读下 Tim Potter 写的《[你为什么需要 Kubernetes](/article-8902-1.html)》。他的文章对比了 IaaS 和 PaaS，解释了为什么 Kubernetes 如此广泛地被使用。你可能并不是一定需要 Kubernetes 或容器，但是重要的是知道什么情况下需要。


延伸阅读：


* [使用 Kubernetes 的 5 个理由](/article-10973-1.html)
* [你（多半）不需要 Kubernetes](/article-10469-1.html)


### 在树莓派上运行 Kubernetes


熟悉 Kubernetes 的最好方法莫过于自己运行它。不幸的是，不是每个人都有一个云服务基层设施（或者有足够的钱来租用一个）可供其支配。而幸运的是，Chris Collins 提供了《[在树莓派上运行 Kubernetes](/article-8499-1.html)》的教程。结合他的另外几篇关于《[Cloud-init](https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab)》和《[Cloud-init 服务](https://opensource.com/article/20/5/create-simple-cloud-init-service-your-homelab)》的教程（也是在树莓派上运行），你可以搭建任何你想要的家庭实验室，这样你就可以学习如何管理属于自己的开放混合云。


### Kubernetes 命令


一旦你运行起 Kubernetes 后，可以看看 Jessica Cherry 的文章和附带的备忘清单，这个清单列出了所有的[基本的 Kubernetes 命令](https://opensource.com/article/20/5/kubectl-cheat-sheet)。在她的文章中，她解释了 `kubectl` 命令的语法，简单讲述了每个命令和子命令是用来做什么的。


### 有趣的 Kubernetes 项目


没有什么比拥有技术却不知道该怎么用它更令人沮丧的了。例如，在你的办公桌上有一个树莓派是一回事，但是决定它的 CPU 应该用来做什么工作却完全是另一回事。我们发布了很多教程，来指导你完成你的 Kubernetes 之路的探索：


* [Helm](/article-12007-1.html) 是一个 Kubernetes 的包管理器。你可以在它的帮助下，很快熟悉 Kubernetes 环境。
* 学习下 [Operator SDK](https://opensource.com/article/20/3/kubernetes-operator-sdk) 的所有内容，来熟悉 Kubernetes 的对象和操作器。
* [在 Kubernetes 之上搭建网络文件系统（NFS）](https://opensource.com/article/20/6/kubernetes-nfs-client-provisioning)
* 学习如何使用 [Skipper](https://opensource.com/article/20/4/http-kubernetes-skipper) 或 [Traefik](https://opensource.com/article/20/3/kubernetes-traefik) 进行流量调度。


最重要的，花点时间来熟悉容器和 Kubernetes。不论你先把容器化的应用放到服务器、云上还是桌面，它们都是能帮助你理解的重要的范例，因为它们是一个强大的构造，可以让 Linux 的应用变得更好、更健壮、鲁棒性更好、更简单。一定要投入精力去学习它们，你不会后悔的。




---


via: <https://opensource.com/article/20/6/kubernetes-anniversary>


作者：[Seth Kenlon](https://opensource.com/users/seth) 选题：[lujun9972](https://github.com/lujun9972) 译者：[lxbwolf](https://github.com/lxbwolf) 校对：[wxy](https://github.com/wxy)


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


OK
When the cloud was still in its formative years, developers discovered that it was convenient to write applications in small, atomic, minimal Linux images that shared resources with the server they ran on. Technically based on kernel namespaces, these small environment definitions came to be called [containers](https://opensource.com/article/18/11/behind-scenes-linux-containers). As containers proliferated, sysadmins quickly realized it was becoming essential to develop a tool that could help them manage not only containers but also the virtualized infrastructure underneath. And that's when [Kubernetes](https://opensource.com/resources/what-is-kubernetes) was born.

Kubernetes is an extensible open source platform for wrangling containers. It helps administrators and developers manage workloads, services, and processes around containers. It facilitates declarative configuration and easy automation. In its relatively short lifespan, it has fostered a rapidly growing ecosystem with services, support, and tools from many companies and projects.

If you're looking to get better acquainted with this important cloud technology, here are a few articles to help you dive deep and five projects to help you try out what you learn.

## Containing container chaos

In 2016, we published [Containing the container chaos with Kubernetes](https://opensource.com/life/16/9/containing-container-chaos-kubernetes), an introductory article by Terry Ryan about how Kubernetes is helping admins and architects grapple with containers. If you need a ground-level introduction to what containers do and how Kubernetes makes it easy, then this is the article to read first. It assumes no prior knowledge and explains all the most important concepts, so you can get up to speed fast.

For an advanced look into some of the magic happening at the kernel level, read Jessica Cherry's explanation of [Kubernetes namespaces](https://opensource.com/article/19/12/kubernetes-namespaces).

## Kubernetes: Why does it matter?

Kubernetes provides the benefits of an Infrastructure-as-a-Service (IaaS) solution (like OpenStack) and a full Platform as a Service (PaaS). It gives you abstractions for managing infrastructure and the tools you need to troubleshoot at the base level of bare metal. If you have the impulse to cling to a single bare-metal server, you might want to read Tim Potter's take on [why Kubernetes matters](https://opensource.com/article/17/6/introducing-kubernetes). His article compares IaaS and PaaS and gives his perspective on why Kubernetes has been so widely adopted. You don't always need Kubernetes or containers, but it's important to know when you do.

## Run it on a Raspberry Pi

There's no better way to get familiar with Kubernetes than to run it yourself. Unfortunately, not everyone has a cloud (nor the money to rent time on one) at their disposal. Luckily, Chris Collins has provided a guide for running [Kubernetes on a Pi](https://opensource.com/article/20/6/kubernetes-raspberry-pi). Combined with his equally elucidating tutorials about [Cloud-init](https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab) and [Cloud-init services](https://opensource.com/article/20/5/create-simple-cloud-init-service-your-homelab) (also on a Pi), you can build whatever kind of homelab you want so that you can learn how to manage your very own open hybrid cloud.

## Kubernetes commands


Once you have Kubernetes up and running, take a look at Jessica Cherry's article and accompanying cheat sheet that provides you with all the [essential Kubernetes commands](https://opensource.com/article/20/5/kubectl-cheat-sheet). In her article, she explains the syntax of `kubectl`

commands and provides an overview of what each command and subcommand is meant to do.

## Fun Kubernetes projects

Nothing's more frustrating than having access to technology but not knowing what to do with it. For instance, it's one thing to have a Raspberry Pi on your desk, but it's an entirely different matter to decide what it ought to spend its CPU cycles doing. We've published plenty of articles to give some guidance to your Kubernetes explorations:

[Helm](https://opensource.com/article/20/2/kubectl-helm-commands)is a package manager for Kubernetes. Exploring it is an easy way to get comfortable with living in Kubernetes.- Learn all about
[Operator SDK](https://opensource.com/article/20/3/kubernetes-operator-sdk)to get familiar with Kubernetes objects and operators. - Provide a
[network file system (NFS) on top of Kubernetes.](https://opensource.com/article/20/6/kubernetes-nfs-client-provisioning) - Learn how to route traffic with
[Skipper](https://opensource.com/article/20/4/http-kubernetes-skipper)or[Traefik.](https://opensource.com/article/20/3/kubernetes-traefik)

Most importantly, take the time to get comfortable with containers and Kubernetes. Whether you first embrace containerized apps on the server, cloud, or desktop, they're an important paradigm to understand, because they're a powerful construct that's made applications on Linux better, stronger, more robust, and easier. Invest time to learn more about them. You'll be glad you did.

## 1 Comment