如何为Kubernetes创建本地开发环境? [英] How to create a local development environment for Kubernetes?

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

问题描述

Kubernetes 似乎都是关于将容器部署到集群云的.似乎没有碰到的是开发和暂存环境(或类似环境).

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:

  • 本地部署(或至少在您并且只有您可以访问的地方)
  • 使用最新的源代码进行页面刷新(假设其网站;理想情况下,页面自动刷新本地文件保存),如果您挂载源代码并使用诸如Yeoman ).
  • 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.

Kubernetes是否支持这种开发环境,还是必须构建某种东西,以希望在生产期间它仍然可以工作?

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

推荐答案

更新(2016-07-15)

Update (2016-07-15)

随着Kubernetes 1.3的发布, Minikube 现在是在本地机器上运行Kubernetes进行开发的推荐方法.

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

您可以通过Docker在本地运行 Kubernetes .一旦节点运行,就可以启动具有简单Web服务器的Pod,并从主机上装入卷.当您单击Web服务器时,它将从该卷中读取,并且如果您更改了本地磁盘上的文件,则它可以提供最新版本.

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天全站免登陆