如何与Kubernetes进行本地开发? [英] How to do local development with Kubernetes?

查看:189
本文介绍了如何与Kubernetes进行本地开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Kubernetes 似乎都是将容器部署到群集云中。它似乎没有涉及的是开发和分段环境(或类似)。



在开发过程中,您希望尽可能接近生产环境并进行一些重要更改:




  • 本地部署(或者至少在您,只有您可以访问的地方)

  • 在页面刷新上使用最新源代码(假设它是一个网站;理想情况下页面自动刷新本地文件保存,如果您装载源代码并使用一些像< )



>类似地,人们可能希望非公共环境执行持续集成

Kubernetes是否支持这种开发环境,或者是某种希望在生产过程中仍能正常工作?

解决方案

更新(2016-07-15)

>

随着Kubernetes 1.3的发布, Minikube 现在是在本地计算机上运行Kubernetes进行开发的推荐方式。




您可以运行通过Docker本地Kubernetes 。一旦你有一个节点运行,你可以启动一个拥有一个简单的web服务器的pod,并从你的主机上挂载一个卷。当你点击Web服务器时,它将从卷中读取数据,如果你已经更改了本地磁盘上的文件,它可以提供最新版本。

Kubernetes seems to be all about deploying containers to a cloud of clusters. What it doesn't seem to touch is development and staging environments (or such).

During development you want to be as close as possible to production environment with some important changes:

  • Deployed locally (or at least somewhere where you and only you can access)
  • Use latest source code on page refresh (supposing its a website; ideally page auto-refresh on local file save which can be done if you mount source code and use some stuff like Yeoman).

Similarly one may want a non-public environment to do continuous integration.

Does Kubernetes support such kind of development environment or is it something one has to build, hoping that during production it'll still work?

解决方案

Update (2016-07-15)

With the release of Kubernetes 1.3, Minikube is now the recommended way to run Kubernetes on your local machine for development.


You can run Kubernetes locally via Docker. Once you have a node running you can launch a pod that has a simple web server and mounts a volume from your host machine. When you hit the web server it will read from the volume and if you've changed the file on your local disk it can serve the latest version.

这篇关于如何与Kubernetes进行本地开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆