Method to migrate workload between two environments and a system thereof
A method to migrate workload between a single node environment and a multi-node environment over a Transport Layer Security (TLS) network, the method comprises running an application on a first machine in a first environment, wherein the first environment is any one of the environments. The method further comprises generating a first file for the application running on the first machine and storing the first file and the workload created from the first file in the first machine. The method further comprises accessing a second machine that runs a container cluster in a second environment, wherein the second environment is different from the first environment. The method further comprises reading a second file from the container cluster and storing the second file in the first machine. The method further comprises connecting the first machine to the container cluster of the second machine using access information stored in the second file.
1 . A method to migrate a workload between a single node environment and a multi-node environment over a Transport Layer Security (TLS) network, wherein the single node environment has a single physical machine, and wherein the multi-node environment has two or more interconnected physical nodes, the method comprising:
deploying, by a first machine, a container in the single node environment, wherein the container is configured to execute the workload;
after deploying the container, generating, by the first machine, a first file storing configuration data associated with the workload executed in the container on the first machine, wherein the configuration data identifies a plurality of objects and a plurality of object types used in relation to the workload;
accessing, by a server that is separate from the first machine, a second machine that runs a container cluster in the multi-node environment, wherein the server is also separate from the second machine;
reading, by the server, access information for the container cluster from a second file of the container cluster and providing the access information to the first machine, wherein the access information is information needed to connect to the container cluster;
after receiving the access information, establishing, by the first machine, a TLS connection over the TLS network with the container cluster of the second machine using the access information; and
after the TLS connection is established between the first machine and the second machine over the TLS network, facilitating migration of the workload from the single node environment to the multi-node environment via the TLS network based on the configuration data stored in the first file, wherein facilitating the migration involves:
parsing the first file to determine the plurality of objects and the plurality of object types identified in the configuration data;
for each object type of the plurality of object types, transmitting a corresponding command to a corresponding application programming interface (API) endpoint of the container cluster to create the object type in the container cluster of the multi-node environment for use in running the workload in the multi-node environment; and
for each object in the plurality of objects, sending corresponding object information to the container cluster, wherein the container cluster is configured to use the object information to create a corresponding object in the container cluster for use in running the workload in the multi-node environment.
2 . The method of claim 1 , wherein the access information in the second file comprises information including at least one of a server address, TLS keys, certificates, or authentication for the container cluster, which is needed to connect to the container cluster.
3 . The method of claim 1 , wherein the first file lists the plurality of objects involved in the workload.
4 . The method of claim 1 , further comprising:
for each object type of the plurality of object types, creating the object type in the second machine based on the corresponding command received by the container cluster at the corresponding API endpoint.
5 . The method of claim 4 , further comprising:
for each object type of the plurality of object types, sending, by the container cluster, a response to the first machine or the server including information about a success or a failure of creating the object type on the second machine based on the corresponding command received by the container cluster.
6 . The method of claim 1 , wherein the first file includes a YAML Ain't Markup Language (YAML) file.
7 . The method of claim 1 , wherein the container cluster includes a container orchestration platform, and wherein the plurality of object types are types of virtual objects deployed by the container orchestration platform.
8 . The method of claim 1 , wherein the configuration data includes parameters, options, and/or settings of the workload.
9 . The method of claim 1 , further comprising:
after generating the first file, and prior to performing the migration, modifying the first file to generate a modified first file; and
using the modified first file in performing the migration.
10 . The method of claim 1 , wherein the second file includes API endpoint information for the container cluster, and further comprising:
receiving, by the first machine, the second file;
storing, by the first machine, the second file;
extracting, by the first machine, the API endpoint information from the second file; and
determining, by the first machine, the API endpoint to which to transmit each corresponding command for each object type of the plurality of object types using the API endpoint information extracted from the second file.
11 . A system to migrate a workload between a single node environment and a multi-node environment over a Transport Layer Security (TLS) network, wherein the single node environment has a single physical machine, and wherein the multi-node environment has two or more interconnected physical nodes, the system comprising:
a first machine running in a first environment, wherein the first environment is the single node environment, the first machine comprising a processing unit comprising processing hardware configured to:
deploy a container in the single node environment, wherein the container is configured to execute the workload; and
after deploying the container, generate a first file storing configuration data associated with the workload executed in the container on the first machine, wherein the configuration data identifies a plurality of objects and a plurality of object types used in relation to the workload;
a second machine configured to run a container cluster in the multi-node environment; and
a server that is separate from the first machine and the second machine, wherein the server is configured to:
access the second machine running the container cluster;
read access information for the container cluster from a second file of the container cluster and provide the access information to the first machine, wherein the access information is information needed to connect to the container cluster of the second machine;
establish a TLS connection over the TLS network between the first machine and the container cluster of the second machine using the access information; and
after the TLS connection is established between the first machine and the second machine over the TLS network, facilitate migration of the workload from the single node environment to the multi-node environment via the TLS network based on the configuration data stored in the first file, wherein facilitating the migration involves:
parsing the first file to determine the plurality of objects and the plurality of object types identified in the configuration data;
for each object type of the plurality of object types, transmitting a corresponding command to a corresponding application programming interface (API) endpoint of the container cluster to create the object type in the container cluster of the multi-node environment for use in running the workload in the multi-node environment; and
for each object in the plurality of objects, sending corresponding object information to the container cluster, where in the container cluster is configured to use the object information to create a corresponding object in the container cluster for use in running the workload in the multi-node environment.
12 . The system of claim 11 , wherein the server is configured to:
for each object of the plurality of objects identified in the first file:
forward a response from the container cluster to the first machine indicating a success or a failure of creating the object in the container cluster based on the corresponding object information received by the container cluster.
13 . The system of claim 11 , wherein the access information in the second file comprises information including at least one of a server address, TLS keys, certificates, or authentication for the container cluster, which is needed to connect to the container cluster.
14 . A non-transitory machine-readable medium storing code for migrating a workload between a first environment and a second environment over a Transport Layer Security (TLS) network, wherein the code is executable by one or more processors for causing the one or more processors to perform operations including:
deploying, by a first machine, a container in the first environment, wherein the container is configured to execute the workload;
after deploying the container, generating, by the first machine, a first file storing configuration data associated with the workload executed in the container on the first machine, wherein the configuration data identifies a plurality of objects and a plurality of object types used in relation to the workload;
accessing, by a server that is separate from the first machine, a second machine that runs a container cluster in the second environment, wherein the server is also separate from the second machine;
reading, by the server, access information for the container cluster from a second file of the container cluster and providing the access information to the first machine, wherein the access information is information needed to connect to the container cluster;
after receiving the access information, establishing, by the first machine, a TLS connection over the TLS network with the container cluster of the second machine using the access information; and
after the TLS connection is established between the first machine and the second machine over the TLS network, facilitating migration of the workload from the first environment to the second environment via the TLS network based on the configuration data stored in the first file, wherein facilitating the migration involves:
parsing the first file to determine the plurality of objects and the plurality of object types identified in the configuration data;
for each object type of the plurality of object types, transmitting a corresponding command to a corresponding application programming interface (API) endpoint of the container cluster to create the object type in the container cluster of the second environment for use in running the workload in the second environment; and
for each object in the plurality of objects, sending corresponding object information to the container cluster, wherein the container cluster is configured to use the object information to create a corresponding object in the container cluster for use in running the workload in the second environment.
15 . The non-transitory machine-readable medium of claim 14 , wherein the access information in the second file comprises information including at least one of a server address, TLS keys, certificates, or authentication for the container cluster, which is needed to connect to the container cluster.
16 . The non-transitory machine-readable medium of claim 14 , wherein the configuration data includes parameters, options, and/or settings of the workload.
17 . The non-transitory machine-readable medium of claim 14 , wherein the first file lists the plurality of objects involved in the workload.
18 . The non-transitory machine-readable medium of claim 14 , wherein the operations further involve:
for each object type of the plurality of object types, creating the object type in the second machine based on the corresponding command received by the container cluster at the corresponding API endpoint.