diff --git a/examples/container_migration_in_kubernetes/README.md b/examples/container_migration_in_kubernetes/README.md index e2ba72c..2b53110 100644 --- a/examples/container_migration_in_kubernetes/README.md +++ b/examples/container_migration_in_kubernetes/README.md @@ -14,7 +14,7 @@ checkpointing feature in Kubernetes, please refer to the following pages: ## Running the example -1. Install CNI Plugins on each node +### 1. Install CNI Plugins on each node The CNI configuration file is expected to be present as `/etc/cni/net.d/10-kuberouter.conf` ``` @@ -35,24 +35,24 @@ sudo mkdir -p /opt/cni/bin sudo cp bin/* /opt/cni/bin/ ``` -2. Deploy daemonset +### 2. Initialize the Kubernetes cluster using kubeadm (optional): ``` -kubectl apply -f manifests/kube-router-daemonset.yaml +sudo kubeadm init --pod-network-cidr=10.85.0.0/16 --cri-socket=unix:///var/run/crio/crio.sock ``` -3. Setup a local container registry - +### 3. Untaint the master node to allow pods to be scheduled (optional, assuming a single node cluster): +``` +kubectl taint nodes --all node-role.kubernetes.io/master- +kubectl taint nodes --all node-role.kubernetes.io/control-plane- ``` -cd local-registry/ -./generate-password.sh -./generate-certificates.sh -./trust-certificates.sh -./run.sh -buildah login :5000 + +### 4. Deploy daemonset +``` +kubectl apply -f manifests/kube-router-daemonset.yaml ``` -3. Deploy an HTTP server +### 5. Deploy an HTTP server ``` kubectl apply -f manifests/http-server-deployment.yaml @@ -65,25 +65,42 @@ kubectl get deployments kubectl get service http-server ``` -4. Install kubectl checkpoint plugin +### 6. Apply the RBAC configuration to allow the checkpoint plugin to create a checkpoint (optional if your config already allows this): +``` +kubectl apply -f manifests/checkpoint-rbac.yaml +``` + +### 7. Setup a local container registry (optional, you can use any other registry) + +``` +cd local-registry/ +./generate-password.sh +./generate-certificates.sh +./trust-certificates.sh +./run.sh + +buildah login :5000 +``` + +### 8. Install the kubectl checkpoint plugin ``` sudo cp kubectl-plugin/kubectl-checkpoint /usr/local/bin/ ``` -5. Enable checkpoint/restore with established TCP connections +### 9. Enable checkpoint/restore with established TCP connections ``` sudo mkdir -p /etc/criu/ echo "tcp-established" | sudo tee -a /etc/criu/runc.conf ``` -6. Create container checkpoint +### 10. Create container checkpoint ``` kubectl checkpoint ``` -7. Build a checkpoint OCI image and push to registry +### 11. Build a checkpoint OCI image and push to registry ``` build-image/build-image.sh -a -c -i :5000/: @@ -91,7 +108,7 @@ build-image/build-image.sh -a -c -i :5000/: ``` -7. Restore container from checkpoint image +### 12. Restore container from checkpoint image Replace the container `image` filed in `http-server-deployment.yaml` with the checkpoint OCI image `:5000/:` and apply the new deployment.