A demo testing rig for Kubernetes criu-based migration, including:
- Terraform script to set up a 3 node, 1 master, 1 etcd node with all required dependencies
- Sample containers that exhibit in-memory state
- Sample Kubernetes spec files to go along with those containers
The Terraform script will deploy and configure a working Kubernetes toy cluster, and properly point kubectl to the master node's API server.
- Ensure that you have Terraform installed and in your system's PATH.
- Ensure that you have kubectl for your respective platform in your system's PATH. The binaries can tentatively be found here.
- Clone the repo.
- Change working directory to
<path-to-cloned-repo>/terraform
. - Export the required environment variables.
export DO_PAT=<your DigitalOcean access token>
export SSH_FINGERPRINT=<md5 fingerprint of your DigitalOcean ssh key>
- Provision or destroy nodes using Terraform.
- To provision (create nodes), run
hack/provision.sh
orsh hack/provision.sh
on Windows - To destroy (delete nodes), run
hack/destroy.sh
orsh hack/provision.sh
on Windows - NOTE FOR WINDOWS:
ssh
is required in this script, available in the latest W10 Insider Preview. Additionally, within terraform/provider.tf, you may have to modify:- From
ssh -o "StrictHostKeyChecking no" root@${self.ipv4_address} /home/start.sh
- To
ssh root@${self.ipv4_address} /home/start.sh
- Then, turn StrictHostKeyChecking off through your
~/.ssh/config
file, as described here
- From
- To provision (create nodes), run
- kubectl should now be point to the Kubernetes master, and running
kubectl get nodes
you should see the list of active nodes.- Create an unmanaged pod:
kubectl create -f <path-to-pod-spec>
- Migrating an unmanaged pod:
kubectl create -f <path-to-migration-spec>
- Example spec files exist here
- Create an unmanaged pod: