diff options
author | Ian Lewis <ianlewis@google.com> | 2019-01-15 16:41:01 +0900 |
---|---|---|
committer | Lantao Liu <taotaotheripper@gmail.com> | 2019-01-14 23:41:01 -0800 |
commit | bd2940861c282dfc39309bca94378c820ab7df7e (patch) | |
tree | 70792e8491bd57e82f56c2ec2c5c7680fc9bd4f9 /README.md | |
parent | 9e0866102bf53f50a0353775b7bb370fe77ee5b4 (diff) |
End to end tests refs #3 (#10)
* Separate docs for containerd 1.1 and 1.2
The configuration for the untrusted workload annotation and runtime
class are different enough that it makes sense to separate the docs.
Commands in docs are taken from scripts in the docs/scripts directory.
These scripts can be used later for integration & doc tests (#3). The
docs can be updated using the embedmd tool:
https://github.com/campoy/embedmd
* Add basic e2e tests refs #3
Added end-to-end tests based on the quickstart workflows for
containerd 1.1 and containerd 1.2+.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 121 |
1 files changed, 8 insertions, 113 deletions
@@ -1,125 +1,20 @@ # gvisor-containerd-shim +[![Build Status](https://travis-ci.org/google/gvisor-containerd-shim.svg?branch=master)](https://travis-ci.org/google/gvisor-containerd-shim) +[![Go Report Card](https://goreportcard.com/badge/github.com/google/gvisor-containerd-shim)](https://goreportcard.com/report/github.com/google/gvisor-containerd-shim) + gvisor-containerd-shim is a containerd shim for [gVisor](https://github.com/google/gvisor/). It implements the containerd v1 shim API. It can be used as a drop-in replacement for [containerd-shim](https://github.com/containerd/containerd/tree/master/cmd/containerd-shim) (though containerd-shim must still be installed). It allows the use of both gVisor (runsc) and normal containers in the same containerd installation by deferring to the runc shim if the desired runtime engine is not runsc. ## Requirements -- gvisor (runsc) >= a2ad8fe +- gvisor (runsc) >= 2018-12-07 - containerd, containerd-shim >= 1.1 ## Installation -1. Download the latest release of the gvisor-containerd-shim and unpack the binary to the desired directory: - -``` -$ tar xf gvisor-containerd-shim.tar.gz -$ mv gvisor-containerd-shim /usr/local/bin -``` - -2. Create the configuration for the gvisor shim in `/etc/containerd/gvisor-containerd-shim.yaml`: - -``` -# This is the path to the default runc containerd-shim. -runc_shim = "/path/to/containerd-shim" -``` - -3. Update `/etc/containerd/config.toml`. Be sure to update the path to `gvisor-containerd-shim` and `runsc` if necessary: - -``` -disabled_plugins = ["restart"] -[plugins.linux] - shim = "/usr/local/bin/gvisor-containerd-shim" - shim_debug = true -# Uncomment the following 2 lines if you want runsc to be the default runtime. -# runtime = "/usr/local/bin/runsc" -# runtime_root = "/run/containerd/runsc" -# To support the untrusted-workload annotation. -[plugins.cri.containerd.untrusted_workload_runtime] - runtime_type = "io.containerd.runtime.v1.linux" - runtime_engine = "/usr/local/bin/runsc" - runtime_root = "/run/containerd/runsc" -[plugins.cri.containerd.runtimes.runsc] - runtime_type = "io.containerd.runtime.v1.linux" - runtime_engine = "/usr/local/bin/runsc" - runtime_root = "/run/containerd/runsc" -``` - -4. Restart `containerd` - -## Usage - -### CRI - -You can run containers in gVisor via containerd's CRI. - -1. Build and install crictl from HEAD: - -``` -$ go get github.com/kubernetes-sigs/cri-tools/cmd/crictl -$ sudo sh -c 'echo "runtime-endpoint: unix:///run/containerd/containerd.sock" > /etc/crictl.yaml' -``` - -2. Pull the busybox image - -``` -$ sudo crictl pull busybox -``` - -### Containerd 1.1 - -If running containerd 1.1 you will need to invoke `runsc` via the `io.kubernetes.cri.untrusted-workload` annotation. - -1. Create a pod config: - -``` -$ cat > sandbox.json << EOL -{ - "metadata": { - "name": "nginx-sandbox", - "namespace": "default", - "attempt": 1, - "uid": "hdishd83djaidwnduwk28bcsb" - }, - "annotations": { - "io.kubernetes.cri.untrusted-workload": "true" - }, - "linux": { - }, - "log_directory": "/tmp" -} -EOL -``` - -2. Run a sandbox with the `runsc` runtime. - -``` -$ sudo crictl runp sandbox.json -``` - -### Containerd 1.2 - -If running containerd 1.2 you can specify runsc as the runtime using the new runtime handler. - -1. Create a pod config: - -``` -$ cat > sandbox.json << EOL -{ - "metadata": { - "name": "nginx-sandbox", - "namespace": "default", - "attempt": 1, - "uid": "hdishd83djaidwnduwk28bcsb" - }, - "linux": { - }, - "log_directory": "/tmp" -} -EOL -``` +- [Untrusted Workload Quick Start (containerd >=1.1)](docs/untrusted-workload-quickstart.md) +- [Runtime Handler Quick Start (containerd >=1.2)](docs/runtime-handler-quickstart.md) -2. Run a sandbox with the `runsc` runtime. +# Contributing -``` -$ sudo crictl runp --runtime=runsc sandbox.json -``` +See [CONTRIBUTING.md](CONTRIBUTING.md). |