
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
IBM Suite Licensing Service (SLS) 是一个基于RLKS(Rational License Key Server)后端技术的许可系统API服务。它提供四类API接口,用于许可系统的配置、授权管理、令牌使用统计及许可管理等功能。
注意:此为预发布的开发中软件,存在潜在缺陷,请勿用于生产环境。
适用于RedHat OpenShift Container Platform 4环境中,需要通过API接口管理基于RLKS的许可系统的场景,支持许可配置、授权文件管理及令牌使用监控等需求。
基础环境要求
资源要求
最小调度容量:
| 软件 | 内存(GB) | CPU(核) | 磁盘(GB) | 节点数 |
|---|---|---|---|---|
| 总计 | 0.6 | 900m | 1 | 1 |
1. 安装cert-manager
OperatorHub提供的cert-manager版本已过时,需安装1.1.0或更高版本:
bashoc create namespace cert-manager oc apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.0/cert-manager.yaml
更多信息请参考安装说明。
2. 配置授权
创建命名空间(如ibm-sls)并创建包含IBM Entitled Registry授权密钥的Docker密钥:
bashoc new-project ibm-sls oc create secret docker-registry ibm-entitlement \ --docker-server=<你的 registry 服务器> \ --docker-username=<你的用户名> \ --docker-password=<你的密码> \
3. 配置MongoDB凭据
在部署SLS的命名空间中创建MongoDB凭据密钥:
yamlapiVersion: v1 kind: Secret type: Opaque metadata: name: sls-mongo-credentials namespace: ibm-sls data: username: "<base64编码的用户名>" password: "<base64编码的密码>"
4. 安装LicenseService实例
在创建的命名空间中安装操作员,然后创建LicenseService实例,指定适当的存储类和大小。可通过以下命令查看集群中可用的存储类:
bashoc get storageclasses
创建LicenseService实例的YAML配置示例:
yamlapiVersion: sls.ibm.com/v1 kind: LicenseService metadata: name: sls namespace: ibm-sls spec: mongo: configDb: admin nodes: - host: host1.domain.com port: 30257 - host: host2.domain.com port: 30257 secretName: sls-mongo-credentials rlks: storage: class: ibmc-block-bronze size: 5G
设置端口转发
将内部API暴露到集群外部:
shoc port-forward service/sls 7000:443
验证API运行状态
shcurl -ik https://localhost:7000/api/entitlement/config HTTP/1.1 200 OK X-Powered-By: Servlet/4.0 Content-Type: application/json Date: Mon, 12 Oct 2020 08:58:44 GMT Content-Language: en-GB Transfer-Encoding: chunked {"rlks":{"configuration":"single","hosts":[{"id":"0242ac110002","hostname":"rlks-0.rlks","port":27000}]}}
上传授权文件
shcurl -i -k -X PUT -F "file=@entitlement.lic" https://localhost:7000/api/entitlement/file HTTP/1.1 100 Continue Content-Length: 0 Date: Mon, 12 Oct 2020 08:56:59 GMT HTTP/1.1 200 OK Date: Mon, 12 Oct 2020 08:57:18 GMT X-Powered-By: Servlet/4.0 Content-Length: 0 Content-Language: en-GB
验证产品类型查询
shcurl -ik https://localhost:7000/api/products/MAS-Limited HTTP/1.1 200 OK X-Powered-By: Servlet/4.0 Content-Type: application/json Date: Mon, 12 Oct 2020 09:01:17 GMT Content-Language: en-GB Transfer-Encoding: chunked {"productId":"MAS-Limited","productVersion":"1.0","tokenId":"AppPoints","tokenCost":5,"issuedDate":"2020-04-22T00:00:00Z","expirationDate":"2023-08-30T00:00:00Z"}
验证令牌池查询
shcurl -ik https://localhost:7000/api/tokens HTTP/1.1 200 OK X-Powered-By: Servlet/4.0 Content-Type: application/json Date: Mon, 12 Oct 2020 09:02:02 GMT Content-Language: en-GB Transfer-Encoding: chunked [{"tokenId":"AppPoints","entitled":100,"used":0,"concurrent":0,"reserved":0,"expirationDate":"2023-08-30T00:00:00Z","available":100,"issuedDate":"2020-04-22T00:00:00Z"}]
安装LicenseService实例时,需指定RLKS使用的PVC存储类和容量。存储要求:
系统将自动创建名为rlks-pvc的PVC,使用ReadWriteOnce访问模式。
IBM Cloud存储
已测试支持以下IBM Cloud存储类:
加密建议
建议使用启用被动加密的存储来保护数据,许可系统本身不对持久卷执行主动加密。
备份流程
恢复流程
licenceId属性以覆盖新ID生成(需重用现有许可文件)参考Red Hat官方文档:使用Operator Lifecycle Manager升级操作员
安装前需将SecurityContextConstraints绑定到目标命名空间。已验证以下安全上下文约束可用:
restricted SCCyamlapiVersion: security.openshift.io/v1 metadata: annotations: kubernetes.io/description: "This policy is the most restrictive for SLS, requiring pods to run with a non-root UID, and preventing pods from accessing the host. The UID and GID will be bound by ranges specified at the Namespace level." name: ibm-sls-custom-scc allowHostDirVolumePlugin: false allowHostIPC: false allowHostNetwork: false allowHostPID: false allowHostPorts: false allowPrivilegeEscalation: true allowPrivilegedContainer: false allowedCapabilities: null defaultAddCapabilities: null fsGroup: type: MustRunAs kind: SecurityContextConstraint priority: 0 readOnlyRootFilesystem: false requiredDropCapabilities: - KILL - MKNOD - SETUID - SETGID runAsUser: type: MustRunAsRange seLinuxContext: type: MustRunAs supplementalGroups: type: RunAsAny users: [] volumes: - configMap - downwardAPI - emptyDir - persistentVolumeClaim - projected - secret
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务