Kubernetes migration made simple with Konveyor Move2Kube

Konveyor accelerates the process of replatforming to Kubernetes by analyzing source artifacts.
1 reader likes this.
How Kubernetes is helping Docker blossom

Maersk Line. CC SA-BY 4.0

Konveyor Move2Kube assists developers in migrating projects from platforms such as Cloud Foundry and Docker swarm to Kubernetes and OpenShift. Move2Kube analyzes your application's source code and generates Infrastructure-as-Code (IaC) artifacts such as Kubernetes YAMLs, Helm charts, Tekton pipelines, and so on.

Move2Kube input and output options

(Mehant Kammakomati, CC BY-SA 4.0)

Powering Move2Kube is a transformer framework that enables multiple small transformers to be chained together to transform the artifacts completely.

Transformations

(Mehant Kammakomati, CC BY-SA 4.0)

Many different transformers get involved when transforming a Java or Node.js project to create all the destination artifacts. This allows for the reuse of transformers in various end-to-end flows. Each transformer is capable of performing multiple activities.

Transformers perform various activities

(Mehant Kammakomati, CC BY-SA 4.0)

Move2Kube

You can use Move2Kube as a terminal command or as a web app. Its core functionality includes planning and transformation. In the planning phase, Move2Kube analyzes artifacts to identify the services involved. In the transformation phase, it transforms those services into destination artifacts.

The terminal command is a single binary, which you can download and install. Move2Kube also provides a helper script to download and place the binary in your local filesystem:

curl \ https://raw.githubusercontent.com/konveyor/move2kube/main/scripts/install.sh \

-o move2kube_install.sh

Look through the script to ensure its install method aligns with your preference, and then run it:

$ sh ./move2kube_install.sh

To use the command, just run it on a directory containing the application source code:

$ move2kube transform -s ./src

Transform an enterprise scale application

Move2Kube can be used to replatform a real-world enterprise application. There's a demo enterprise app included in the Move2Kube git repository to demonstrate the workflow. This demo app is similar to a typical real-world application with CRUD operations and a multi-tier architecture.

To try it out, download the source code for the enterprise app:

$ curl https://move2kube.konveyor.io/scripts/download.sh \
| bash -s -- -d samples/enterprise-app/src -r move2kube-demos

The source code for the enterprise app is in the src directory.

First, use the move2kube transform command:

$ move2kube transform -s ./src

After running the command, look in the myproject folder. There are new directories, including deploy, scripts, and source. The deploy directory contains all IaC artifacts, such as Kubernetes YAML files, Tekton pipelines, Helm charts, Knative files, compose files, and OpenShift files. The scripts directory contains shell scripts to build and push container images to the registry of your choice. Finally, the source directory contains the source code and Dockerfiles.

Capabilities provided by Move2Kube

Move2Kube has a powerful QA Engine. Transformers can get input from a user using this engine. Transformers receive the input as user interaction through a terminal, a web interface, a REST API, or as a configuration file.

For instance, in the demo enterprise app, the Move2Kube QA engine might ask which port the frontend app should listen on, which container registry should be used to store images, or what ingress host should be used.

To run an app in a non-interactive mode, use the --qa-skip flag. This option causes Move2Kube to use default answers:

$ move2kube transform -s ./src --qa-skip

If you want to answer the questions from a configuration file, use the -f option:

$ move2kube transform -s ./src -f ./m2kconfig.yaml

A list of all answers used for the run is captured as a config in the m2kconfig.yaml file.

Customization capability

Move2Kube includes several transformers ready for use, and it allows users to write new transformers. Move2Kube exposes all the internal transformers' capabilities to be leveraged for writing custom transformers. These capabilities include a QA engine, extensive templating enabled by Golang templates, and isolation. Custom transformers behave exactly the same as built-in transformers. The two types can be chained together to achieve an end-to-end transformation.

Move2Kube generates artifacts you can customize to comply with organizational best practices and policies. You can direct the Move2Kube tool to customizations using the -c or --customization option.

You can create customizations using three different methods:

  1. Configure built-in transformers: Configure a built-in transformer to behave differently. For example, you can modify the parameterization transformer to parameterize different values depending on the organization's needs.
  2. Starlark-based transformers: Write a complete transformer in a Python-like language, Starlark. For example, you could use a Starlark-based transformer to add custom annotations to Kubernetes YAML files.
  3. Executable transformers: Write a complete transformer in a language of your choice and allow Move2Kube to execute it along with the other transformers. For example, generate custom Helm charts to add custom files and directories in specific locations.

Parameterization and customization capability

Move2Kube allows users to parameterize custom fields in the target platform artifacts, such as Helm charts. For instance, parameterizing the number of replicas in a Helm chart:

apiVersion: apps/v1
kind: Deployment
metadata:
    annotations:
        move2kube.konveyor.io/service.expose: "true"
    creationTimestamp: null
    labels:
        move2kube.konveyor.io/service: orders
    name: orders 
spec:
    progressDeadlineSeconds: 600
    replicas: {{ index .Values "common" "replicas" }}

Move2Kube also allows you to customize output artifacts. For instance, add a custom annotation to the Ingress YAML file:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
   annotations:
      kubernetes.io/ingress.class: haproxy
    creationTimestamp: null
    labels:
      move2kube.konveyor.io/service: myproject
    name: myproject

Move2Kube case studies

Mov2Kube has been widely adopted in the industry and open-source communities. Here are some case studies where replatforming using Move2Kube has shown considerable improvement over manual effort.

  • InsApp
    • Language Stack: Java (springboot), Angular JS UI
    • Source Platform: Docker Swarm
    • Number of Services: 100
    • Manual Effort: 56 days
    • Move2Kube Effort: 6 days
    • In-Built Transformers Invoked: 6
    • Number of External Transformers: 0
  • AA case study
    • Language Stack: Java (springboot), Angular JS UI
    • Source Platform: Cloud-foundary
    • Number of Services: 3
    • Manual Effort: 2 days
    • Move2Kube Effort: 15 minutes
    • In-Built Transformers Invoked: 14
    • Number of External Transformers: 0
  • CP case study
    • Language Stack: Python
    • Source Platform: ECS Fargate
    • Number of Services: 7
    • Manual Effort: 12 days
    • Move2Kube Effort: 1 day
    • In-Built Transformers Invoked: 13
    • Number of External Transformers: 0
  • MFA case study
    • Language Stack: .NET Silverlight UI
    • Source Platform: Bare-metal/VM
    • Number of Services: 4
    • Manual Effort: 9 days
    • Move2Kube Effort: 5 hours
    • In-Built Transformers Invoked: 14
    • Number of External Transformers: 1 (custom dependencies)
  • TMP case study
    • Language Stack: Java (springboot)
    • Source Platform: Cloud-foundry
    • Number of Services: 24
    • Manual Effort: 25 days
    • Move2Kube Effort: 2.25 days
    • In-Built Transformers Invoked: 15
    • Number of External Transformers: 1 (custom directories)

Data source: Seshadri, Padmanabha V., Harikrishnan Balagopal, Akash Nayak, Ashok Pon Kumar, and Pablo Loyola. "Konveyor Move2Kube: A Framework For Automated Application Replatforming." In 2022 IEEE 15th International Conference on Cloud Computing (CLOUD), pp. 115-124. IEEE, 2022.

Learn more about Konveyor Move2Kube

Visit the Move2Kube site to learn more about replatforming using Konveyor Move2Kube.

Mehant
Hi there! I work as a Research Software Engineer at IBM India Research Lab. Cloud Native, Edge technologies, and AI interest me a lot.

Comments are closed.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.