Skip to content

Commit

Permalink
update readme for the new chart path
Browse files Browse the repository at this point in the history
Signed-off-by: Muvaffak Onus <me@muvaf.com>
  • Loading branch information
muvaf committed May 15, 2024
1 parent 2767bf3 commit 86e7cae
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
node shutdown and restart scenarios. It is a command wrapper that, under the hood, utilizes
[`criu`](https://github.com/checkpoint-restore/criu) to checkpoint and restore process trees in a `Pod`.

> `crik` is first revealed at KubeCon EU 2024:
> `crik` is first revealed at KubeCon EU 2024:
> [The Party Must Go on - Resume Pods After Spot Instance Shut Down - Muvaffak Onuş, QA Wolf](https://kccnceu2024.sched.com/event/1YeP3)
It is a work in progress and is not ready for production use.

`crik` has two components:

- `crik` - a command wrapper that executes given command and checkpoints it when SIGTERM is received and restores from
checkpoint when image directory contains a checkpoint.
- `manager` - a kubernetes controller that watches `Node` objects and updates its internal map of states so that `crik`
Expand Down Expand Up @@ -58,6 +59,7 @@ crik run -- app-binary

The following is an example `Dockerfile` for your application that installs `crik` and runs your application. It assumes
your application is `entrypoint.sh`.

```Dockerfile
FROM ubuntu:22.04

Expand Down Expand Up @@ -96,17 +98,20 @@ data:
```
Configuration options:
- `imageDir` - the directory where `crik` will store the checkpoint images. It needs to be available in the same path
in the new `Pod` as well.
- `additionalPaths` - additional paths that `crik` will include in the checkpoint and copy back in the new `Pod`. Populate
this list if you get `file not found` errors in the restore logs. The paths are relative to root `/` and can be
directories or files.
directories or files.
- `inotifyIncompatiblePaths` - paths that `crik` will delete before taking the checkpoint. Populate this list if you get
`fsnotify: Handle 0x278:0x2ffb5b cannot be opened` errors in the restore logs. You need to find the inode of the
file by converting `0x2ffb5b` to an integer, and then find the path of the file by running `find / -inum <inode>` and
add the path to this list. See [this comment](https://github.com/checkpoint-restore/criu/issues/1187#issuecomment-1975557296) for more details.

### Node State Controller
### Node State Server

> Alpha feature. Not ready for production use.

You can optionally configure `crik` to take checkpoint only if the node it's running on is going to be shut down. This is
achieved by deploying a Kubernetes controller that watches `Node` events and updates its internal map of states so that
Expand All @@ -116,7 +121,7 @@ to the cloud provider's API to check the node's state in the future.
Deploy the controller:

```bash
helm install crik charts/crik
helm install crik charts/node-state-server
```

Make sure to include the URL of the server in `crik`'s configuration mounted to your `Pod`.
Expand All @@ -135,6 +140,7 @@ data:
`crik` will hit the `/node-state` endpoint of the server to get the state of the node it's running on when it receives
SIGTERM and take checkpoint only if it returns `shutting-down` as the node's state. However, it needs to provide the
node name to the server so make sure to add the following environment variable to your container spec in your `Pod`:

```yaml
env:
- name: KUBERNETES_NODE_NAME
Expand All @@ -148,7 +154,7 @@ env:
Build `crik`:

```bash
docker build -t crik:v1 -f cmd/crik/Dockerfile .
go build -o crik cmd/crik/main.go
```

## Why not upstream?
Expand All @@ -168,4 +174,4 @@ support in Kubernetes. Once the native support is available, `crik` will utilize

## License

This project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.
This project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.

0 comments on commit 86e7cae

Please sign in to comment.