This README provides instructions on how to use Move2kube to replatform sample applications from their source code to Kubernetes-ready artifacts.
Before you begin, make sure you have the following prerequisites installed:
-
Move2kube: Move2kube is the tool we'll use for replatforming. You can install it using Homebrew by running:
brew tap konveyor/move2kube brew install move2kube
Now that you have the prerequisites installed and the sample applications downloaded, you can start the replatforming process.
First, generate a plan file that specifies how the source code should be transformed into Kubernetes artifacts:
move2kube plan -s language-platforms
You can view the generated plan file to understand the transformation that will be performed:
cat m2k.plan
Execute the transformation process to convert the source code to Kubernetes-ready artifacts:
move2kube transform
In this step, Move2kube will perform ask you to provide some information about the application. See this video for more information on how to answer these questions form minute 8:10 - 13:10:
Navigate to the project directory where the transformed artifacts are located:
cd <your-project-name>/scripts
Run the builddockerimages.sh
script to build Docker images for the Kubernetes artifacts:
bash builddockerimages.sh
If you want to push the Docker images to Docker Hub, you can do so by running the pushimages.sh
script. Before running the script, make sure to set the REGISTRY_NAMESPACE
variable to your Docker Hub username if necessary in the pushimages.sh script:
# Set your Docker Hub username
REGISTRY_NAMESPACE=<docker_hub_user>
Then, push the images:
bash pushimages.sh
That's it! You have successfully replatformed the sample application using Move2kube. You can now deploy these Kubernetes artifacts as needed.
Note: Make sure to replace and <docker_hub_user> with your actual project name and Docker Hub username, respectively, as needed.
After this you can deploy the application using the following command:
kubectl apply -f <your-project-name>/deploy
Make sure to start the minikube cluster before deploying the application.