Skip to content
首页配置Chart Values

Chart Values ​

本文档描述了 KubeOsprey Helm Chart 的所有可用配置选项。

基础配置 ​

参数描述默认值
replicaCount副本数量1
image.repository容器镜像仓库ghcr.io/fadewalk/kube-osprey
image.pullPolicy镜像拉取策略IfNotPresent
image.tag镜像标签。如果设置,将覆盖 chart 的 appVersion。""
imagePullSecrets私有镜像仓库的拉取密钥[]
nameOverride覆盖 chart 名称""
fullnameOverride覆盖完整名称""
debug启用调试模式false
basePath应用的基础路径,详见安装文档中的说明。""
deploymentStrategy.type部署策略类型。SQLite 配合 ReadWriteOnce 存储时必须使用 Recreate,避免升级时同一个卷被两个 Pod 同时挂载Recreate

认证与安全 ​

参数描述默认值
anonymousUserEnabled启用匿名用户访问,拥有完全管理员权限。生产环境请谨慎使用。false
jwtSecret用于签名 JWT 令牌的密钥。为空时首次启动自动生成。使用 secret.existingSecret 时被忽略。""
encryptKey用于加密敏感数据的密钥。留空时为新建的 Chart Secret 生成随机值,或使用 secret.existingSecret。恢复已有数据库时必须保持不变。""
host应用程序的主机名""

Secret 配置 ​

默认情况下,Chart 会根据 jwtSecret、encryptKey、db.type、db.dsn 生成一个 Kubernetes Secret。

参数描述默认值
secret.create是否由 Chart 创建 Secrettrue
secret.existingSecret使用已有 Secret 的名称。设置后忽略 jwtSecret、encryptKey、db.type 和 db.dsn""

已有 Secret 必须包含以下键:

  • JWT_SECRET
  • KUBE_OSPREY_ENCRYPT_KEY
  • DB_TYPE(取值 sqlite、postgres、mysql;未设置时默认 sqlite)
  • DB_DSN(SQLite 时可不填)

数据库配置 ​

参数描述默认值
db.type数据库类型:sqlite、postgres、mysqlsqlite
db.dsnMySQL/Postgres 的完整 DSN 字符串。当类型为 mysql/postgres 时必需""

SQLite 配置 ​

参数描述默认值
db.sqlite.persistence.pvc.enabled是否创建 PVC 来存储 sqlite 数据库文件false
db.sqlite.persistence.pvc.existingClaim使用现有的 PVC""
db.sqlite.persistence.pvc.storageClassPVC 的 StorageClass(可选)""
db.sqlite.persistence.pvc.accessModesPVC 的访问模式["ReadWriteOnce"]
db.sqlite.persistence.pvc.sizePVC 请求的存储大小1Gi
db.sqlite.persistence.hostPath.enabled是否使用 hostPath 存储false
db.sqlite.persistence.hostPath.pathhostPath 路径/path/to/host/dir
db.sqlite.persistence.hostPath.typehostPath 类型DirectoryOrCreate
db.sqlite.persistence.mountPath容器内的挂载路径/data
db.sqlite.persistence.filename挂载路径内的 sqlite 文件名kube-osprey.db

插件存储 ​

适用于 KubeOsprey v0.16.0 及以上版本。插件目录默认为 /data/plugins,可复用 SQLite 挂载在 /data 的存储卷。默认不启用持久化。

参数描述默认值
plugins.directory容器内的插件目录,对应 PLUGIN_DIR/data/plugins
plugins.persistence.enabled为插件文件挂载独立的 PVCfalse
plugins.persistence.existingClaim使用已有 PVC,不创建新 PVC""
plugins.persistence.storageClass新 PVC 的 StorageClass,留空使用集群默认值""
plugins.persistence.accessModes新 PVC 的访问模式["ReadWriteOnce"]
plugins.persistence.size新 PVC 请求的存储大小1Gi

WARNING

插件目录未使用持久化存储时,Pod 重建会丢失插件文件。从官方插件目录安装的插件会重新下载,需要能够访问下载源;手动上传的插件需要重新上传。

自动下载依赖数据库中的安装记录,因此还需持久化 SQLite 数据库或使用外部数据库。

使用 SQLite 时,开启数据库持久化,并保持 plugins.persistence.enabled: false,数据库和插件即可共用一个 PVC:

yaml
deploymentStrategy:
  type: Recreate

db:
  sqlite:
    persistence:
      pvc:
        enabled: true

如果修改了 db.sqlite.persistence.mountPath,也需要将 plugins.directory 设为该路径下的子目录,才能继续复用存储卷。

使用 MySQL 或 PostgreSQL 时,单独开启插件持久化:

yaml
deploymentStrategy:
  type: Recreate

plugins:
  directory: /data/plugins
  persistence:
    enabled: true
    size: 1Gi

如需使用已有 PVC,将 plugins.persistence.existingClaim 设为 KubeOsprey 所在命名空间中的 PVC 名称。单副本使用 ReadWriteOnce 存储时,将部署策略设为 Recreate,避免升级时卷挂载冲突。

MCP 服务 ​

参数描述默认值
mcp.enabled内置 MCP 服务(POST /api/v1/mcp)的初始默认值。首次运行写入通用设置,之后可在管理界面调整false
mcp.rateLimitPerMinuteMCP 工具调用每用户每分钟的限流次数60

配置文件 ​

通过 Helm 值管理配置文件时,Chart 将其挂载到容器的 /etc/kite/config.yaml(对应 KUBE_OSPREY_CONFIG_FILE 环境变量),相关配置部分在 UI 中变为只读。

参数描述默认值
config.enabled是否启用配置文件管理false
config.existingSecret包含 config.yaml 键的已有 Secret 名称,设置后忽略内联配置""

配置文件的完整格式与两种提供方式(已有 Secret / 内联)见配置文件。

环境变量 ​

参数描述默认值
extraEnvs额外的环境变量列表[]

服务账户配置 ​

参数描述默认值
serviceAccount.create是否创建服务账户true
serviceAccount.automount自动挂载服务账户的 API 凭据true
serviceAccount.annotations服务账户的注解{}
serviceAccount.name使用的服务账户名称""

RBAC 配置 ​

参数描述默认值
rbac.create是否创建 RBAC 资源true
rbac.rulesRBAC 规则列表见下方示例

RBAC 规则示例 ​

yaml
rbac:
  rules:
    - apiGroups: ["*"]
      resources: ["*"]
      verbs: ["*"]
    - nonResourceURLs: ["*"]
      verbs: ["*"]

Pod 配置 ​

参数描述默认值
podAnnotationsPod 的 Kubernetes 注解{}
podLabelsPod 的 Kubernetes 标签{}
podSecurityContextPod 安全上下文{}
securityContext容器安全上下文{}

服务配置 ​

参数描述默认值
service.type服务类型ClusterIP
service.port服务端口8080

Ingress 配置 ​

参数描述默认值
ingress.enabled是否启用 Ingressfalse
ingress.classNameIngress 类名"nginx"
ingress.annotationsIngress 注解{}
ingress.hostsIngress 主机配置见下方示例
ingress.tlsTLS 配置[]

Ingress 主机配置示例 ​

yaml
ingress:
  hosts:
    - host: kube-osprey.example.com
      paths:
        - path: /
          pathType: ImplementationSpecific

资源限制 ​

参数描述默认值
resources容器资源限制和请求{}

资源限制示例 ​

yaml
resources:
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 100m
    memory: 128Mi

健康检查 ​

参数描述默认值
livenessProbe存活探针配置见下方示例
readinessProbe就绪探针配置见下方示例

健康检查示例 ​

yaml
livenessProbe:
  httpGet:
    path: /healthz
    port: http
  initialDelaySeconds: 10
  periodSeconds: 10
readinessProbe:
  httpGet:
    path: /readyz
    port: http
  initialDelaySeconds: 10
  periodSeconds: 10
  timeoutSeconds: 3
  failureThreshold: 6

存储配置 ​

参数描述默认值
volumes额外的卷配置[]
volumeMounts额外的卷挂载配置[]

调度配置 ​

参数描述默认值
nodeSelector节点选择器{}
tolerations容忍度配置[]
affinity亲和性配置{}

Released under the Apache License.