配置说明
说明: 此文档仅对重要参数加以解释说明,部分参数因作用相似或雷同,这里不加以赘述。
- 所有非第三方服务均可以自定义服务名
<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" / "ee" / "saas"
用于指定部署版本,为社区版、企业版或 SaaS 版。不同版本会影响镜像 tag、启用的功能以及依赖项。saas edition 于 v2.2.0 新增。
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: "registry.opencsg.com/opencsghq"
image:
registry: "registry.opencsg.com"
tag: "v1.11.0"
pullPolicy: "IfNotPresent"
pullSecrets:
- acr-pull-secret
-
imageRegistry
默认
docker.io。指定 envoyGateway 的全局镜像仓库。如果是国内使用可以设置为
registry.opencsg.com/opencsghq。 -
registry
默认
docker.io。此参数会覆盖 helm chart 中所有镜像的镜像仓库,通常不建议修改,默认会依赖镜像的原镜像仓库拉取相关镜像。可能是 docker.io 等。如果是国内使用可以设置为
registry.opencsg.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
1.6 ChartContext 上下文配置
global:
chartContext:
isBuiltIn: true
-
isBuiltIn
默认
true(主 chart 位于global.chartContext.isBuiltIn,安装 csghub 主服务时通常保持默认即可)。主要作用是为了实现 dataflow,runner,csgship chart 的无缝集成,标识 chart 是独立部署还是和 csghub 主服务捆绑部署。
2. CSGHub Core 核心服务配置
2.1 Image(核心服务镜像)
image:
registry: "registry.opencsg.com"
tag: "v1.11.0"
pullPolicy: "IfNotPresent"
pullSecrets:
- acr-pull-secret
此参数作用和 global.image作用类似,但是作用域仅局限在以 csghub-server/csghub-portal 镜像启动的服务。
优先级设定:
global.image < image(Here) < <service>.image
2.2 Logging 日志
logging:
level: "info" or "warning" or "debug" or "error"
默认 info。
用于设置以 csghub-server 镜像启动的所有服务的日志级别。全局控制日志级别。
3. Portal 前端
3.1 Image 镜像设置
portal:
repository: "opencsghq/csghub-portal"
其他配置可忽略,继承自global.image和image。
优先级设定:
global.image < image < portal.image
3.2 Gateway API访问配置
不做赘述,作用同global.gateway,但无法声明gateway.service.type,其他所有参数优先级高于global.image。
3.3 Docs 文档中心设置
portal:
docs:
service: "docs-svc"
port: 8080
此处配置用于将 CSGHub 文档中心的 /docs 路由到集群内已存在的 K8s Service(CSGHub 无内置文档中心)。
-
service
指定外部部署的文档中心实例对应的 K8s Service 名称。
-
port
指定该 Service 的目标端口。
不再支持
domain/host+port写法(自 v2.5.0 起改为直连已有 Service)。
3.4 PostgreSQL 配置
portal:
postgresql:
host: "<postgresql host>"
port: "<postgreql port>"
database: "<postgresql csghub portal database>"
user: "<postgresql user>"
password: "<postgresql password>"
timezone: "Etc/UTC"
sslmode: "prefer"
用于定义 Portal 的数据库连接信息,相对于global.postgresql.external多了database参数,因为此参数无法全局指定,所有组件使用同一个数据库是不建议的行为,helm chart 内部也未做适配。
标准参数设定,不做赘述。
优先级设定:
global.postgresql.external < portal.postgresql
3.5 ObjectStore 配置
portal:
objectStore:
endpoint: "<object store endpoint>"
accessKey: "<object store access key>"
secretKey: "<object store secret key>"
bucket: "<object store public bucket>"
region: "<object store region>"
secure: <true|false> # 是否启用 HTTPS 加密访问
encrypt: <true|false> # 是否启用服务端加密
pathStyle: <true|false> # 是否使用 path-style addressing
用于定义 Portal 的对象存储连接信息,相对于global.objectStore.external多了bucket参数,因为此参数无法全局指定,所有组件使用同一个数据库是不建议的行为,helm chart 内部也未做适配。
优先级设定:
global.objectStore.external < portal.objectStore
4. Server 后端
4.1 gitlabShell
server:
gitlabShell:
sshPort: 22
用于定义使用git over ssh克隆时的 ssh 服务的端口号。LoadBalancer模式下默认为 22,NodePort模式下默认为30022,通常不建议修改,因为这涉及到 Gateway API Controller TCP 暴露规则的调整。
4.2 multiSync 多源同步
server:
multiSync:
enabled: true
proxy: "<proxy to connect internet>"
-
enabled
默认
true。表示启用多源同步。
-
proxy
默认
nil。用于指定多源同步时连接互联网使用的网络代理。
4.3 SwaggerAPI 配置
server:
swaggerAPI:
enabled: false
-
enabled
默认
false。不启用 swaggerAPI 辅助实例。
5. RProxy 配置
rproxy:
coredns:
enabled: true
image:
repository: "coredns/coredns"
tag: "1.11.1"
nginx:
enabled: true
image:
repository: "nginx"
tag: "latest"
此部分内容不做过多解释。coredns 和 nginx 是v1.12.0之前版本辅助 rproxy 做流量转发的组件,自v1.12.0开始,这两个组件废弃,不再使用。