translated

This commit is contained in:
geekpi 2017-03-23 10:29:02 +08:00
parent c339648ba4
commit 3d68cf0711

View File

@ -1,93 +1,91 @@
translating----geekpi
How to deploy Kubernetes on the Raspberry Pi
如何在树莓派上部署 Kubernetes
============================================================
> In a few steps, set up your Raspberry Pi with Kubernetes using Weave Net.
> 只用几步,使用 Weave Net 在树莓派上设置 Kubernetes。
![How to deploy Kubernetes on the Raspberry Pi ](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/raspberrypi_cartoon.png?itok=sntNdheJ "How to deploy Kubernetes on the Raspberry Pi ")
>Image by : opensource.com
>图片提供: opensource.com
When I became interested in [ARM][6] devices, and in the Raspberry Pi in particular, my first project was an OpenVPN server.
当我开始对[ARM][6]设备,特别是 Raspberry Pi 感兴趣时,我的第一个项目是一个 OpenVPN 服务器。
By having the Raspberry Pi as a secure gateway to my home network, I could use my phone to control my desktop and remotely play Spotify, open documents, and a bunch of other fun things. I used an existing tutorial for that first project because I was afraid of piping anything into the command line on my own.
通过将 Raspberry Pi 作为家庭网络的安全网关,我可以使用我的手机来控制我的桌面,并远程播放 Spotify打开文档以及一些其他有趣的东西。我在第一个项目中使用了一个现有的教程因为我害怕自己使用命令行。
More on Raspberry Pi
更多关于 Raspberry Pi 的:
* [Our latest on Raspberry Pi][1]
* [What is Raspberry Pi?][2]
* [Getting started with Raspberry Pi][3]
* [Send us your Raspberry Pi projects and tutorials][4]
* [最新的 Raspberry Pi][1]
* [什么是 Raspberry Pi][2]
* [开始使用 Raspberry Pi][3]
* [给我们发送你的 Raspberry Pi 项目和教程][4]
After a few months, that fear dissipated. I expanded upon my original project and isolated the OpenVPN server from the file server using a [Samba server][7]. This was my first project where I didn't follow a tutorial verbatim. Unfortunately, by the end of my Samba project, I realized I hadn't documented anything, so I couldn't replicate it. To recreate it, I had to reread all of the separate guides I had used for reference and piece the project back together.
几个月后,这种恐惧消失了。我扩展了我的原始项目,并使用[ Samba 服务器][7]从文件服务器隔离了 OpenVPN 服务器。这是我第一个没有完全按照教程来的项目。不幸的是,在我的 Samba 项目结束后,我意识到我没有记录任何东西,所以我无法复制它。为了重新创建它,我不得不重新参考那些单独的教程,并将它们放在一起。
I learned a valuable lesson about developer workflow—track all of your changes. I made myself a small git repo locally and recorded all of the commands that I typed into the command line.
我学到了关于开发人员工作流程的宝贵经验 - 跟踪你所有的更改。我在本地做了一个小的 git 仓库,并记录了我输入的所有命令。
### Discovering Kubernetes
### 发现 Kubernetes
In May 2015, I discovered Linux containers and Kubernetes. With Kubernetes, I thought it was fascinating that I could take part in a concept still technically in development—and I actually had access to it. The platform itself and the possibilities it presented were exciting. Up until that point, I had just been running a single program on one Raspberry Pi device. With Kubernetes, I could make more advanced configurations than what was possible previously.
2015 年 5 月,我发现了 Linux 容器和 Kubernetes。我觉得 Kubernetes 很有魅力,我可以使用仍在技术上发展的概念 - 并且我实际上可以用它。平台本身及其所呈现的可能性令人兴奋。直到那时,我刚刚在一块 Raspberry Pi 上运行了一个程序。有了 Kubernetes我可以做出比以前更高级的配置。
At that time, Docker (v1.6, if I remember correctly) on ARM had a bug, which meant running Kubernetes on a Raspberry Pi device was virtually impossible. During those early 0.x releases, Kubernetes changed very quickly. Every time I found a guide for how to set up Kubernetes on AMD64, it was for an older version and it was totally incompatible with what I had at the time.
那时候Docker还是 v1.6,如果我记得正确的话)在 ARM 上有一个 bug这意味着在 Raspberry Pi 上运行 Kubernetes 实际上是不可能的。在早期的 0.x 版本中Kubernetes 的变化很快。每次我在 AMD64 上找到一篇关于如何设置 Kubernetes 的指南时,它还是一个较旧的版本,并且与我当时使用的完全不兼容。
I hacked my way to creating a Kubernetes node on Raspberry Pi anyway, and by the v1.0.1 Kubernetes release, [I had it working][8], using Docker v1.7.1\. This was the first fully functional way to deploy Kubernetes to ARM.
我用自己的方法在 Raspberry Pi 上创建了一个 Kubernetes 节点,而在 Kubernetes v1.0.1 中,我使用 Docker v1.7.1 [让它工作了][8]。这是完全将 Kubernetes 部署到 ARM 的方法。
The advantage of running Kubernetes on Raspberry Pi is that because ARM devices are so small they don't draw a lot of power. If programs are built the right way, it's possible to use the same commands for the same programs on AMD64\. Having small IoT boards creates a great opportunity for education. It's also beneficial for setting up demonstrations you need to travel for, like a conference. Bringing your Raspberry Pi is a lot easier than lugging your (often) large Intel machines.
在 Raspberry Pi 上运行 Kubernetes 的优势在于,由于 ARM 设备非常小巧,因此不会产生大量的功耗。如果程序以正确的方式构建,那么同样可以在 AMD64 上用同样的方法运行程序。有一块小型 IoT 板为教育创造了巨大的机会。用来做演示如在会议中也是非常有用的。使用 Raspberry Pi (通常)比在大型英特尔机器要容易得多。
Now that ARM (both 32- and 64-bit) support is merged into the core in line with [my proposal][9] for it, ARM binaries are automatically released with Kubernetes. Although we haven't got an automated CI (continuous integration) system for ARM yet that automatically makes sure it's working on ARM before PRs can be merged, it's working quite well at the moment.
现在符合[我建议][9]的 ARM32位和64位的支持已被合并到核心中。ARM 的二进制文件会自动与 Kubernetes 一起发布。虽然我们还没有为 ARM 提供自动化的 CI持续集成系统它可以自动在 PR 合并之前确定在它可在 ARM 上工作,它仍然工作得不错。
### Distributed networking on the Raspberry Pi
### Raspberry Pi 上的分布式网络
I discovered Weave Net through [kubeadm][10]. [Weave Mesh][11] is an interesting solution for distributed networking, so I began to read more about it. In December of 2016, I received my first contracting job ever with [Weaveworks][12]. I was part of the internal team that made Weave Net support ARM.
我在 [kubeadm][10] 发现了 Weave Net。[Weave Mesh][11]是一个有趣的分布式网络解决方案,因此我开始阅读更多关于它的内容。在 2016 年 12 月,我在 [Weaveworks][12] 收到了第一份合同工作。我是 Weave Net 中 ARM 支持团队的一员。
I'm excited for the possibility of industrial use cases for running Weave Net on Raspberry Pi, such as factories that need devices to be more mobile. Currently, deploying Weave Scope or Weave Cloud to Raspberry Pi might not be possible (though it is conceivable with other ARM devices) because I guess the software needs more available memory to run well. Ideally, with the 2GB upgrade of Raspberry Pi, I think I would be able to spin up Weave Cloud successfully.
我很高兴可以在 Raspberry Pi 上运行 Weave Net 的工业案例,比如那些需要更加移动化的工厂。目前,将 Weave Scope 或 Weave Cloud 部署到 Raspberry Pi 可能是不可能的(尽管可以考虑使用其他 ARM 设备),因为我猜这个软件需要更多的内存来运行。理想情况下,随着 Raspberry Pi 升级成了 2GB 内存,我想我可以在它上面运行 Weave Cloud 了。
With the Weave Net 1.9 release, Weave Net how has ARM support. Kubeadm (and Kubernetes in general) works on multiple platforms. You can deploy Kubernetes to ARM with Weave just as you would on any AMD64 device by installing Docker, kubeadm, kubectl, and kubelet as usual on all machines. Then, initialize the master machine where the control plane components will run using:
在 Weave Net 1.9 中Weave Net 支持了 ARM。Kubeadm通常是 Kubernetes在多个平台上工作。你可以使用 Weave 将 Kubernetes 部署到 ARM就像在任何 AMD64 设备上一样上安装 Docker、kubeadm、kubectl 和 kubelet。然后在控制面板下初始化主机
```
kubeadm init
```
Next, install your pod network with the following command:
接下来,用下面的命令安装你的 pod 网络:
```
kubectl apply -f https://git.io/weave-kube
```
Previously, you could only install a pod network with Flannel when running on ARM, but this has changed since the Weave Net 1.9 release, which now also supports ARM officially.
在此之前在 ARM 上,你只可以用 Flannel 安装一个 pod 网络,但是在 Weave Net 1.9 中已经改变了,它官方支持了 ARM。
Finally, join your nodes:
最后,记入你的节点:
```
kubeadm join --token <token> <master-ip>
```
And that's it! Kubernetes is deployed to your Raspberry Pi device. You didn't have to do anything special compared to running on Intel/AMD64; Weave Net on ARM just works.
就是这样了Kubernetes 已经部署到了 Raspberry Pi 上了。相比 Intel/AMD64你不用做特别的比较Weave Net 在 ARM 上也能工作。
### Raspberry Pi community
### Raspberry Pi 社区
I hope the Raspberry Pi community grows and their mentality spreads to other parts of the world. They're successful in Great Britain and other countries, but not so much here in Finland. I want the ecosystem to expand and for more people to learn how to deploy Kubernetes or Weave to ARM devices. After all, that's how I learned. By teaching myself on a Raspberry Pi device, I think I understand both ARM devices and the software deployed on them a lot better than I would have otherwise.
我希望 Raspberry Pi 社区成长起来,并他们的心态传播到世界其他地方。他们在英国和其他国家已经取得了成功,但在芬兰并不是很成功。我希望生态系统能够继续扩展,以让更多的人学习如何部署 Kubernetes 或 Weave 到 ARM 设备上。毕竟,这些是我学到的。通过在 Raspberry Pi 设备上自学,我更好地了解了 ARM 以及其上的软件部署。
### Final thoughts
### 最后的思考
Everything I learned about the Raspberry Pi and Kubernetes, I learned online by joining user communities, asking questions, and testing with different levels of success.
我通过加入用户社区、提出问题和不同程度的测试了解的关于 Raspberry Pi 和 Kubernetes 的一切,。
I am a Swedish-speaking upper secondary school student living in Finland, and to date, I've never attended a programming or computing class. I was still able to join the open source community because there are no restrictions on age or education: your work is judged based on its merits.
我是居住在芬兰的说瑞典语的高中生,到目前为止,我从来没有参加过编程或计算机课程。但我仍然能够加入开源社区,因为它对年龄或教育没有限制:你的工作是根据其优点来判断的。
For anyone nervous about making their first contributions to any open source project I'd say: Dive right in, it's totally worth it. There are no limitations to what you can do, and you'll never know which kinds of opportunities the open source world will offer you. It's gonna be fun, I promise!
对于任何那些第一次参与开源项目的人而言:深入进去,因为这是完全值得的。你做什么没有任何限制,你将永远不知道开源世界将为你提供哪些机会。这会很有趣,我保证!
--------------------------------------------------------------------------------
作者简介:
Lucas Käldström - Hi there and thanks for finding my profile! I'm a Swedish-speaking Upper Secondary School Student from Finland.
Lucas Käldström - 谢谢你发现我!我是一名来自芬兰的说瑞典语的高中生。
------------------
via: 网址
作者:[ Lucas Käldström][a]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出