容器化 SUSE Multi-Linux Manager Proxy 设置

为 SUSE Multi-Linux Manager Proxy 容器准备好容器主机后,需要额外执行几步容器设置才能完成配置。

过程
  1. 生成 SUSE Multi-Linux Manager Proxy 配置归档文件

  2. 将配置归档传输到在安装步骤中准备的容器主机并解压缩

  3. Start the proxy sevices with mgrpxy

1. 生成代理配置

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

对于容器化 SUSE Multi-Linux Manager 代理,您必须构建新的代理配置文件,然后重新部署容器以使更改生效。此流程适用于更新设置(包括 SSL 证书)。

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

If a proxy FQDN is used to generate a proxy container configuration that is not a registered client (as in the Kubernetes use case), a new system entry will appear in system list. This new entry will be shown under previously entered Proxy FQDN value and will be of Foreign system type.

外围服务器始终使用第三方 SSL 证书。如果中心服务器已为外围服务器生成证书,则还需为外围数据库生成证书。在中心服务器上,为每台待迁移的外围服务器运行以下命令。

mgrctl exec -ti -- rhn-ssl-tool --gen-server --dir="/root/ssl-build" --set-country="COUNTRY" \
  --set-state="STATE" --set-city="CITY" --set-org="ORGANIZATION" \
  --set-org-unit="ORGANIZATION UNIT" --set-email="name@example.com" \
  --set-hostname=PROXY --set-cname="proxy.example.com"

需要使用的文件包括: * /root/ssl-build/RHN-ORG-TRUSTED-SSL-CERT as the root CA, * /root/ssl-build/<hostname>/server.crt as the proxy certificate and * /root/ssl-build/<hostname>/server.key as the proxy certificate’s key.

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

过程:使用 Web UI 生成代理容器配置
  1. 在 Web UI 中,导航到系统  代理配置,然后填写所需数据。

  2. In the Proxy FQDN field type fully qualified domain name for the proxy.

  3. In the Parent FQDN field type fully qualified domain name for the SUSE Multi-Linux Manager Server or another SUSE Multi-Linux Manager Proxy.

  4. In the Proxy SSH port field type SSH port on which SSH service is listening on SUSE Multi-Linux Manager Proxy. Recommended is to keep default 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 缓存大小。需要根据您的环境调整此大小。

In the SSL certificate selection list choose if new server certificate should be generated for SUSE Multi-Linux Manager Proxy or an existing one should be used. You can consider generated certificates as SUSE Multi-Linux Manager builtin (self signed) certificates.

+

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

+

The CA certificates generated by the server are stored in the /var/lib/containers/storage/volumes/root/_data/ssl-build directory.

+

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

  1. Click Generate to register a new proxy FQDN in the SUSE Multi-Linux Manager Server and generate a configuration archive (config.tar.gz) containing details for the container host.

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

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

You can generate a Proxy configuration using 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 .

1.3. Generate Proxy Configuration With spacecmd and Custom Certificate

You can generate a Proxy configuration using spacecmd for custom certificates rather than the default self-signed certificates.

过程:使用 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. 如果您的设置使用中间 CA,请同时复制该证书,并在命令中通过 -i 选项(可根据需要多次提供)包含该证书:

    mgrctl cp intermediateCA.pem server:/tmp/intermediateCA.pem
    mgrctl exec -ti 'spacecmd proxy_container_config -- -p 8022 -i /tmp/intermediateCA.pem pxy.example.com srv.example.com 2048 email@example.com /tmp/ca.crt /tmp/proxy.crt /tmp/proxy.key -o /tmp/config.tar.gz'
  4. 从服务器容器复制生成的配置:

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

2. 传输 SUSE Multi-Linux Manager 代理配置

Both spacecmd command and generating via Web UI ways create a configuration archive. This archive needs to be made available on container host. Transfer this generated archive to the container host.

3. 启动 SUSE Multi-Linux Manager 代理容器

Container can be started with the mgrpxy command.

过程:启动 SUSE Multi-Linux Manager 代理容器
  1. 运行以下命令:

    mgrpxy start uyuni-proxy-pod
  2. 调用以下命令检查所有容器是否都已按预期启动:

    podman ps

Five SUSE Multi-Linux Manager Proxy containers should be present and should be part of proxy-pod container pod.

  • proxy-salt-broker

  • proxy-httpd

  • proxy-tftpd

  • proxy-squid

  • proxy-ssh