SUSE Manager 5.0 代理部署
This guide outlines the deployment process for the SUSE Manager 5.0 Proxy container on SLE Micro 5.5 or SUSE Linux Enterprise Server 15 SP6. This guide presumes you have already successfully deployed a SUSE Manager 5.0 Server.
目前,SLE Micro 仅支持作为常规的受控端( |
要成功完成部署,请执行以下操作:
-
查看硬件要求。
-
Synchronize the SLE Micro 5.5 or SUSE Linux Enterprise Server 15 SP6 parent channel and the proxy extension child channel on the server.
-
Install SLE Micro or SUSE Linux Enterprise Server on a bare-metal machine.
-
During the installation, register SLE Micro or SUSE Linux Enterprise Server along with the SUSE Manager Proxy extension.
-
创建 Salt 激活密钥。
-
使用
default
连接方法将代理作为客户端引导。 -
生成代理配置。
-
将服务器中的代理配置传输到代理。
-
使用代理配置将客户端作为代理注册到 SUSE Manager。
代理容器主机支持的操作系统
容器主机支持的操作系统为 SLE Micro 5.5 和 SUSE Linux Enterprise Server 15 SP6。
|
1. 代理的硬件要求
有关部署 SUSE Manager 代理的硬件要求,请参见 installation-and-upgrade:hardware-requirements.adoc#proxy-hardware-requirements。
2. 同步父通道和代理扩展子通道
This section presumes that you have already entered your organization credentials under the Proxy
as an extension option selected.
-
在 SUSE Manager Web UI 中,选择
。 -
From the products page enter SLE Micro or SUSE Linux Enterprise Server in the filter field.
-
接下来,在下拉列表中选择所需的体系结构,在本示例中为 x86-64。
-
In the
Product Description
field select the SLE Micro 5.5 or SUSE Linux Enterprise Server 15 SP6 checkbox then use the drop-down to select theSUSE Manager Proxy Extension 5.0 x86_64
extension. -
单击 添加产品 按钮。
-
等待同步完成。
3. Prepare SUSE Manager Proxy Host
3.1. Install SLE Micro 5.5 and Deploy Proxy
-
在 https://www.suse.com/download/sle-micro/ 上找到 SLE Micro 5.5 安装媒体。
-
需有一个 SUSE Customer Center 帐户并且必须登录才能下载 ISO。
-
下载
SLE-Micro-5.5-DVD-x86_64-GM-Media1.iso
。 -
准备一个 USB 闪存盘或 DVD 用于安装。
-
插入包含 SLE Micro 5.5 安装映像的 DVD 或可引导 U 盘。
-
引导或重引导您的系统。
有关准备计算机操作系统(虚拟机或物理机)的详细文档,请参见 SLE Micro 5.5 部署指南。
-
使用箭头键选择
安装
。 -
调整键盘和语言。单击
复选框
接受许可协议。 -
单击
下一步
继续。 -
选择注册方法。对于本示例,我们将在 SUSE Customer Center 中注册代理。
-
输入您的 SUSE Customer Center 电子邮件地址。
-
输入您的 SLE Micro 5.5 注册代码。
-
单击
下一步
继续。 -
选中 SUSE Manager 5.0 代理扩展
复选框
。 -
单击
下一步
继续。 -
输入您的 SUSE Manager 5.0 代理扩展注册代码。
-
单击 下一步 继续。
-
在
NTP 配置
页面上,单击 下一步。 -
在
系统身份验证
页面上,输入 root 用户的口令。单击 下一步。 -
在
安装设置
页面上单击 安装。
将 SLE Micro 5.5 和 SUSE Manager 5.0 代理安装为扩展的过程到此完成。
3.1.1. 更新系统
-
以 root 身份登录。
-
运行 transactional-update:
transactional-update
-
重引导系统。
-
以 root 身份登录。
-
Install the container utilities (
mgrpxy
should already be installed automatically):transactional-update pkg install mgrpxy-bash-completion
或者,可以安装
mgrpxy-zsh-completion
或mgrpxy-fish-completion
。 -
重引导系统。
SLE Micro 设计为默认自动更新,并在应用更新后会重引导。但是,这种行为对于 SUSE Manager 环境而言是不利的。为了防止服务器自动更新,SUSE Manager 会在引导过程中禁用 transactional-update 计时器。 如果您希望保留 SLE Micro 的默认行为,请运行以下命令来启用计时器:
|
To continue with deployment, see 配置自定义永久性存储.
3.2. Install SUSE Linux Enterprise Server 15 SP6 and Deploy Proxy
您也可以在 SUSE Linux Enterprise Server 15 SP6 上安装 SUSE Manager 代理。下面的过程介绍了安装流程的主要步骤。
-
在 https://www.suse.com/download/sles/ 上查找并下载 SLE Micro SUSE Linux Enterprise Server 15 SP6
.iso
。 -
确保要使用的 SCC 代码已启用扩展。
-
在 SUSE Linux Enterprise Server 15 SP6 上启动安装过程。
-
在
语言、键盘和产品选择
中选择要安装的产品。 -
在
许可协议
中,阅读协议并选中我同意许可条款
。
-
-
选择注册方法。
Please note that for SUSE Linux Enterprise Server 15 SP6, 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 Manager Extension regcode below.
-
在
扩展和模块选择
屏幕中,选中以下几项:-
SUSE Manager 代理扩展
-
Basesystem 模块
-
Containers 模块
Enter the SUSE Manager Extension regcode.
-
-
完成安装。
-
安装完成后,以 root 身份登录新安装的服务器。 Update the System (optional, if the system was not set to download updates during install):
zypper up
-
重引导。
-
Log in as root and install
podman
plusmgrpxy
andmgrpxy-bash-completion
(if not already automatically installed):zypper install podman mgrpxy mgrpxy-bash-completion
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
此命令将在 有关详细信息,请参见 |
5. 为代理创建激活密钥
-
导航到
,然后单击 创建密钥。 -
为代理主机创建激活密钥并使用 SLE Micro 5.5 作为父通道。此密钥应包括所有建议的通道以及用作扩展子通道的代理。
-
继续将代理主机作为
default
客户端进行引导。
6. 将代理主机作为客户端进行引导
-
选择
。 -
填写代理主机的相关字段。
-
从下拉列表中选择上一步骤中创建的激活密钥。
-
单击 引导。
-
等待引导过程成功完成。检查 Salt 菜单,确认 Salt 密钥已列出并已接受。
-
重引导代理主机。
-
从系统列表中选择主机,并在所有事件完成后再次触发重引导以完成初始配置。
-
从系统列表中选择主机,并应用所有补丁以将其更新。
-
重引导代理主机。
7. 生成代理配置
SUSE Manager 代理的配置存档由 SUSE Manager 服务器生成。每个附加代理都需要自身的配置存档。
2 GB 表示默认的代理 squid 缓存大小。需要根据您的环境调整此大小。 |
对于 Podman 部署,在生成此代理配置之前,必须将 SUSE Manager 代理的容器主机作为客户端注册到 SUSE Manager 服务器。 |
如果使用代理 FQDN 生成非注册客户端的代理容器配置(如 Kubernetes 用例中那样),系统列表中将出现一个新的系统项。此新项将显示在之前输入的“代理 FQDN”值下方并属于外部
系统类型。
7.1. 使用 Web UI 生成代理配置
-
在 Web UI 中,导航到
,然后填写所需数据: -
在
代理 FQDN
字段中,键入代理的完全限定域名。 -
在
父 FQDN
字段中,键入 SUSE Manager 服务器或另一个 SUSE Manager 代理的完全限定域名。 -
在
代理 SSH 端口
字段中,键入 SSH 服务在 SUSE Manager 代理上监听的 SSH 端口。建议保留默认值 8022。 -
在
最大 Squid 缓存大小 [MB]
字段中键入允许的最大 Squid 缓存大小。建议的最大大小为容器可用存储的 60%。2 GB 表示默认的代理 squid 缓存大小。需要根据您的环境调整此大小。
在 SSH 证书
选择列表中,选择应为 SUSE Manager 代理生成新服务器证书还是使用现有证书。您可以考虑作为 SUSE Manager 内置(自我签名)证书生成的证书。
+ 然后根据所做的选择提供用于生成新证书的签名 CA 证书的路径,或者要用作代理证书的现有证书及其密钥的路径。
+
服务器生成的 CA 证书存储在 /var/lib/containers/storage/volumes/root/_data/ssl-build
目录中。
+ 有关现有或自定义证书的详细信息以及企业和中间证书的概念,请参见 导入 SSL 证书。
-
单击 生成 以在 SUSE Manager 服务器中注册新代理 FQDN,并生成包含容器主机细节的配置存档 (
config.tar.gz
)。 -
片刻之后,系统会显示文件可供下载。请将此文件保存在本地。

7.2. 使用 spacecmd 和自我签名证书生成代理配置
可以使用 spacecmd
生成代理配置。
-
通过 SSH 连接到您的容器主机。
-
执行以下命令(替换其中的服务器和代理 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'
-
从服务器容器复制生成的配置:
mgrctl cp server:/tmp/config.tar.gz .
7.3. 使用 spacecmd 和自定义证书生成代理配置
可以使用 spacecmd
为自定义证书(而不是默认的自我签名证书)生成代理配置。
-
通过 SSH 连接到您的服务器容器主机。
-
执行以下命令(替换其中的服务器和代理 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'
-
从服务器容器复制生成的配置:
mgrctl cp server:/tmp/config.tar.gz .
8. 传输代理配置
Web UI 将生成配置存档。需要在代理容器主机上提供此存档。
-
从服务器容器将上一步生成的配置存档 (
config.tar.gz
) 复制到服务器主机(如果还未执行此操作):mgrctl cp server:/root/config.tar.gz
-
将服务器主机中的文件复制到代理主机(如果还未执行此操作):
scp config.tar.gz <代理 FQDN>:/root
-
在代理主机上使用以下命令安装代理:
mgrpxy install podman config.tar.gz
9. 启动 SUSE Manager 代理
现在可以使用 mgrpxy
命令启动容器:
-
调用以下命令启动代理:
mgrpxy start
-
调用以下命令检查容器状态:
mgrpxy status
应该会显示以下五个 SUSE Manager 代理容器,并且它们应该是
proxy-pod
容器 Pod 的一部分:-
proxy-salt-broker
-
proxy-httpd
-
proxy-tftpd
-
proxy-squid
-
proxy-ssh
-
9.1. 为服务使用自定义容器映像
默认情况下,SUSE 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
此命令首先将所有服务的配置重置为全局默认值,然后重新装载配置。