Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions blog-cn/pouch_with_kata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# PouchContainer with kata

## Introduction

Kata Containers combines technology from Intel® Clear Containers and Hyper runV to provide the speed of containers with the security of virtual machines, the core technology is same with runV, about the detail information in vm container , you can see [runV doc](https://github.com/alibaba/pouch/blob/master/docs/features/pouch_with_runV.md).

## Prerequisites Installation

kata announces that it not provide an installation option yet, so some installation methods we get from [clear container project](https://github.com/clearcontainers), for more detail, see [kata-containers](https://github.com/kata-containers/community#users).

### Installation

1. install qemu

[QEMU](https://www.qemu.org) is required to run VMs. We can execute following commands to easily install QEMU related tools.

On physical machine with Ubuntu OS installed:

```
sudo apt-get install -y qemu qemu-kvm
```

On physical machine with Red Hat series OS installed:

```
sudo yum install -y qemu qemu-kvm
```

2. Install guest kernel and guest image

[kata-containers/osbuilder](https://github.com/kata-containers/osbuilder) provide a tool to create guest image, see the [detail steps](https://github.com/kata-containers/osbuilder#usage). Since the tool is not giving method to build guest kernel, you can see the detail steps in [clearcontainers/osbuilder](https://github.com/clearcontainers/osbuilder#build-guest-kernel).

3. install kata-runtime

In this step, we need three binary libraries to install, [kata-runtime](https://github.com/kata-containers/runtime), [kata-proxy](https://github.com/kata-containers/proxy) and [kata-shim](https://github.com/kata-containers/shim), kata-proxy and kata-shim will called by kata-runtime in running a kata container.
It is quite easy to get the binary libraries from the source code, let's take kata runtime for example, clone code from github, then make.

```shell
git clone https://github.com/kata-containers/runtime.git
cd runtime
make
```

### Configure kata runtime

Kata runtime read config from configuration file, it default path is `/etc/kata-containers/configuration.toml`.
Get default configuration file:

```shell
git clone https://github.com/kata-containers/runtime.git
cd runtime
make
```

File will be generated in `cli/config/configuration.toml`, copy the file into default path

```shell
cp cli/config/configuration.toml /etc/kata-containers/configuration.toml
```

You might need to modify this file, make sure that all binary libraries have right path in system.

### Start kata container

With all the steps finish, you can play with kata container.

```shell
$ pouch run -d --runtime=kata-runtime 8ac48589692a top
00d1f38250fc76b5e66e7fa05a41d342d1b48202d24e2dbf06b20a113b2a008c

$ pouch ps
Name ID Status Created Image Runtime
00d1f3 00d1f3 Up 5 seconds 7 seconds ago docker.io/library/busybox:latest kata-runtime
```

Enter into the kata container.

```shell
$ pouch exec -it 00d1f3 sh
/ # uname -r
4.9.47-77.container
```
82 changes: 82 additions & 0 deletions blog-cn/pouch_with_kata_chinese.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Pouch容器与kata

## 简介

Kata容器结合来自英特尔®透明容器和超runv的技术,为容器速度提供安全的虚拟机,其核心技术与runv相同,关于VM容器的详细信息,可见 [runV doc](https://github.com/alibaba/pouch/blob/master/docs/features/pouch_with_runV.md).

## 准备安装

kata 官方目前还未提供安装方式,可用的安装方法请见 [clear container project](https://github.com/clearcontainers),更多细节请见 [kata-containers](https://github.com/kata-containers/community#users)。

### 安装

1. 安装qemu

运行虚拟机需要 [QEMU](https://www.qemu.org)。可执行以下命令安装QEMU相关工具。

在Ubuntu系统的物理机器上安装命令为:

```
sudo apt-get install -y qemu qemu-kvm
```

在Red Hat系列系统的物理机器上安装命令为:

```
sudo yum install -y qemu qemu-kvm
```

2. 安装客户内核和客户镜像

[kata-containers/osbuilder](https://github.com/kata-containers/osbuilder) 提供了创建客户镜像的工具,见 [detail steps](https://github.com/kata-containers/osbuilder#usage)。 但该工具未提供构建客户内核的方法,详细步骤可参考 [clearcontainers/osbuilder](https://github.com/clearcontainers/osbuilder#build-guest-kernel)。

3. 安装kata-runtime

该过程需要安装三个二进制库 [kata-runtime](https://github.com/kata-containers/runtime), [kata-proxy](https://github.com/kata-containers/proxy) 和 [kata-shim](https://github.com/kata-containers/shim), 在运行kata容器时,kata-runtime会调用kata-proxy和kata-shim。
可以很容易从源码中获取二进制库,以kata runtime为例,从github克隆代码,然后生成。

```shell
git clone https://github.com/kata-containers/runtime.git
cd runtime
make
```

### 配置kata runtime

Kata runtime从配置文件中读取配置,默认路径为 `/etc/kata-containers/configuration.toml`。
获取默认的配置文件:

```shell
git clone https://github.com/kata-containers/runtime.git
cd runtime
make
```

文件生成在 `cli/config/configuration.toml`,将生成的文件复制到默认路径下

```shell
cp cli/config/configuration.toml /etc/kata-containers/configuration.toml
```

可能需要修改配置文件,确保所有二进制文件在系统中的路径正确。

### 启动kata容器

完成所有步骤,就可以玩kata容器啦。

```shell
$ pouch run -d --runtime=kata-runtime 8ac48589692a top
00d1f38250fc76b5e66e7fa05a41d342d1b48202d24e2dbf06b20a113b2a008c

$ pouch ps
Name ID Status Created Image Runtime
00d1f3 00d1f3 Up 5 seconds 7 seconds ago docker.io/library/busybox:latest kata-runtime
```

进入kata容器。

```shell
$ pouch exec -it 00d1f3 sh
/ # uname -r
4.9.47-77.container
```