配置说明
说明: 此文档仅对重要参数加以解释说明,部分参数因作用相似或雷同,这里不加以赘述。
- 所有非第三方服务均可以自定义服务名
<service>.name,用以更改服务名称以及 gateway API 暴露的域名(portal 主域名除外)。- 所有非第三方服务均可以定义 deployment,statefulset 的绝大部署相关属性,例如 labels, annotations, replicas, serviceAccount, environments, resources, volumeMounts, livenessProbe, readinessProbe, startupProbe, lifecycle, stdin,tty, volumes, nodeSelector, tolerations, affinity, securityContext 等等。
本文档用于说明 CSGHub Helm Chart 中的重要配置项,包括全局配置、核心服务配置、内置组件以及各项参数的优先级说明。适用于部署、运维及二次开发人员。
1. Global 全局配置
1.1 edition 发行版
global:
edition: "ce" or "ee"
用于指定部署版本,为社区版或企业版。不同版本会影响镜像 tag、启用的功能以及依赖项。
1.2 Gateway API 访问配置
global:
gateway:
external:
domain: "csghub.example.com"
# public: "public.example.com"
tls:
enabled: false
secretName: "<kubernetes tls secret name>"
service:
type: "LoadBalancer" or "NodePort"
nodePorts:
http: 30080
https: 30443
gitssh: 30022
-
gateway
-
external
-
domain
默认
csghub.example.com。CSGHub 对外访问使用的域名,这里和之前的版本有所不同,不再使用基础域名。
-
例如:如果最终通过 http://csghub.example.com 进行访问,这里配置
csghub.example.com即可。 -
其他服务域名根据当前域名的基础域名进行生成,例如
casdoor.example.com。 -
如果你指定的域名是二级域名,例如
example.com, 则最终会引用csghub.example.com,自动追加前缀。
-
-
public
默认
nil。当使用独立域名访问推理、微调、MCP、SPACE 等实例的时候,需要用到独立域名分配给每个服务。
默认是
<domain>,如果需要修改请指定单独域名,例如public.exmaple.com,这里最终会以泛域名形式进行引用。此处不可直接指定泛域名。
-
-
tls
-
enabled
默认
false。- true:启用 HTTPS 加密访问,开启 HTTPS 必须提供 secretName。
- false: 不启用 HTTPS 加密访问。
-
secretName
默认
nil。指定所要使用的域名证书,请确保域名证书至少包含 public 泛域名,例如:
-
public 未指定,domain 指定为
csghub.example.com,则域名证书至少要包含*.csghub.example.com。 -
public 指定
public.example.com,则域名证书至少要包含*.public.example.com。
-
-
-
service
-
type
默认
LoadBalancer。指定 Gateway API Controller 的对外暴露方式,可选值
LoadBalancer或NodePort。注意:此值需要在部署时指定,部署后修改 svc 类型的方式可能会影响访问。
-
nodePorts (仅 type = NodePort 有效)
-
http
默认
30080。指定 80 端口对应的 NodePort 端口。
-
https
默认
30443。指定 443 端口对应的 NodePort 端口。
-
gitssh
默认
30022。指定 22 端口对应的 NodePort 端口。
-
-
-
优先级设定:
global.gateway < gateway < <service>.gateway
1.3 Image 全局镜像配置
global:
imageRegistry: "opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsghq"
image:
registry: "opencsg-registry.cn-beijing.cr.aliyuncs.com"
tag: "v1.11.0"
pullPolicy: "IfNotPresent"
pullSecrets:
- acr-pull-secret
-
imageRegistry
默认
docker.io。指定 envoyGateway 的全局镜像仓库。如果是国内使用可以设置为
opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsghq。 -
registry
默认
docker.io。此参数会覆盖 helm chart 中所有镜像的镜像仓库,通常不建议修改,默认会依赖镜像的原镜像仓库拉取相关镜像。可能是 docker.io 等。如果是国内使用可以设置为
opencsg-registry.cn-beijing.cr.aliyuncs.com(envoyGateway 不受 此参数限制,请参考imageRegistry)。 -
tag
用来定义 csghub 镜像的版本号。如果镜像 namespace 属于 opencsghq,模板会根据 tag 是否合规自动补全 edition 等标识。例如示例中的 tag 在实际渲染时会输出为
v1.11.0-ce/v1.11.0-ee。 -
pullPolicy
默认
IfNotPresent。镜像拉取策略。
-
pullSecrets
默认
nil。配置拉取秘钥从私有镜像仓库拉取镜像。
优先级设定:
global.image < image < <service>.image
1.4 Persistence 全局存储
global:
persistence:
storageClass: "hostpath"
accessModes: ["ReadWriteOnce"]
size: "10Gi"
-
storageClass
默认
nil。所有 Statefulset 默认使用的存储类。
-
accessModes
默认
ReadWriteOnce。所有 Statefulset 默认使用的访问模式。
-
Size
默认
10Gi。所有 Statefulset 创建 PVC 默认的存储卷大小。
优先级设定:
global.persistence < <service>.persistence
1.5 PostgreSQL、Redis、Mongo、Object Storage、Registry 等 external 配置
每个组件均支持:
<service>:
enabled: true or false
external: {}
-
enabled
- true:启用内置服务组件,此时 external 配置不生效
- false: 禁用此服务组件。
-
external
当 enabled 设置为 false 时,通过 external 设置对应外置服务组件的连接信息。
优先级设定:
global.service < <service>.service