86 Star 468 Fork 272

GVPopenEuler / iSulad

 / 详情

增加iSulad对CNI网络的封装

已完成
需求
创建于  
2020-07-21 17:43

增加iSulad对CNI网络的封装

  • feature

试看Docker对一个CentOS镜像的运行::

  1. ip link add name docker0 type bridge
  2. ip addr add dev docker0 10.0.0.1/8

以上两句添加了一个桥接卡供以后使用,这是Docker的网桥内部网络机制。当前iSulad实现了CRI接口对接CNI网络的能力以支持用户使用网络。

  1. systemctl start docker
  2. docker search centos

第4句查找Docker Hub上的centos镜像。不知目前iSulad是如何实现查找镜像功能的。

  1. docker pull arm64v8/centos:7

第5句拉取标签为7的官方镜像。因为我是在鲲鹏架构的华为云ECS上做实验,所以用了arm64v8的镜像。

  1. docker images arm64v8/centos:7

查看镜像是否拉取成功。

  1. docker run -it arm64v8/centos:7 /bin/bash

第7句用被拉取下来的这个镜像以交互模式启动一个容器,并在容器里执行/bin/bash命令。

[root@a224462403c8 /]# yum -y install gcc

已在容器内部,a224462403c8是其ID。可以成功安装gcc。

  1. exit

退出容器。

对应的,iSulad运行场景:

  1. systemctl start isulad

  2. docker search centos

由于不知道如何用isulad搜素镜像,这里我用了docker命令。

  1. isula pull arm64v8/centos:7

  2. isula images arm64v8/centos:7

  3. isula run -it arm64v8/centos:7 /bin/bash

[root@localhost /]# yum -y install gcc
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?> release=7&arch=aarch64&repo=os&infra=container error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
......

以上信息表明安装gcc失败,原因是在容器内无法找到网络。因为需要预先配置CNI网络。

  1. exit

能否让iSulad对CNI网络进行封装,默认启用CNI网络?

因为这样可以大大方便用户使用网络。

注意:

为了让isulad拉取到Docker Hub上的镜像,需要在/etc/isulad/daemon.json中做如下配置:

"registry-mirrors": [
"docker.io"
]

运行环境:

  • isulad Version: Version 2.0.0
  • OS: openEuler

评论 (2)

woodrabbit 创建了需求
woodrabbit 关联仓库设置为openEuler/iSulad
展开全部操作日志

Hey @woodrabbit, Welcome to openEuler Community.
All of the projects in openEuler Community are maintained by @openeuler-ci-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md to find the details.

openeuler-ci-bot 负责人设置为lifeng_isula
lifeng_isula 负责人lifeng_isula 修改为haozi007
lifeng_isula 任务状态新建 修改为开发中
lifeng_isula 任务状态开发中 修改为已挂起
haozi007 任务状态已挂起 修改为开发中

网络分支再开发中,待合入主线

haozi007 通过openeuler/iSulad Pull Request !1253任务状态开发中 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936 5595769 duguhaotian 1605235330
C
1
https://gitee.com/openeuler/iSulad.git
git@gitee.com:openeuler/iSulad.git
openeuler
iSulad
iSulad

搜索帮助