SUSE Multi-Linux Manager 5.1 Proxy Deployment

This guide outlines the deployment process for the SUSE Multi-Linux Manager 5.1 Proxy container on SL Micro 6.1 or SUSE Linux Enterprise Server 15 SP7. This guide presumes you have already successfully deployed a SUSE Multi-Linux Manager 5.1 Server.

SL Micro is only supported as regular minion (default contact method) for the time being. We are working on managing it as Salt SSH client (salt-ssh contact method), too.

要成功完成部署,请执行以下操作:

过程:部署代理
  1. 查看硬件要求。

  2. Synchronize the SL Micro 6.1 or SUSE Linux Enterprise Server 15 SP7 parent channel and the proxy extension child channel on the server.

  3. Install SL Micro or SUSE Linux Enterprise Server on a bare-metal machine.

  4. During the installation, register SL Micro or SUSE Linux Enterprise Server along with the SUSE Multi-Linux Manager Proxy extension.

  5. 创建 Salt 激活密钥。

  6. 使用 default 连接方法将代理作为客户端引导。

  7. 生成代理配置。

  8. 将服务器中的代理配置传输到代理。

  9. 使用代理配置将客户端作为代理注册到 SUSE Multi-Linux Manager。

代理容器主机支持的操作系统

The supported operating system for the container host are SL Micro 6.1 and SUSE Linux Enterprise Server 15 SP7.

容器主机

容器主机是配备了容器引擎(例如 Podman)的服务器,可用于管理和部署容器。这些容器包含应用程序及其必备组件(例如库),但不包含完整的操作系统,因此体量很小。此设置可确保应用程序能够在不同环境中以一致的方式运行。容器主机为这些容器提供必要的资源,例如 CPU、内存和存储。

1. 代理的硬件要求

有关部署 SUSE Multi-Linux Manager 代理的硬件要求,请参见 installation-and-upgrade:hardware-requirements.adoc#proxy-hardware-requirements

2. 同步父通道和代理扩展子通道

This section presumes that you have already entered your organization credentials under the Admin  Setup Wizard  Organization Credentials in the server’s Web UI. Products are listed on the Admin  Setup Wizard  Products page. This channel must be fully synchronized on the server, with the child channel Proxy as an extension option selected.

Procedure: Synchronizing the Parent Channel and Proxy Extension
  1. 在 SUSE Multi-Linux Manager Web UI 中,选择管理  产品

  2. From the products page enter SL Micro or SUSE Linux Enterprise Server in the filter field.

  3. 接下来,在下拉列表中选择所需的体系结构,在本示例中为 x86-64。

  4. In the Product Description field select the SL Micro 6.1 or SUSE Linux Enterprise Server 15 SP7 checkbox then use the drop-down to select the SUSE Multi-Linux Manager Proxy Extension 5.1 x86_64 extension.

  5. 单击 添加产品 按钮。

  6. 等待同步完成。

3. Prepare SUSE Multi-Linux Manager Proxy Host

3.1. Install SL Micro 6.1 and Deploy Proxy

过程:下载安装媒体
  1. Locate the SL Micro 6.1 installation media at https://www.suse.com/download/sl-micro/.

  2. 需有一个 SUSE Customer Center 帐户并且必须登录才能下载 ISO。

  3. Download SL-Micro-6.1-DVD-x86_64-GM-Media1.iso.

  4. 准备一个 USB 闪存盘或 DVD 用于安装。

  5. Insert a DVD or a bootable USB stick containing the installation image for SL Micro 6.1.

  6. 引导或重引导您的系统。

For detailed documentation on preparing your machines OS (virtual or physical), see Introduction to SL Micro 6.1 Deployment.

Procedure: Installing SL Micro 6.1
  1. 使用箭头键选择安装

  2. 调整键盘和语言。单击复选框接受许可协议。

  3. 单击下一步继续。

  4. 选择注册方法。对于本示例,我们将在 SUSE Customer Center 中注册代理。

  5. 输入您的 SUSE Customer Center 电子邮件地址。

  6. Enter your registration code for SL Micro 6.1.

  7. 单击下一步继续。

  8. 选中 SUSE Multi-Linux Manager 5.1 代理扩展复选框

  9. 单击下一步继续。

  10. 输入您的 SUSE Multi-Linux Manager 5.1 代理扩展注册代码。

  11. 单击 下一步 继续。

  12. NTP 配置页面上,单击 下一步

  13. 系统身份验证页面上,输入 root 用户的口令。单击 下一步

  14. 安装设置页面上单击 安装

This finalizes installation of SL Micro 6.1 and SUSE Multi-Linux Manager 5.1 Proxy as an extension.

3.1.1. 更新系统

过程:更新系统
  1. root 身份登录。

  2. 运行 transactional-update

    transactional-update
  3. 重引导系统。

  4. 以 root 身份登录。

  5. Install the container utilities (mgrpxy should already be installed automatically):

    transactional-update pkg install mgrpxy-bash-completion

    或者,可以安装 mgrpxy-zsh-completionmgrpxy-fish-completion

  6. 重引导系统。

SL Micro is designed to update itself automatically by default and will reboot after applying updates. However, this behavior is not desirable for the SUSE Multi-Linux Manager environment. To prevent automatic updates on your server, SUSE Multi-Linux Manager disables the transactional-update timer during the bootstrap process.

If you prefer the SL Micro default behavior, enable the timer by running the following command:

systemctl enable --now transactional-update.timer

To continue with deployment, see 配置自定义永久性存储.

3.2. Install SUSE Linux Enterprise Server 15 SP7 and Deploy Proxy

Alternatively, you can install SUSE Multi-Linux Manager Proxy on SUSE Linux Enterprise Server 15 SP7. The following procedure describes the main steps of the installation process.

Procedure: Installing SUSE Multi-Linux Manager Proxy on SUSE Linux Enterprise Server 15 SP7
  1. Locate and download SUSE Linux Enterprise Server 15 SP7 .iso at https://www.suse.com/download/sles/.

  2. Make sure that the SCC code you plan to use has the Extensions enabled.

  3. Start the installation of SUSE Linux Enterprise Server 15 SP7.

    1. On the Language, keyboard and product selection select the product to install.

    2. On the License agreement read the agreement and check I Agree to the License Terms.

  4. Select the registration method.

    For SUSE Linux Enterprise Server 15 SP7, you are required to have a valid SUSE Linux Enterprise Server subscription and corresponding regcode, which you must provide on this screen. You will be required to enter the SUSE Multi-Linux Manager Extension regcode below.

  5. In the screen Extensions and Modules Selection check the following:

    • SUSE Multi-Linux Manager Proxy Extension

    • Basesystem Module

    • Containers Module

      Enter the SUSE Multi-Linux Manager Extension regcode.

  6. 完成安装。

  7. When the installation completes, log in to the newly installed server as root.

  8. Update the System (optional, if the system was not set to download updates during install):

    zypper up
  9. 重引导。

  10. Log in as root and install podman plus mgrpxy and mgrpxy-bash-completion (if not already automatically installed):

    zypper install podman mgrpxy mgrpxy-bash-completion
  11. Start the Podman service by rebooting the system, or running a command:

    systemctl enable --now podman.service

To continue with deployment, see 配置自定义永久性存储.

4. 配置自定义永久性存储

Configuring persistent storage is optional, but it is the only way to avoid serious trouble with container full disk conditions. If custom persistent storage is required for your infrastructure, use the mgr-storage-proxy tool.

  • 有关详细信息,请参见 mgr-storage-proxy --help。此工具可以简化容器存储和 Squid 缓存卷的创建。

如下所示使用命令:

mgr-storage-proxy <存储磁盘设备>

例如:

mgr-storage-proxy /dev/nvme1n1

此命令将在 /var/lib/containers/storage/volumes 中创建永久性存储卷。

有关详细信息,请参见

5. 为代理创建激活密钥

过程:创建激活密钥
  1. Navigate to Systems  Activation Keys , and click Create key.

  2. 为代理主机创建激活密钥并使用 SLE Micro 6.1 作为父通道。此密钥应包括所有建议的通道以及用作扩展子通道的代理。

  3. 继续将代理主机作为 default 客户端进行引导。

6. 将代理主机作为客户端进行引导

过程:引导代理主机
  1. 选择系统  引导

  2. 填写代理主机的相关字段。

  3. 从下拉列表中选择上一步骤中创建的激活密钥。

  4. 单击 引导

  5. 等待引导过程成功完成。检查 Salt 菜单,确认 Salt 密钥已列出并已接受。

  6. 重引导代理主机。

  7. 系统列表中选择主机,并在所有事件完成后再次触发重引导以完成初始配置。

过程:更新代理主机
  1. 系统列表中选择主机,并应用所有补丁以将其更新。

  2. 重引导代理主机。

7. Generate Proxy Configuration

SUSE Multi-Linux Manager 代理的配置存档由 SUSE Multi-Linux Manager 服务器生成。每个附加代理都需要自身的配置存档。

对于 Podman 部署,在生成此代理配置之前,必须将 SUSE Multi-Linux Manager 代理的容器主机作为客户端注册到 SUSE Multi-Linux Manager 服务器。

如果使用代理 FQDN 生成非注册客户端的代理容器配置(如 Kubernetes 用例中那样),系统列表中将出现一个新的系统项。此新项将显示在之前输入的“代理 FQDN”值下方并属于外部系统类型。

7.1. 使用 Web UI 生成代理配置

Procedure: Generating a Proxy Container Configuration Using Web UI
  1. 在 Web UI 中,导航到系统  代理配置,然后填写所需数据:

  2. 代理 FQDN字段中,键入代理的完全限定域名。

  3. 父 FQDN字段中,键入 SUSE Multi-Linux Manager 服务器或另一个 SUSE Multi-Linux Manager 代理的完全限定域名。

  4. 代理 SSH 端口字段中,键入 SSH 服务在 SUSE Multi-Linux Manager 代理上监听的 SSH 端口。建议保留默认值 8022。

  5. In the Max Squid cache size [MB] field type maximal allowed size for Squid cache. Recommended is to use at most 80% of available storage for the containers.

    2 GB 表示默认的代理 squid 缓存大小。需要根据您的环境调整此大小。

  6. SSH 证书选择列表中,选择应为 SUSE Multi-Linux Manager 代理生成新服务器证书还是使用现有证书。您可以考虑作为 SUSE Multi-Linux Manager 内置(自我签名)证书生成的证书。

    然后根据所做的选择提供用于生成新证书的签名 CA 证书的路径,或者要用作代理证书的现有证书及其密钥的路径。

    服务器生成的 CA 证书存储在 /var/lib/containers/storage/volumes/root/_data/ssl-build 目录中。

    有关现有或自定义证书的详细信息以及企业和中间证书的概念,请参见 导入 SSL 证书

  7. 单击 生成 以在 SUSE Multi-Linux Manager 服务器中注册新代理 FQDN,并生成包含容器主机细节的配置存档 (config.tar.gz)。

  8. 片刻之后,系统会显示文件可供下载。请将此文件保存在本地。

7.2. Generate Proxy Configuration With spacecmd and Self-Signed Certificate

可以使用 spacecmd 生成代理配置。

过程:使用 spacecmd 和自我签名证书生成代理配置
  1. 通过 SSH 连接到您的容器主机。

  2. 执行以下命令(替换其中的服务器和代理 FQDN):

    mgrctl exec -ti 'spacecmd proxy_container_config_generate_cert -- dev-pxy.example.com dev-srv.example.com 2048 email@example.com -o /tmp/config.tar.gz'
  3. 从服务器容器复制生成的配置:

    mgrctl cp server:/tmp/config.tar.gz

7.3. Generate Proxy Configuration With spacecmd and Custom Certificate

可以使用 spacecmd 为自定义证书(而不是默认的自我签名证书)生成代理配置。

过程:使用 spacecmd 和自定义证书生成代理配置
  1. 通过 SSH 连接到您的服务器容器主机。

  2. 执行以下命令(替换其中的服务器和代理 FQDN):

    for f in ca.crt proxy.crt proxy.key; do
      mgrctl cp $f server:/tmp/$f
    done
    mgrctl exec -ti 'spacecmd proxy_container_config -- -p 8022 pxy.example.com srv.example.com 2048 email@example.com /tmp/ca.crt /tmp/proxy.crt /tmp/proxy.key -o /tmp/config.tar.gz'
  3. 从服务器容器复制生成的配置:

    mgrctl cp server:/tmp/config.tar.gz

8. 传输代理配置

Web UI 将生成配置存档。需要在代理容器主机上提供此存档。

过程:复制代理配置
  1. 从服务器容器将上一步生成的配置存档 (config.tar.gz) 复制到服务器主机(如果还未执行此操作):

    mgrctl cp server:/root/config.tar.gz
  2. 将服务器主机中的文件复制到代理主机(如果还未执行此操作):

    scp config.tar.gz <代理 FQDN>:/root
  3. 在代理主机上使用以下命令安装代理:

    mgrpxy install podman config.tar.gz

9. 启动 SUSE Multi-Linux Manager 代理

现在可以使用 mgrpxy 命令启动容器:

过程:启动代理并检查状态
  1. 调用以下命令启动代理:

    mgrpxy start
  2. 调用以下命令检查容器状态:

    mgrpxy status

    应该会显示以下五个 SUSE Multi-Linux Manager 代理容器,并且它们应该是 proxy-pod 容器 Pod 的一部分:

    • proxy-salt-broker

    • proxy-httpd

    • proxy-tftpd

    • proxy-squid

    • proxy-ssh

10. Use a Custom Container Image for a Service

默认情况下,SUSE Multi-Linux Manager 代理套件配置为针对其每个服务使用相同的映像版本和注册表路径。但是,可以使用以 -tag-image 结尾的 install 参数覆盖特定服务的默认值。

例如:

mgrpxy install podman --httpd-tag 0.1.0 --httpd-image registry.opensuse.org/uyuni/proxy-httpd /path/to/config.tar.gz

该命令会在重启动 httpd 服务之前调整其配置文件。其中 registry.opensuse.org/uyuni/proxy-httpds 是要使用的映像,0.1.0 是版本标记。

要重置为默认值,请再次运行 install 命令但不要指定这些参数:

mgrpxy install podman /path/to/config.tar.gz

此命令首先将所有服务的配置重置为全局默认值,然后重新装载配置。