Skip to content

Commit

Permalink
Update README.md with kubeadm instructions
Browse files Browse the repository at this point in the history
- Updated with specific instructions for kubeadm
- Added instruction to apply the RBAC manifest
- Updated the commands of step 9 to run as root
- Added a note that the local registry is optional
  • Loading branch information
stano45 committed Aug 16, 2024
1 parent 1862c9e commit 0e488f0
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions examples/container_migration_in_kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
```
Expand All @@ -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 <user>
./generate-certificates.sh <hostname>
./trust-certificates.sh
./run.sh

buildah login <hostname>: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
Expand All @@ -65,33 +65,50 @@ 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 <user>
./generate-certificates.sh <hostname>
./trust-certificates.sh
./run.sh
buildah login <hostname>: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 <pod> <container>
```

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 <annotations-file> -c <checkpoint-path> -i <hostname>:5000/<image>:<tag>
buildah push <hostname>:5000/<image>:<tag>
```

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 `<hostname>:5000/<image>:<tag>` and apply the new deployment.
Expand Down

0 comments on commit 0e488f0

Please sign in to comment.