简体   繁体   English

将 Docker-Compose 与 Kubernetes、Minikube 和 Skaffold 一起包含在团队的开发环境中是不是一个坏主意?

[英]Is it a bad idea to include Docker-Compose alongside Kubernetes, Minikube and Skaffold on your team's dev enviroment?

Ideally, we would only want to stick to Minikube and Scaffold.理想情况下,我们只想坚持使用 Minikube 和 Scaffold。

But there are many cases in which we would like to enable 2-way syncing of volumes so that changes in a specific container directory are reflected on a directory of the host machine.但是在很多情况下,我们希望启用卷的双向同步,以便特定容器目录中的更改反映在主机目录上。

We currently use kubectl to copy directories and files manually from the pod unto a local directory.我们目前使用 kubectl 手动将目录和文件从 pod 复制到本地目录。 But we would like to automate this step.但我们想自动化这一步。

Docker-Compose makes it very easy to set this up by defining a rw volume to a service: Docker-Compose 通过为服务定义 rw 卷可以很容易地进行设置:

services:
  myService:
    image: some/image
    volumes:
      - /some-host/path:/some-container/path:rw

So whenever we need to reflect changes into our local environment, we would stop skaffold, start docker-compose, and make the changes necessary on the container so that they are automatically reflected locally.因此,每当我们需要将更改反映到本地环境中时,我们会停止 skaffold,启动 docker-compose,并在容器上进行必要的更改,以便它们在本地自动反映。

The issue is that if we want to make a change to one of the services in the system we now have to reflect these changes on our k8s deployments, as well as our docker-compose file.问题是,如果我们想对系统中的一项服务进行更改,我们现在必须在 k8s 部署以及 docker-compose 文件中反映这些更改。 These would include reflecting changes to secrets, config maps, etc... and we might end up with a really complicated project.这些将包括反映对机密、配置映射等的更改……我们最终可能会得到一个非常复杂的项目。

Is this a bad idea?这是一个坏主意吗? Is there a better approach?有更好的方法吗?

You can have a look into Tilt or Telepresence .您可以查看TiltTelepresence We currently are working on changing our local development environment from docker-compose to a microk8s based approach and are looking into those two approaches, as we are too facing the issue of shared volumes which are not supported out of the box in microk8s.我们目前正在努力将本地开发环境从 docker-compose 更改为基于 microk8s 的方法,并且正在研究这两种方法,因为我们也面临着在 microk8s 中不支持开箱即用的共享卷的问题。

Just an idea, we will have to see ourselves what solution works best for us:)只是一个想法,我们必须自己看看哪种解决方案最适合我们:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM