[Translation] migration services to micro - easier than you think

Description link

Migrate to micro-services roadmap

Migration to the micro-service sounds like a huge and complex task. Although the process may be somewhat complicated, but actually simpler than you might think. This blog with a standard J2EE application as an example the establishment of a basic roadmap for migration, the migration from the integration of architecture to the micro-service architecture. We'll container of our Java application starts automatically published to the progressive realization of the ultimate micro Kubernetes service environment.

When the container of Java applications running: Step 1

Our first trip to migrate from the container of a Java application (.jar, .war or .ear) began, which involved the establishment of a container and your application Java Runtime hold. When implementing this step, remember the following:

  1. It requires a container entry point.
  2. Container to be able to self-reliance.

Step 2: Learn NGINX

Beginning to migrate to micro-services, you need to provide a load balancer for your Kubernetes environment, deal with external requests from the cloud load balancer. NGINX is a good choice, take the time to install and learn NGINX.

Step 3: containerized NGINX

After familiar with NGINX, move it to the container.

Step 4: build a cluster Kubernetes

Now the fun place to come. If you do not use Kubernetes manage your container, you are trying to migrate to micro services will be in vain. Through the establishment of the first cluster Kubernetes to learn Kubernetes. And they offer start from Google. This guide will teach you how to build your cluster. You need to install a Google Command Line Client. Of course, we must learn Helm .

Step 5: Field appreciated

After Kubernetes cluster is set up, it's time to think about how to split your application. DeployHub support Domain Driven Design (DDD) mode to organize, catalog, publish and share the micro-services.

In the early development is well defined structure your vital areas. At the outset organize micro-services and reuse components to prevent chaos after the occurrence.

Step 6: Add a binary repository to your CD workflow

Manage your binaries in a repository, to help build a container. Each building will correspond to a version number and have a traceable history.

Step 7: Add a Docker warehouse for your CI / CD

Ditto.

Step 8: automatic deployment by CI / CD

Use DeployHub Team automatically deployed. DeployHub will track your configuration and version.

This is almost the entire contents. You do not want it to migrate to micro-services too complicated. Take a moment to complete each step. There will be some small changes in your CI / CD workflow, but these are feasible. From this simple example, you can gradually build your own micro-services, and opened the journey towards modern architecture.

Guess you like

Origin juejin.im/post/5de357f86fb9a0715b407e4a