在 K3s 上部署 SUSE Multi-Linux Manager 5.1 代理
1. 安装 K3s
SUSE Multi-Linux Manager Proxy is supported on K3s running on top of SL Micro in a single node cluster. If you need to deploy it in any other Kubernetes environment, contact support for evaluation. |
在容器主机计算机上,安装 K3s
(请将 <K3S_HOST_FQDN>
替换为 k3s 主机的 FQDN):
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--tls-san=<K3S_HOST_FQDN>" sh -
2. 安装工具
在安装时需要提供 mgrpxy
和 helm
软件包。
mgrpxy
和 helm
软件包可在 SUSE Multi-Linux Manager 代理产品储存库中找到。
-
To install it, run:
transactional-update pkg install helm mgrpxy
-
重引导
2.1. 使用 Web UI 生成代理配置
-
在 Web UI 中,导航到
,然后填写所需数据: -
在
代理 FQDN
字段中,键入代理的完全限定域名。 -
在
父 FQDN
字段中,键入 SUSE Multi-Linux Manager 服务器或另一个 SUSE Multi-Linux Manager 代理的完全限定域名。 -
在
代理 SSH 端口
字段中,键入 SSH 服务在 SUSE Multi-Linux Manager 代理上监听的 SSH 端口。建议保留默认值 8022。 -
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 缓存大小。需要根据您的环境调整此大小。
-
在
SSH 证书
选择列表中,选择应为 SUSE Multi-Linux Manager 代理生成新服务器证书还是使用现有证书。您可以考虑作为 SUSE Multi-Linux Manager 内置(自我签名)证书生成的证书。然后根据所做的选择提供用于生成新证书的签名 CA 证书的路径,或者要用作代理证书的现有证书及其密钥的路径。
服务器生成的 CA 证书存储在
/var/lib/containers/storage/volumes/root/_data/ssl-build
目录中。有关现有或自定义证书的详细信息以及企业和中间证书的概念,请参见 导入 SSL 证书。
-
单击 生成 以在 SUSE Multi-Linux Manager 服务器中注册新代理 FQDN,并生成包含容器主机细节的配置存档 (
config.tar.gz
)。 -
片刻之后,系统会显示文件可供下载。请将此文件保存在本地。
2.2. Generate Proxy Configuration With spacecmd
and Self-Signed Certificate
可以使用 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
2.3. Generate Proxy Configuration With spacecmd
and Custom Certificate
可以使用 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
3. 部署 SUSE Multi-Linux Manager 代理 helm 图表
要配置 SUSE Multi-Linux Manager 代理 Pod 使用的卷存储空间,请为以下声明定义永久性卷。如果您未自定义存储配置,K3s 将自动为您创建存储卷。
永久性卷声明已命名为:
-
squid-cache-pv-claim
-
package-cache-pv-claim
-
tftp-boot-pv-claim
Create the configuration for the SUSE Multi-Linux Manager Proxy as documented in SUSE Multi-Linux Manager 5.1 Proxy Deployment. Copy the configuration tar.gz
file and then install:
mgrpxy install kubernetes /path/to/config.tar.gz
有关详细信息,请参见 https://kubernetes.io/docs/concepts/storage/persistent-volumes/ (kubernetes) 或 https://rancher.com/docs/k3s/latest/en/storage/ (K3s) 文档。