Getting started
I'm going to detail the process of moving an existing Ghost blog/website from GKE to Civo Kubernetes, utilising Kasten K10 to allow us to move data between the two.
This guide assumes you are running a Ghost blog on Google Kubernetes Engine and are looking to move it to Civo Kubernetes. You will need the following installed and/or set up:
- Kubectl installed and configured
- Kubectx installed and configured
- Civo CLI installed and configured
- A 3 node medium GKE cluster with Ghost deployed
Backup of existing application
When deploying to GKE, I recommend you follow the guide and create the proper service account to ensure K10 has the necessary cluster permissions.
Firstly we need to deploy K10 from Kasten, to do this you can follow this guide direct from their documentation.
Once deployed, you will need to a remote storage location. For simplicity and speed I have deployed a Minio instance in Civo K8s from the marketplace, but this can be any remote endpoint you prefer:
The configuration of K10 is pretty straightforward. You can either follow the official documentation here or I also have a guide specifically on this here.
When restoring to a new cluster and in this case to a new provider, we need to alter the backup job within Kasten slightly, by enabling export volume data:
You will also need to copy the import data, this is used in the destination cluster restore:
Starting our Civo cluster
Once you have a successful backup on your remote storage by following one of the guides linked above, deploy a new Civo K8s cluster. For simplicity and speed I advise using the CLI:
civo k3s create -s g3.k3s.medium -n 1 --wait --save --merge
For the purpose of this guide this will only create a single node medium cluster, please alter if required.
We can then deploy K10 by again following my previous guide.
Restoring the application
Once K10 is up and running we can start our restore. Because we are moving from GKE to Civo, we need to do a transformation on the storage class. Fortunately this is built into K10!
First we need to create a new profile, but this time select IMPORT, as you can see below you will need to paste the import data you exported previously:
Once this policy is created, you can run it:
You will then see the Ghost application in the application screen once you select "removed" from the drop-down:
As you can see there is an option to restore the application. When you click this, we need to make a slight change to the restore to allow for the storage class change. From the restore screen we need to select "new transform":
Then you can enter the following transform:
This should be all you need and you can start the restore of the application.
Some final changes
Once the restore completes you will see the pods starting up. Due to the fact that we have moved from GKE, you will need to make some changes:
- Alter the service type from LoadBalancer to ClusterIP
- Delete the Ghost LoadBalancer DaemonSet
You should now be able to access the application via a standard ingress route or any alternative ingress you want to setup.
Thank you for taking the time to follow this guide, if you have any comments or need any assistance please reach out to me directly on Twitter or via the official Civo Kubernetes Slack channel.