diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" index ea0117c34063104cd5b8a17c664354f6b5771a1d..33e41d7b7fe9e0355f02dbc35b94be3416cf9d08 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\346\227\240\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -319,12 +319,11 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot vim values.yaml ``` - 注意: - + - 注意: 1. authHub 需要域名,可预先申请域名或在 'C:\Windows\System32\drivers\etc\hosts' 下配置。 - authhub和euler-copilot必须是同一个根域名的两个子域名, 比如authhub.test.com和 + authhub和euler-copilot必须是同一个根域名的两个子域名, 例如authhub.test.com和 eulercopilot.test.com - 2. 数据库的密码与databases的values.yaml一致 + 2. 修改tag为对应架构的tag; - 安装 AuthHub @@ -351,7 +350,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot - 登录 AuthHub - AuthHub 的域名以 为例,AuthHub 的登录界面如下图所示: + AuthHub 的域名以 为例,浏览器输入`https://authhub.test.com`, 登录界面如下图所示: ![部署图](./pictures/authhub登录界面.png) @@ -379,6 +378,12 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ```bash vim values.yaml ``` + - 注意: + 1. 查看系统架构,并修改values.yaml中的tag; + 2. 修改values.yaml中的globals的domain为EulerCopilot域名,并配置大模型的相关信息 + 3. 手动创建`docs_dir`、`plugin_dir`、`models`三个文件挂载目录 + 4. 修改values.yaml中framework章节的web_url和oidc设置 + 5. 如果部署插件,则需要配置用于Function Call的模型,此时必须有GPU环境用于部署sglang,可参考附件 - 安装 openEuler Copilot System @@ -408,6 +413,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ``` 注意:如果 Pod 状态出现失败,建议按照以下步骤进行排查 +注意:如果 Pod 状态出现失败,建议按照以下步骤进行排查 1. 查看 Kubernetes 集群的事件 (Events),以获取更多关于 Pod 失败的上下文信息 @@ -427,7 +433,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot kubectl logs rag-deploy-service-5b7887644c-sm58z -n euler-copilot ``` - 4. 验证 Kubernetes 集群的资源状态,确保没有资源限制或配额问题导致 Pod 无法正常运行。 + 4. 验证 Kubernetes 集群的资源状态,检查服务器资源或配额是否足够,资源不足常导致 Pod 镜像服拉取失败。 ```bash df -h @@ -438,6 +444,10 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot ```bash k3s -v ``` + 6. 确认 values.yaml 中 framework 的 OIDC 设置是否正确配置,以确保身份验证和授权功能正常工作。 + ```bash + vim /home/euler-copilot-framework/euler-copilot-helm/chart/euler_copilot/values.yaml + ``` ## 验证安装 @@ -546,7 +556,7 @@ openEuler Copilot System 是一款智能问答工具,使用 openEuler Copilot 5. 按照如下方式配置文件,并更新服务。 - ```bash + ```bash vim euler-copilot-helm/chart/euler_copilot/values.yaml ``` @@ -602,6 +612,10 @@ curl -k -X POST "http://localhost:8005/kb/get_answer" -H "Content-Type: applic ```text Error: INSTALLATI0N FAILED: Kubernetes cluster unreachable: Get "http:/localhost:880/version": dial tcp [:1:8089: connect: connection refused ``` +或者 +```text +Error: UPGRADE FAILED: Kubernetes cluster unreachable: the server could not find the requested resource +``` - 解决办法 @@ -656,3 +670,52 @@ curl http://localhost:30000/v1/chat/completions -H "Content-Type: application/ ```bash pip install Pydantic=1.10.13 ``` + +### 6. 如何部署sglang? +```bash +# 1. 激活 Conda 环境, 并激活 Python 3.10 的 Conda 环境。假设你的环境名为 `myenv`: +conda activate myenv + +# 2. 在激活的环境中,安装 sglang[all] 和 flashinfer +pip install sglang[all]==0.3.0 +pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ + +# 3. 启动服务器 +python -m sglang.launch_server --served-model-name Qwen2.5-32B --model-path Qwen2.5-32B-Instruct-AWQ --host 0.0.0.0 --port 8001 --api-key sk-12345 --mem-fraction-static 0.5 --tp 8 +``` +- 验证安装 +```bash +pip show sglang +pip show flashinfer +``` +- 注意: +1. API Key:请确保 `--api-key` 参数中的 API 密钥是正确的 +2. 模型路径: 确保 `--model-path` 参数中的路径是正确的,并且模型文件存在于该路径下。 +3. CUDA 版本:确保你的系统上安装了 CUDA 12.1 和 PyTorch 2.4,因为 `flashinfer` 包依赖于这些特定版本。 +4. 线程池大小:根据你的GPU资源和预期负载调整线程池大小。如果你有 8 个 GPU,那么可以选择 --tp 8 来充分利用这些资源。 + +### 7. 如何 curl embedding? +```bash +curl -k -X POST http://$IP:8001/embedding \ + -H "Content-Type: application/json" \ + -d '{"texts": ["sample text 1", "sample text 2"]}' +# $IP为vectorize的Embedding的内网地址 +``` + +### 8. 如何生成证书? +```bash +下载地址: https://github.com/FiloSottile/mkcert/releases +# 1. 下载 mkcert +# x86_64 +wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64 +# arm64 +wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-arm64 + +# 2. 执行下面的命令生成秘钥 +mkcert -install +# mkcert 可直接接域名或 IP, 生成证书和秘钥 +mkcert example.com + +# 3. 将证书和秘钥拷贝到 /home/euler-copilot-framework_openeuler/euler-copilot-helm/chart_ssl/traefik-secret.yaml 中, 并执行下面命令使其生效。 +kubectl apply -f traefik-secret.yaml +``` \ No newline at end of file diff --git "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" index fc9b76a11fda6be03a7a4070f440495329d7be05..d31b80e17fe7bd19b5091d8784f4e56570d9229a 100644 --- "a/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" +++ "b/docs/user-guide/\351\203\250\347\275\262\346\214\207\345\215\227/\347\275\221\347\273\234\347\216\257\345\242\203\344\270\213\351\203\250\347\275\262\346\214\207\345\215\227.md" @@ -1,4 +1,4 @@ -# 部署指南 +# 网络环境部署指南 ## 介绍 @@ -204,13 +204,11 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```bash vim values.yaml ``` - - 注意: - + - 注意: 1. authHub 需要域名,可预先申请域名或在 'C:\Windows\System32\drivers\etc\hosts' 下配置。 - authhub和euler-copilot必须是同一个根域名的两个子域名, 比如authhub.test.com和 + authhub和euler-copilot必须是同一个根域名的两个子域名, 例如authhub.test.com和 eulercopilot.test.com - 2. 数据库的密码与databases的values.yaml一致 + 2. 修改tag为对应架构的tag; - 安装 AuthHub @@ -237,7 +235,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree - 登录 AuthHub - AuthHub 的域名以 为例,AuthHub 的登录界面如下图所示: + AuthHub 的域名以 为例,浏览器输入`https://authhub.test.com`, 登录界面如下图所示: ![部署图](./pictures/authhub登录界面.png) @@ -265,6 +263,13 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```bash vim values.yaml ``` + - 注意: + 1. 查看系统架构,并修改values.yaml中的tag; + 2. 修改values.yaml中的globals的domain为EulerCopilot域名,并配置大模型的相关信息 + 3. 手动创建`docs_dir`、`plugin_dir`、`models`三个文件挂载目录 + 4. 修改values.yaml中framework章节的web_url和oidc设置 + 5. 如果部署插件,则需要配置用于Function Call的模型,此时必须有GPU环境用于部署sglang,可参考附件 + - 安装 openEuler Copilot System @@ -295,6 +300,8 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree 注意:如果 Pod 状态出现失败,建议按照以下步骤进行排查 +注意:如果 Pod 状态出现失败,建议按照以下步骤进行排查 + 1. 查看 Kubernetes 集群的事件 (Events),以获取更多关于 Pod 失败的上下文信息 ```bash @@ -313,7 +320,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree kubectl logs rag-deploy-service-5b7887644c-sm58z -n euler-copilot ``` - 4. 验证 Kubernetes 集群的资源状态,确保没有资源限制或配额问题导致 Pod 无法正常运行。 + 4. 验证 Kubernetes 集群的资源状态,检查服务器资源或配额是否足够,资源不足常导致 Pod 镜像服拉取失败。 ```bash df -h @@ -324,6 +331,10 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree ```bash k3s -v ``` + 6. 确认 values.yaml 中 framework 的 OIDC 设置是否正确配置,以确保身份验证和授权功能正常工作。 + ```bash + vim /home/euler-copilot-framework/euler-copilot-helm/chart/euler_copilot/values.yaml + ``` ## 验证安装 @@ -432,7 +443,7 @@ cd /home/euler-copilot-framework/euler-copilot-helm/scripts && tree 5. 按照如下方式配置文件,并更新服务。 - ```bash + ```bash vim euler-copilot-helm/chart/euler_copilot/values.yaml ``` @@ -488,6 +499,10 @@ curl -k -X POST "http://localhost:8005/kb/get_answer" -H "Content-Type: applic ```text Error: INSTALLATI0N FAILED: Kubernetes cluster unreachable: Get "http:/localhost:880/version": dial tcp [:1:8089: connect: connection refused ``` +或者 +```text +Error: UPGRADE FAILED: Kubernetes cluster unreachable: the server could not find the requested resource +``` - 解决办法 @@ -542,3 +557,50 @@ curl http://localhost:30000/v1/chat/completions -H "Content-Type: application/ ```bash pip install Pydantic=1.10.13 ``` + +### 6. 如何部署sglang? +```bash +# 1. 激活 Conda 环境, 并激活 Python 3.10 的 Conda 环境。假设你的环境名为 `myenv`: +conda activate myenv + +# 2. 在激活的环境中,安装 sglang[all] 和 flashinfer +pip install sglang[all]==0.3.0 +pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ + +# 3. 启动服务器 +python -m sglang.launch_server --served-model-name Qwen2.5-32B --model-path Qwen2.5-32B-Instruct-AWQ --host 0.0.0.0 --port 8001 --api-key sk-12345 --mem-fraction-static 0.5 --tp 8 +``` +- 验证安装 +```bash +pip show sglang +pip show flashinfer +``` +- 注意: +1. API Key:请确保 `--api-key` 参数中的 API 密钥是正确的 +2. 模型路径: 确保 `--model-path` 参数中的路径是正确的,并且模型文件存在于该路径下。 +3. CUDA 版本:确保你的系统上安装了 CUDA 12.1 和 PyTorch 2.4,因为 `flashinfer` 包依赖于这些特定版本。 +4. 线程池大小:根据你的GPU资源和预期负载调整线程池大小。如果你有 8 个 GPU,那么可以选择 --tp 8 来充分利用这些资源。 + +### 7. 如何 curl embedding? +```bash +curl -k -X POST http://$IP:8001/embedding \ + -H "Content-Type: application/json" \ + -d '{"texts": ["sample text 1", "sample text 2"]}' +# $IP为vectorize的Embedding的内网地址 +``` + +### 8. 如何生成证书? +```bash +下载地址: https://github.com/FiloSottile/mkcert/releases +# 1. 下载 mkcert +# x86_64 +wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64 +# arm64 +wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-arm64 +# 2. 执行下面的命令生成秘钥 +mkcert -install +# mkcert 可直接接域名或 IP, 生成证书和秘钥 +mkcert example.com +# 3. 将证书和秘钥拷贝到 `/home/euler-copilot-framework_openeuler/euler-copilot-helm/chart_ssl/traefik-secret.yaml` 中, 并执行下面命令使其生效。 +kubectl apply -f traefik-secret.yaml +``` \ No newline at end of file diff --git a/euler-copilot-helm/chart/agents/values.yaml b/euler-copilot-helm/chart/agents/values.yaml index 0ae954263fbe7a5f2056c52085163ca107d7cd6f..3d52d1010a51172e2e8920faaf70d3b4b6e94d6c 100644 --- a/euler-copilot-helm/chart/agents/values.yaml +++ b/euler-copilot-helm/chart/agents/values.yaml @@ -76,15 +76,15 @@ agents: # 大模型设置 llm: # 【必填】模型地址(需要包含v1后缀) - url: + url: "http:/$IP:8001/v1" # 【必填】模型名称 - name: "" + name: "Qwen2.5-32B" # 【必填】模型API Key - key: "" + key: "sk-12345" # 【必填】模型最大Token数 - max_tokens: 8096 + max_tokens: 8192 # 【必填】Embedding地址 - embedding: "http://$ip:8001/embedding" # 将IP修改为vectorize服务的内网IP + embedding: "http://vectorize-agent-service-service.euler-copilot.svc.cluster.local:8001/embedding" # 待优化机器信息 machine: # 【必填】IP地址 diff --git a/euler-copilot-helm/chart/authhub/values.yaml b/euler-copilot-helm/chart/authhub/values.yaml index 33016c8eaac9bda98917b3bba170736f38f96ccd..5044de752e6a2b7e9c8de3cb5148ecfa4d8e58b7 100644 --- a/euler-copilot-helm/chart/authhub/values.yaml +++ b/euler-copilot-helm/chart/authhub/values.yaml @@ -6,19 +6,19 @@ globals: imagePullPolicy: IfNotPresent # [必填] AuthHub部署域名 # 需要修改为AuthHub域名。单机部署时,服务基于Host进行区分,无法使用IP地址 - domain: + domain: "" # 数据库设置 databases: # [必填] database helm安装时的app name - app_name: + app_name: "databases" # [必填] database helm安装时的namespace - app_namespace: + app_namespace: "euler-copilot" # 数据库密码 passwords: # [必填] MySQL数据库的密码 - mysql: + mysql: "8URM%HtCHQPxKe$u" # [必填] Redis数据库的密码 - redis: + redis: "8FDk2rnhxVPvkSdb" # 部署AuthHub本地鉴权服务 authhub: diff --git a/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-deployment.yaml b/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-deployment.yaml index 15fbff6f6bd918951f5588022ea3e2aa88d91539..df8cee794e1095a1fde7ce5e5542750fc290cf64 100644 --- a/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-deployment.yaml +++ b/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-deployment.yaml @@ -44,10 +44,16 @@ spec: volumeMounts: - mountPath: /var/lib/postgresql/data name: pgsql-data + - mountPath: /docker-entrypoint-initdb.d/init.sql + name: pgsql-init + subPath: init.sql resources: {{- toYaml .Values.databases.pgsql.resources | nindent 12 }} volumes: - name: pgsql-data persistentVolumeClaim: claimName: pgsql-pvc-{{ .Release.Name }} + - name: pgsql-init + secret: + secretName: pgsql-secret-{{ .Release.Name }} {{- end }} diff --git a/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-secret.yaml b/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-secret.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9c83a32bcaec80091378b79e14c6bd734ea7f437 --- /dev/null +++ b/euler-copilot-helm/chart/databases/templates/pgsql/pgsql-secret.yaml @@ -0,0 +1,12 @@ +{{- if .Values.databases.pgsql.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: pgsql-secret-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +type: Opaque +stringData: + pgsql-password: {{ .Values.databases.mysql.password }} + init.sql: | +{{ tpl (.Files.Get "configs/pgsql/init.sql") . | indent 4 }} +{{- end }} diff --git a/euler-copilot-helm/chart/euler_copilot/values.yaml b/euler-copilot-helm/chart/euler_copilot/values.yaml index 6a94d35d88904a6341668d0fd9f25dd72771c9a0..c2d0afd58eb567d1e9f0d56188229c6457a990ea 100644 --- a/euler-copilot-helm/chart/euler_copilot/values.yaml +++ b/euler-copilot-helm/chart/euler_copilot/values.yaml @@ -5,7 +5,7 @@ globals: # [必填] 镜像拉取策略 imagePullPolicy: IfNotPresent # [必填] 部署域名:需要修改为EulerCopilot域名。单节点部署时,服务基于Host进行区分,无法使用IP地 - domain: + domain: "" # 用于问答和推理的大模型 llm: # [必填] 模型类型 @@ -31,17 +31,17 @@ globals: # 数据库设置 databases: # [必填] database helm安装时的app name - app_name: + app_name: "databases" # [必填] database helm安装时的namespace - app_namespace: + app_namespace: "euler-copilot" # 数据库密码 passwords: # [必填] MySQL数据库的密码 - mysql: + mysql: "8URM%HtCHQPxKe$u" # [必填] Redis数据库的密码 - redis: + redis: "8FDk2rnhxVPvkSdb" # [必填] PostgreSQL数据库密码 - postgres: + postgres: "123456" euler_copilot: # 配置文件安全复制工具 @@ -149,8 +149,8 @@ euler_copilot: nodePort: # Volume设置 volume: - # [必填] 插件包路径 - plugin_dir: # 修改为实际的插件文件夹地址 + # [必填] 插件包路径,需要手动创建目录 + plugin_dir: "/home/EulerCopilot/plugin" # [必填] JWT Key jwtKey: 13e46d8963c997814f996c3294ccc92d # 加密密钥设置 @@ -162,7 +162,7 @@ euler_copilot: # [必填] 加密密钥3 key3: D4eFgHjKlMnOpQrS3 # [必填] Web前端地址,需要添加https前缀 - web_url: + web_url: "" # 登录设置 login: # [必填] 是否启用登录 @@ -172,19 +172,19 @@ euler_copilot: # OIDC 设置 oidc: # [enabled为true时必填] OIDC 客户端ID - client_id: + client_id: "" # [enabled为true时必填] OIDC 客户端密钥 - client_secret: + client_secret: "" # [enabled为true时必填] OIDC Token获取地址 - token_url: http://authhub-backend-service-authhub.euler-copilot.svc.cluster.local:11120/oauth2/token + token_url: "http://authhub-backend-service-authhub.euler-copilot.svc.cluster.local:11120/oauth2/token" # [enabled为true时必填] OIDC 用户信息地址 - user_url: http://authhub-backend-service-authhub.euler-copilot.svc.cluster.local:11120/oauth2/introspect + user_url: "http://authhub-backend-service-authhub.euler-copilot.svc.cluster.local:11120/oauth2/introspect" # [enabled为true时必填] OIDC 刷新Token地址 - refresh_token_url: http://authhub-backend-service-authhub.euler-copilot.svc.cluster.local:11120/oauth2/refresh-token + refresh_token_url: "http://authhub-backend-service-authhub.euler-copilot.svc.cluster.local:11120/oauth2/refresh-token" # [enabled为true时必填] EulerCopilot主页地址:请将替换为 EulerCopilot 实际的域名 - euler_copilot_front: https:///api/auth/login + euler_copilot_front: "https:///api/auth/login" # [enabled为true时必填] OIDC登录跳转地址:请将修改为authhub实际域名, 替换为实际的Client ID,将替换为EulerCopilot域名 - redirect: https:///oauth2/authorize?client_id=&redirect_uri=https:///api/auth/login&scope=openid offline_access&access_type=offline&response_type=code&prompt=consent&state=235345&nonce=loser + redirect: "https:///oauth2/authorize?client_id=&redirect_uri=https:///api/auth/login&scope=openid offline_access&access_type=offline&response_type=code&prompt=consent&state=235345&nonce=loser" web: # [必填] 是否部署Web前端用户界面 enabled: true diff --git a/euler-copilot-helm/chart/witchaind/configs/backend/.env b/euler-copilot-helm/chart/witchaind/configs/backend/.env index cafa69f0a4aeaa062858d137842a7fca6719b52d..59ef32841c404b52a8dbb7b4e4ccc22cc6816943 100644 --- a/euler-copilot-helm/chart/witchaind/configs/backend/.env +++ b/euler-copilot-helm/chart/witchaind/configs/backend/.env @@ -7,7 +7,7 @@ SSL_ENABLE=false LOG=stdout # Postgres -DATABASE_URL=postgresql+asyncpg://postgres:{{ .Values.witchaind.pgsql.password }}@pgsql-db-{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local:5432/postgres +DATABASE_URL=postgresql+asyncpg://{{ .Values.globals.pgsql.user }}:{{ .Values.globals.pgsql.password }}@{{ .Values.globals.pgsql.host }}:{{ .Values.globals.pgsql.port }}/postgres # MinIO MINIO_ENDPOINT=minio-service-{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local:9000 diff --git a/euler-copilot-helm/chart/witchaind/configs/pgsql/init.sql b/euler-copilot-helm/chart/witchaind/configs/pgsql/init.sql deleted file mode 100644 index 85fba6eff9cd9ae96b6dbbe4565a204538e1b611..0000000000000000000000000000000000000000 --- a/euler-copilot-helm/chart/witchaind/configs/pgsql/init.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE EXTENSION zhparser; -CREATE EXTENSION vector; -CREATE TEXT SEARCH CONFIGURATION zhparser (PARSER = zhparser); -ALTER TEXT SEARCH CONFIGURATION zhparser ADD MAPPING FOR n,v,a,i,e,l WITH simple; \ No newline at end of file diff --git a/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-deployment.yaml b/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-deployment.yaml deleted file mode 100644 index 95f7192120b21518514d999e369249e77ebc4e91..0000000000000000000000000000000000000000 --- a/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-deployment.yaml +++ /dev/null @@ -1,53 +0,0 @@ -{{- if .Values.witchaind.pgsql.enabled }} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: pgsql-deploy-{{ .Release.Name }} - namespace: {{ .Release.Namespace }} - labels: - app: pgsql-{{ .Release.Name }} -spec: - replicas: {{ .Values.globals.replicaCount }} - selector: - matchLabels: - app: pgsql-{{ .Release.Name }} - template: - metadata: - labels: - app: pgsql-{{ .Release.Name }} - spec: - automountServiceAccountToken: false - containers: - - name: pgsql - image: "{{if ne ( .Values.witchaind.pgsql.image.registry | toString ) ""}}{{ .Values.witchaind.pgsql.image.registry }}{{ else }}{{ .Values.globals.imageRegistry }}{{ end }}/{{ .Values.witchaind.pgsql.image.name }}:{{ .Values.witchaind.pgsql.image.tag | toString }}" - imagePullPolicy: {{ if ne ( .Values.witchaind.pgsql.image.imagePullPolicy | toString ) "" }}{{ .Values.witchaind.pgsql.image.imagePullPolicy }}{{ else }}{{ .Values.globals.imagePullPolicy }}{{ end }} - ports: - - containerPort: 5432 - protocol: TCP - livenessProbe: - exec: - command: - - pg_isready - - -d postgres -U postgres - failureThreshold: 5 - initialDelaySeconds: 60 - periodSeconds: 90 - env: - - name: TZ - value: "Asia/Shanghai" - - name: POSTGRES_DB - value: "postgres" - - name: POSTGRES_USER - value: "postgres" - - name: POSTGRES_PASSWORD - value: "{{ .Values.witchaind.pgsql.password }}" - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: pgsql-data - resources: - {{- toYaml .Values.witchaind.pgsql.resources | nindent 12 }} - volumes: - - name: pgsql-data - persistentVolumeClaim: - claimName: pgsql-pvc-{{ .Release.Name }} -{{- end }} diff --git a/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-pvc.yaml b/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-pvc.yaml deleted file mode 100644 index 0beebcb6b99378c5806c793c49924c79209e3812..0000000000000000000000000000000000000000 --- a/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-pvc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if and .Values.witchaind.pgsql.enabled }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: pgsql-pvc-{{ .Release.Name }} - namespace: {{ .Release.Namespace }} - annotations: - helm.sh/resource-policy: keep -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: {{ .Values.witchaind.pgsql.persistentVolumeSize }} -{{- end }} diff --git a/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-service.yaml b/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-service.yaml deleted file mode 100644 index 72e682ecb965e2cb60541c9aadaddc1048ef494c..0000000000000000000000000000000000000000 --- a/euler-copilot-helm/chart/witchaind/templates/pgsql/pgsql-service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.witchaind.pgsql.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: pgsql-db-{{ .Release.Name }} - namespace: {{ .Release.Namespace }} -spec: - type: {{ .Values.witchaind.pgsql.service.type }} - selector: - app: pgsql-{{ .Release.Name }} - ports: - - port: 5432 - targetPort: 5432 - {{- if (and (eq .Values.witchaind.pgsql.service.type "NodePort") .Values.witchaind.pgsql.service.nodePort) }} - nodePort: {{ .Values.witchaind.pgsql.service.nodePort }} - {{- end }} -{{- end }} diff --git a/euler-copilot-helm/chart/witchaind/values.yaml b/euler-copilot-helm/chart/witchaind/values.yaml index d0a556d6da00f15ab7f8be3f7017b706a5113f81..9ca887d678c9f947fe0ee4aff09d4cbcfc9324d3 100644 --- a/euler-copilot-helm/chart/witchaind/values.yaml +++ b/euler-copilot-helm/chart/witchaind/values.yaml @@ -8,6 +8,16 @@ globals: imagePullPolicy: IfNotPresent # [必填] 域名 domain: "eulercopilot.test.com" + # [必填] Postgresql设置 + pgsql: + # [必填] 主机 + host: "pgsql-service.euler-copilot.svc.cluster.local" + # [必填] 端口 + port: 5432 + # [必填] 用户 + user: "postgres" + # [必填] 密码 + password: "123456" # [必填] LLM设置 llm: # [必填] 模型名称 @@ -44,33 +54,6 @@ witchaind: type: ClusterIP # 当类型为nodePort时,填写主机的端口号 nodePort: - pgsql: - # [必填] 是否部署PostgreSQL实例 - enabled: true - # 镜像设置 - image: - # 镜像仓库。留空则使用全局设置。 - registry: "" - # [必填] 镜像名 - name: pgsql-empty - # [必填] 镜像标签,为pg16或pg16-arm - tag: pg16 - # 拉取策略。留空则使用全局设置。 - imagePullPolicy: "" - # 性能限制设置 - resources: {} - # [必填] 容器根目录只读 - readOnly: false - # [必填] Volume大小设置 - persistentVolumeSize: 10Gi - # Service设置 - service: - # [必填] Service类型,ClusterIP或NodePort - type: ClusterIP - # 当类型为nodePort时,填写主机的端口号 - nodePort: - # [必填] 密码设置 - password: "123456" redis: # [必填] 是否部署Redis实例 enabled: true @@ -107,7 +90,7 @@ witchaind: # [必填] 镜像名 name: "data_chain_web" # [必填] 镜像标签 - tag: "1230" + tag: "0.9.2" # 拉取策略。留空则使用全局设置。 imagePullPolicy: "" # 性能限制设置