/k8s-live-migration-demo

Terraform config, specs, and images to demo our prototype for Kubernetes live migration

Primary LanguageHCL

Kubernetes Live Migration Demo

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

Running Terraform

The Terraform script will deploy and configure a working Kubernetes toy cluster, and properly point kubectl to the master node's API server.

  1. Ensure that you have Terraform installed and in your system's PATH.
  2. Ensure that you have kubectl for your respective platform in your system's PATH. The binaries can tentatively be found here.
  3. Clone the repo.
  4. Change working directory to <path-to-cloned-repo>/terraform.
  5. Export the required environment variables.
export DO_PAT=<your DigitalOcean access token>
export SSH_FINGERPRINT=<md5 fingerprint of your DigitalOcean ssh key>
  1. Provision or destroy nodes using Terraform.
    • To provision (create nodes), run hack/provision.sh or sh hack/provision.sh on Windows
    • To destroy (delete nodes), run hack/destroy.sh or sh 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
  2. 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