Application export from Epinio and transfer to another cluster
Epinio provides the ability to export all parts of a running application and then use these to run the application in a different cluster.
This only applies to the core application itself, and not to configurations and services it may need or was bound to in the origin cluster.
Export​
Exporting an application APP
is trivially done by running the command
epinio app export APP /path/to/a/directory/of/your/choice/
After the command has run the chosen directory has the 3 parts of the application needed to run it elsewhere, namely:
app-image.tar
; The application's runtime image as generated by the staging process and saved into a tar archive as generated bydocker save
.app-chart.tar.gz
; The application chart used to deploy the application.values.yaml
; The configuration of the application chart. This part references the application image. This reference is only valid for the origin cluster.
Import​
To import APP
into a new cluster
Run
docker load app-image.tar
to import the image and its layers into the local docker setup. The output has a line referencing theLoaded image ID
. This is the hash of the loaded image and needed in the next step.Note. Don't use
docker import
, nordocker image import
for this. While these commands do store the image into the local docker similar toload
they don't preserve the layering, nor the Entrypoint information coming with these. It's the Entrypoint information which makes the result unusable.Run
docker tag HASH REGISTRY/ORG/NAME:TAG
whereHASH
is the hash of the image as reported by the previous step.REGISTRY
, etc. are arbitrary values chosen by the importer. TheREGISTRY
is optional, that is, would default to dockerhub. If set, it has to refer to an actual registry the destination cluster is able to pull from.Run
docker push REGISTRY/ORG/NAME:TAG
to save the image to the chosen registry. Without this step the image would only exist locally and couldn't be pulled later.Edit the
imageURL
field in the filevalues.yaml
to replace the existing image reference, valid only for the origin cluster, withREGISTRY/ORG/NAME:TAG
.Edit the
domain
/id
information of theroutes
section ofvalues.yaml
, to prevent clashes with the instance ofAPP
running on the origin cluster. This isn't necessary ifAPP
wasn't kept running on the origin cluster.Edit the
appName
field invalues.yaml
, if required.Run
helm upgrade --install NAME app-chart.tar.gz --values values.yaml
to deploy the modified application on the destination cluster under the chosen release name.