Nowadays, the migration to a cloud IT infrastructure is essential for every company aiming to pursue digital innovation.

Compared to previous technologies, modern cloud providers now offer complete and competitive services. Moreover, shutting down the owned datacenters, on which the software is run, can save money and energy.

So, many companies undertake the migration of their software from on‑premise installations towards the cloud. Such migrations could be difficult, long, and expensive, if not done correctly and with the right tools. In this article, we will tell how an Italian insurance company, could easily face this migration thanks to Mia‑Platform: all operations were streamlined, every infrastructural change was transparent, and the service was never interrupted.

 

The needs

The insurance company owns a multi‑server datacenter, on which the company’s software runs; a large chunk of this software is implemented on an on‑premise installation of Mia‑Platform. More specifically, the on‑premise platform has about 300 microservices containerized in Docker images that are run on an OpenShift cluster. The microservices primarily communicate with:

  • a MongoDB cluster; 
  • a Kafka cluster; 
  • a Redis instance. 

In addition to the software implemented with Mia‑Platform, the datacenter also hosts other business applications, and several DevOps tools like Jenkins, GitLab, and Nexus. These tools and applications, however, were not to migrate.

As shown by the picture below, everything is replicated in both the pre‑production and the production environment.

mia-platform-cloud-migration-starting-infrastructure

Such hardware has many maintenance issues and high costs: besides the high power consumption of the datacenter itself, a significant cost item is the on‑premise OpenShift license.

Moreover, there are the datacenter maintenance costs: operating systems updates, software updates, network issues, and so on, are all very expensive activities.

Lastly, the datacenter security can become an issue too: as the software grows, the security becomes increasingly difficult to manage.

 

The solution

To cope with these challenges, our client decided to take the first step towards the cloud, migrating the microservices ecosystem built with Mia‑Platform.

It was then stated to move:

  • from on‑premise OpenShift to Google Kubernetes Engine (GKE) on Google Cloud;
  • from on‑premise MongoDB to MongoDB Atlas;
  • from on‑premise Kafka to Kafka Confluent;
  • from on‑premise Redis to a Redis instance installed on Google Cloud.

The target infrastructure was the following:

mia-platform-cloud-migration-target-infrastructure

 

How Mia‑Platform streamlines the cloud migration

The cloud‑native architecture of Mia‑Platform made the migration work much easier. Below there are the main benefits that our client experienced thanks to our solution.

 

Containerization

As mentioned above, every microservice developed on Mia‑Platform is containerized in a Docker image to make it run on any hardware and operating system. This feature of Docker, a technology integrated within our platform, allowed us to migrate the applications without the need to change a single line of source code and without any compatibility problem with the new hardware and cloud operating systems.

Thanks to Mia‑Platform's automated pipelines, the same Docker images running on the on‑premise OpenShift cluster were released on GKE, without the need for any additional intervention from developers.

 

Automation

As experienced readers will know, OpenShift configuration files are slightly different from the ones accepted by Kubernetes. An example is the deployment.yml file: this file allows you to define the DepolymentConfig resource, which is only compatible with OpenShift. 

Manually managing a new configuration file is long, complex, and risky; thanks to Mia‑Platform, however, this task is fully automated. Mia‑Platform's Console, indeed, allows the automatic generation of configuration files for both OpenShift and Kubernetes: to have these files, all you have to do is to change only one configuration parameter on the console interface.

In this way, developers define from the Console the settings of their service (name, Docker image, memory and CPU limits, environment variables, etc.), without having to worry about any technical issue related to OpenShift or Kubernetes. The Console itself, starting from what the user has defined from the front‑end, automatically generates the configuration files to release the microservices on the right platform.

mia-platform-cloud-migration-automation

For the migration, therefore, we only needed to change this configuration parameter in the Mia‑Platform Console, in order to automatically make all OpenShift files compatible with Kubernetes.

 

Centralized deploy pipelines

One of the main features offered by Mia‑Platform is the automation of build and deploy pipelines, either Jenkins or GitLab‑CI. In the case at hand, our client was using Jenkins, so we will focus on this tool.

All 300 microservices of the insurance company are released from the same pipeline: that is, the Jenkinsfile is unique and parametric. The parameters of the pipeline are mainly:

  • The Kubernetes namespace to be released on;
  • The Git branch from which release;
  • The environment on which the microservices are released on.

When you create a microservice from the Console, a Jenkins job dedicated to that microservice is automatically created and linked to the unique Jenkinsfile. Having a unique Jenkinsfile ensures that the pipeline's code is not duplicated, and that every change can be made to just one file.

For the migration, therefore, to change the cluster we had to replace only the string connection to the cluster: thanks to the unique Jenkinsfile, the string was only replaced once, instead of being replaced for every microservice.

 

The Console runtime area

The migration was in stages, so at the beginning only one of the two environments was migrated to the cloud; the second one was migrated at a later time, when we were sure that everything was working correctly. We started migrating the pre‑production environment to the cloud, while the production environment still kept running on the on‑premise infrastructure.

Such a hybrid situation could have been confusing for the  developers: indeed, without Mia‑Platform they would have to sign in on two completely different platforms - OpenShift and GKE -, using different accounts, to monitor the logs and status of their microservices.

The runtime area of Mia‑Platform Console avoids this kind of problems, streamlining the work and improving the developer's experience. From this section, indeed, developers can see the status and logs of their microservices from a convenient graphical interface, without any worry of the cluster on which the services have been released.

Once again, to show to developers data from the GKE cluster instead of data from OpenShift, we only had to change a single configuration parameter of the console itself. This stage of the cloud migration is perhaps one of the most tricky, but, thanks to Mia‑Platform, our client didn’t have any complications.

 

Environment variables

Tools like MongoDB, Kafka, and Redis are considered as part of our platform, so connection strings to these tools are defined at the platform level. This means that if developers need to connect to one of these tools, they will have to define an environment variable within the microservice’s configuration. However, they will not have to set the actual connection string, but they must set a simple placeholder, which will be replaced at deployment‑time by the release pipeline.

For instance, to connect to MongoDB, you'll need to value an environment variable with the placeholder string . The release pipeline will then interpolate this string with the URL to connect to MongoDB.

Our platform feature allowed us to migrate MongoDB, Kafka, and Redis to the cloud without requiring developers to make any configuration changes. Indeed, the change was made only once to the Jenkinsfile that performs the placeholder interpolation, and it automatically took effect on all microservices.

 

Conclusions

Cloud migration is a technological challenge that many companies are facing. The migration can be more or less challenging, depending on the starting point: migrating on‑premise software that is implemented on a cloud‑native technology stack, such as Mia‑Platform's one, streamlines many tasks.

Adopting tools like containers, orchestrators, and automated pipelines is the best way to lower the time‑to‑market of new software products, and improve their governance. For a more gradual migration, the first step is to adopt cloud‑native tools, even if running on your own on‑premise datacenter. The second step is to adopt a platform like Mia‑Platform, which allows you to streamline all the processes and face the migration more confidently and quickly. From there on, the road to the cloud will be all downhill.


The article was written by Luca Scannapieco, Senior Technical Leader.

Back to top

New call-to-action

© MIA s.r.l. All rights reserved