|
2 | 2 | sidebar_position: 1 |
3 | 3 | --- |
4 | 4 |
|
5 | | -# Intro |
| 5 | +# Open WebUI |
6 | 6 |
|
| 7 | +## 简介 |
| 8 | + |
| 9 | +### Open WebUI 简介 |
| 10 | + |
| 11 | +"Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports various LLM runners like Ollama and OpenAI-compatible APIs, with built-in inference engine for RAG, making it a powerful AI deployment solution." |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +总的来说,Open WebUI 是一个 User-friendly AI Interface (Supports Ollama, OpenAI API, ...),更多内容可参考 [Open WebUI 官方文档](https://docs.openwebui.com/) |
| 16 | + |
| 17 | +### Open WebUI 扩展组件 |
| 18 | + |
| 19 | +Open WebUI 扩展组件是 KubeSphere 提供的用于集成 Open WebUI 的插件, 并内置 Ollama 用于模型部署,支持用户在 KubeSphere 中快速部署 Open WebUI,并支持通过 KubeSphere 账户进行登录。 |
| 20 | + |
| 21 | +## 最佳实践 |
| 22 | + |
| 23 | +### 安装 Open WebUI 扩展组件并部署模型 |
| 24 | + |
| 25 | +以下是在 KubeSphere 上安装 Open WebUI 扩展组件,并配置 deepseek-r1:1.5b 模型进行部署的配置文件,请根据实际情况修改配置文件中的 IP 地址和端口。然后就可以如图所示 |
| 26 | + |
| 27 | +```yaml |
| 28 | +open-webui-helper: |
| 29 | + # -- The URL of the Open WebUI |
| 30 | + # openWebUIUrl: "http://{nodeIP}:{NodePort}" |
| 31 | + openWebUIUrl: "http://172.31.19.4:32678" |
| 32 | + |
| 33 | +open-webui: |
| 34 | + ollama: |
| 35 | + enabled: true |
| 36 | + ollama: |
| 37 | + # gpu: |
| 38 | + # enabled: true |
| 39 | + # type: 'nvidia' |
| 40 | + # number: 1 |
| 41 | + models: |
| 42 | + pull: |
| 43 | + - deepseek-r1:1.5b |
| 44 | + run: |
| 45 | + - deepseek-r1:1.5b |
| 46 | + # runtimeClassName: nvidia |
| 47 | + persistentVolume: |
| 48 | + enabled: true |
| 49 | + |
| 50 | + # -- Service values to expose Open WebUI pods to cluster |
| 51 | + service: |
| 52 | + type: NodePort |
| 53 | + nodePort: "32678" |
| 54 | +``` |
| 55 | +
|
| 56 | +部署完成后,可以通过 KubeSphere 的 "组件坞" 中的 ""Open WebUI" 进行访问。 |
| 57 | +
|
| 58 | + |
| 59 | +
|
| 60 | +### 安装 Open WebUI 扩展组件并接入 KubeSphere 账户 |
| 61 | +
|
| 62 | +Open WebUI 提供了非常友好的 [SSO 接入](https://docs.openwebui.com/features/sso/) , 而 KubeSphere 也可以[作为 OIDC 身份提供者](https://docs.kubesphere.com.cn/v4.2.0/04-platform-management/05-platform-settings/04-ks-as-oidc-identity-provider/),那么,结合起来,就可以实现通过 KubeSphere 账户进行登录 Open WebUI。 |
| 63 | +
|
| 64 | +
|
| 65 | +首先,请确保已安装 KubeSphere,并配置了 portal.hostname 和 portal.port,请参考[作为 OIDC 身份提供者](https://docs.kubesphere.com.cn/v4.2.0/04-platform-management/05-platform-settings/04-ks-as-oidc-identity-provider/) 步骤进行配置。 |
| 66 | +
|
| 67 | +然后在 KubeSphere 上安装 Open WebUI 扩展组件,进行以下配置,请根据实际情况修改配置文件中的 IP 地址和端口。 |
| 68 | +
|
| 69 | +
|
| 70 | +```yaml |
| 71 | +open-webui-helper: |
| 72 | + openWebUIUrl: "http://172.31.19.4:32678" #-- The URL of the Open WebUI |
| 73 | + |
| 74 | + kubesphereAsOIDCProvider: |
| 75 | + enabeld: true #-- Enable KubeSphere as OIDC Provider |
| 76 | + |
| 77 | +open-webui: |
| 78 | + ollama: |
| 79 | + enabled: true |
| 80 | + service: |
| 81 | + type: NodePort |
| 82 | + nodePort: "32678" #-- Service NodePort to expose Open WebUI pods to cluster |
| 83 | + extraEnvVars: |
| 84 | + - name: OAUTH_TOKEN_ENDPOINT_AUTH_METHOD |
| 85 | + value: client_secret_post |
| 86 | + sso: |
| 87 | + enabled: enabled |
| 88 | + enableSignup: true |
| 89 | + oidc: |
| 90 | + enabled: true |
| 91 | + clientId: "open-webui" |
| 92 | + clientSecret: "open-webui" |
| 93 | + clientExistingSecret: "" |
| 94 | + providerUrl: "http://172.31.19.4:30880/.well-known/openid-configuration" #-- KubeSphere OIDC Provider URL |
| 95 | + providerName: "kubesphere" |
| 96 | + scopes: "openid email profile" |
| 97 | +``` |
| 98 | +
|
| 99 | +配置完成后,即可使用 KubeSphere 账户进行登录 Open WebUI。 |
| 100 | +
|
| 101 | +### 高可用部署建议 |
| 102 | +
|
| 103 | +- 将 Open WebUI 的数据库存储到外部数据库中,如 PostgreSQL。 |
| 104 | +- 部署 Redis 作为缓存,用于多副本 Open WebUI 通信, 以保证会话一致性等。 |
| 105 | +- 部署多个 Open WebUI 副本,以实现高可用。 |
| 106 | +- 可考虑 ollama 单独部署 |
0 commit comments