Incus:新一代容器与虚拟机编排管理引擎

Incus是什么?

Incus是一个用于编排管理应用型容器、系统型容器及虚拟机实例的管理工具。它是对 Canonical LXD 的继承与发展,引入了更多的存储驱动支持。

Incus项目的产品地址:Linux Containers - Incus - Introduction

在 LXC-Incus 项目中,容器被分为两类:一是应用型容器(当前流行的产品主要有 docker 、podman、Containerd)、一是系统型容器(主要由 LXC 驱动,当前流行的管理工具是 LXD)。此二者之间的区别是:应用型容器智能运行一个APP、系统型容器可以同时运行多个APP(可以媲美于虚拟机)。

Incus的服务端组件支持在多个 Linux发行版上部署(目前尚不支持Windows或Mac-Unix发行版);

Incus的客户端组件可以在 Linux/Windows/Mac-Unix平台上部署。

以下以在 Debian 12 为例 展示 Incus 的 C/S组件部署过程:

【整个部署过程均需要使用 root 账户】

Step 1 :更新 OS 的组件包

apt clean all && apt update -y && apt upgrade -y

Step 2 :配置 Incus 的 Repository

mkdir -vp /etc/apt/keyrings/

curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc

sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc

EOF'

Step 3 :安装 Incus-Server

apt clean all && apt update -y && apt upgrade -y

apt install -y incus

Step 4 :安装 Incus-Client

apt install -y incus-client incus-ui-canonical

查看当前安装的Incus版本信息

incus version

初始化 Incus 的 underlay设施(主要是网络与存储环境初始化)

incus admin init

创建一个容器

root@debian-Hasee:~# incus image --help
Description:
  Manage images

  Instances are created from images. Those images were themselves
  either generated from an existing instance or downloaded from an image
  server.

  When using remote images, the server will automatically cache images for you
  and remove them upon expiration.

  The image unique identifier is the hash (sha-256) of its representation
  as a compressed tarball (or for split images, the concatenation of the
  metadata and rootfs tarballs).

  Images can be referenced by their full hash, shortest unique partial
  hash or alias name (if one is set).

Usage:
  incus image [flags]
  incus image [command]

Available Commands:
  alias          Manage image aliases
  copy           Copy images between servers
  delete         Delete images
  edit           Edit image properties
  export         Export and download images
  get-property   Get image properties
  import         Import images into the image store
  info           Show useful information about images
  list           List images
  refresh        Refresh images
  set-property   Set image properties
  show           Show image properties
  unset-property Unset image properties

Global Flags:
      --debug          Show all debug messages
      --force-local    Force using the local unix socket
  -h, --help           Print help
      --project        Override the source project
  -q, --quiet          Don't show progress information
      --sub-commands   Use with help or --help to view sub-commands
  -v, --verbose        Show all information messages
      --version        Print version number

Use "incus image [command] --help" for more information about a command.
root@debian-Hasee:~#

root@debian-Hasee:~# incus launch --help
Description:
  Create and start instances from images

Usage:
  incus launch [<remote>:]<image> [<remote>:][<name>] [flags]

Aliases:
  launch, init

Examples:
  incus launch images:ubuntu/22.04 u1

  incus launch images:ubuntu/22.04 u1 < config.yaml
      Create and start a container with configuration from config.yaml

  incus launch images:ubuntu/22.04 u2 -t aws:t2.micro
      Create and start a container using the same size as an AWS t2.micro (1 vCPU, 1GiB of RAM)

  incus launch images:ubuntu/22.04 v1 --vm -c limits.cpu=4 -c limits.memory=4GiB
      Create and start a virtual machine with 4 vCPUs and 4GiB of RAM

Flags:
  -c, --config                Config key/value to apply to the new instance
      --console[="console"]   Immediately attach to the console
  -d, --device                New key/value to apply to a specific device
      --empty                 Create an empty instance
  -e, --ephemeral             Ephemeral instance
  -n, --network               Network name
      --no-profiles           Create the instance with no profiles applied
  -p, --profile               Profile to apply to the new instance
  -s, --storage               Storage pool name
      --target                Cluster member name
  -t, --type                  Instance type
      --vm                    Create a virtual machine

Global Flags:
      --debug          Show all debug messages
      --force-local    Force using the local unix socket
  -h, --help           Print help
      --project        Override the source project
  -q, --quiet          Don't show progress information
      --sub-commands   Use with help or --help to view sub-commands
  -v, --verbose        Show all information messages
      --version        Print version number
root@debian-Hasee:~#

使用 Ubuntu 映像创建一个 container

使用 Ubuntu 映像创建一个 machine

从以下table中可以看出,Incus的容器使用了vTEP、Incus的虚拟机使用了vHardware

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-03 22:54:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-03 22:54:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-03 22:54:03       87 阅读
  4. Python语言-面向对象

    2024-04-03 22:54:03       96 阅读

热门阅读

  1. pip install PyQt5 ssl error

    2024-04-03 22:54:03       38 阅读
  2. Python实战:打造学生信息管理系统

    2024-04-03 22:54:03       37 阅读
  3. PostCSS及其常用插件介绍

    2024-04-03 22:54:03       29 阅读
  4. 【python】网络爬虫——Scrapy

    2024-04-03 22:54:03       38 阅读
  5. 【CSS】选择器

    2024-04-03 22:54:03       39 阅读
  6. 【CSS】高级元素:列表、表格、表单

    2024-04-03 22:54:03       38 阅读
  7. day16-二叉树part03

    2024-04-03 22:54:03       33 阅读
  8. [Flutter]页面跳转和传值

    2024-04-03 22:54:03       32 阅读
  9. Python实现的网页爬虫示例

    2024-04-03 22:54:03       34 阅读
  10. sql中如何添加数据

    2024-04-03 22:54:03       35 阅读
  11. 一文搞懂用户认证方案怎么做

    2024-04-03 22:54:03       31 阅读
  12. oracle19静默安装

    2024-04-03 22:54:03       33 阅读