Minikube and docker development workflow

I am trying to understand how development works efficiently with applications overlaid by an application, in particular Kubernetes. I try my best to find a suitable way to work with containers for real-time editing.

In the past with Docker, I would just use something like Nodemon to make sure that files change locally, and then when I finish the application, I have to pin and expand it. With Kubernetes (minikube), my first impression is that I have to rebuild the container with every edit. Surely, this cannot be the way people develop here - what am I missing? Should I edit locally and then deploy dockerize-> k8s? This does not seem right.

I am looking for a way to synchronize all my local changes with a docker container, which then reloads the kubernetes module with the new changes, so I can read from the logs during development. If this is odd, please recommend me the best way.

thanks

+5
source share
2 answers

Kubernetes is a tool for orchestrating containers. This is not a development platform. It is designed to facilitate the deployment of hundreds of containers and solve lifecycle / network / storage problems.

If you are developing your application, you really do not need the kubernets / minicubs at the moment. My suggested workflow:

  • Develop your application in a local docker container. Go until you are happy.
  • Create a snapshot release, tag the docker image and click it on the repo
  • Then expand it.
  • When you need to update, apply a new tag.

The advantage of using Docker is that it will be deployed in exactly the same way on your local laptop, as well as in the k8s production cluster, so as soon as you reach the stage when you are ready to tag / click images, you can be sure that the deployment process will be the same.

Minikube is not intended for local development, but for people to test the kubernets at the local level, and perhaps to develop kubernets on their own, it was not designed as a roving alternative.

+4
source

Kubernetes is a runtime for containers designed to support immutable deployment options . Containers are not fixed in place; instead, they are rebuilt and redistributed. To support this, you need functions that implement the ALM (Application Lifecycle Management) workflow with Kubenetes as it is targeted.

Take a look at the following products that add container assembly workflows on top of Kubernetes:

If you are a Java developer, the following project can deploy the Jenkins-based CD / CD pipeline for your code:

The Netflix Spinnaker project now supports Kubernetes as a deployment target for managed applications.

With the exception of Openshift (see minishift ), the above projects can be deployed as applications on top of the mini cube. Enjoy!

0
source

Source: https://habr.com/ru/post/1266269/


All Articles