Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubernetes development environment to reduce development time

I'm new to devops and kubernetes and was setting up the local development environment. For having hurdle-free deployment, I wanted to keep the development environment as similar as possible to the deployment environment. So, for that, I'm using minikube for single node cluster, and that solves a lot of my problems but right now, according to my knowledge, a developer need to do following to see the changes:

  1. write a code locally,
  2. create a container image and then push it to container register
  3. apply the kubernetes configuration with updated container image

But the major issue with this approach is the high development time, Can you suggest some better approach by which I can see the changes in real-time?

like image 226
mohit sharma Avatar asked Nov 24 '17 09:11

mohit sharma


2 Answers

The official Kubernetes blog lists a couple of CI/CD dev tools for building Kubernetes based applications: https://kubernetes.io/blog/2018/05/01/developing-on-kubernetes/

However, as others have mentioned, dev cycles can become a lot slower with CI/CD approaches for development. Therefore, a colleague and I started the DevSpace CLI. It lets you create a DevSpace inside Kubernetes which allows you a direct terminal access and real-time file synchronization. That means you can use it with any IDE and even use hot reloading tools such as nodemon for nodejs.

DevSpace CLI on GitHub: https://github.com/covexo/devspace

like image 122
Lukas Gentele Avatar answered Oct 19 '22 21:10

Lukas Gentele


I am afraid that the first two steps are practically mandatory if you want to have a proper CI/CD environment in Kubernetes. Because of the ephemeral nature of containers, it is strongly discouraged to perform hotfixes in containers, as they could disappear at any moment.

There are tools like helm or kubecfg that can help you with the third step

apply the kubernetes configuration with updated container image

They allow versioning and deployment upgrades. You would still need to learn how to use but they have innumerable advantages.

Another option that comes to mind (that without Kubernetes) would be to use development containers with Docker. In this kind of containers your code is in a volume, so it is easier to test changes. In the worst case you would only have to restart the container.

Examples of development containers (by Bitnami) (https://bitnami.com/containers):

  • https://github.com/bitnami/bitnami-docker-express
  • https://github.com/bitnami/bitnami-docker-laravel
  • https://github.com/bitnami/bitnami-docker-rails
  • https://github.com/bitnami/bitnami-docker-symfony
  • https://github.com/bitnami/bitnami-docker-codeigniter
  • https://github.com/bitnami/bitnami-docker-java-play
  • https://github.com/bitnami/bitnami-docker-swift
  • https://github.com/bitnami/bitnami-docker-tomcat
  • https://github.com/bitnami/bitnami-docker-python
  • https://github.com/bitnami/bitnami-docker-node
like image 41
Javier Salmeron Avatar answered Oct 19 '22 23:10

Javier Salmeron