From 5f3614c3ce0f3901d8c68b447703c1b4329d117e Mon Sep 17 00:00:00 2001 From: wbsong111 Date: Fri, 8 Aug 2025 16:45:11 +0900 Subject: [PATCH] Add custom-values.yaml, CUSTOM-README.md --- charts/ragflow/CUSTOM-README.md | 183 ++++++++++++++++++++++++++++++ charts/ragflow/custom-values.yaml | 164 ++++++++++++++++++++++++++ 2 files changed, 347 insertions(+) create mode 100644 charts/ragflow/CUSTOM-README.md create mode 100644 charts/ragflow/custom-values.yaml diff --git a/charts/ragflow/CUSTOM-README.md b/charts/ragflow/CUSTOM-README.md new file mode 100644 index 0000000..5a41532 --- /dev/null +++ b/charts/ragflow/CUSTOM-README.md @@ -0,0 +1,183 @@ +# RAGFlow 배포 + +## 1. 배포 방법 +- 명령어 + ``` sh + $ helm upgrade ragflow ../ragflow --install \ + --namespace ragflow \ + -f ./custom-values.yaml \ + --create-namespace + ``` + + + +## 2. custom-values.yaml 설명 + +- custom-values.yaml에 정의된 값에 대한 설명이다. + +### 1) 환경 변수 설정 +- RAGFlow 및 관련 서비스들의 환경 변수를 설정한다. + +| Name | 설명 | 기본값 | +| ---------------------- | ------------------------------------------------------------ | ------ | +| `env.DOC_ENGINE` | 문서 엔진 타입 설정. `elasticsearch` 또는 `infinity` 선택 가능 | `infinity` | +| `env.STACK_VERSION` | Elasticsearch 버전 설정 | `"8.11.3"` | +| `env.ELASTIC_PASSWORD` | Elasticsearch 비밀번호 | `infini_rag_flow_helm` | +| `env.MYSQL_PASSWORD` | MySQL 비밀번호 | `infini_rag_flow_helm` | +| `env.MYSQL_DBNAME` | MySQL 데이터베이스 이름 | `rag_flow` | +| `env.MINIO_ROOT_USER` | MinIO 사용자명 | `rag_flow` | +| `env.MINIO_PASSWORD` | MinIO 비밀번호 | `infini_rag_flow_helm` | +| `env.REDIS_PASSWORD` | Redis 비밀번호 | `infini_rag_flow_helm` | +| `env.RAGFLOW_IMAGE` | RAGFlow Docker 이미지 | `infiniflow/ragflow:v0.19.0-slim` | +| `env.TIMEZONE` | 로컬 시간대 설정 | `"Asia/Shanghai"` | + + + +### 2) RAGFlow 서비스 설정 +- RAGFlow 메인 서비스의 설정을 관리한다. + +| Name | 설명 | 기본값 | +| ------------------------ | ---------------------------------- | --------- | +| `ragflow.service.type` | RAGFlow 서비스 타입 설정 | `ClusterIP` | +| `ragflow.api.service.enabled` | API 서비스 활성화 여부 | `true` | +| `ragflow.api.service.type` | API 서비스 타입 설정 | `ClusterIP` | +| `ragflow.deployment.strategy` | 배포 전략 설정 | `` | +| `ragflow.deployment.resources` | 리소스 제한 설정 | `` | + + + +### 3) Infinity 서비스 설정 +- Infinity 문서 엔진 서비스 설정 (DOC_ENGINE이 infinity일 때 사용) + +| Name | 설명 | 기본값 | +| --------------------------- | ------------------------------------------------------------ | ----------------------- | +| `infinity.image.repository` | Infinity 이미지 저장소 | `infiniflow/infinity` | +| `infinity.image.tag` | Infinity 이미지 태그 | `v0.6.0-dev3` | +| `infinity.storage.className` | 스토리지 클래스 이름 | `` | +| `infinity.storage.capacity` | 스토리지 용량 | `5Gi` | +| `infinity.service.type` | 서비스 타입 | `ClusterIP` | + + + +### 4) Elasticsearch 서비스 설정 +- Elasticsearch 문서 엔진 서비스 설정 (DOC_ENGINE이 elasticsearch일 때 사용) + +| Name | 설명 | 기본값 | +| --------------------------- | ------------------------------------------------------------ | ----------------------- | +| `elasticsearch.storage.className` | 스토리지 클래스 이름 | `` | +| `elasticsearch.storage.capacity` | 스토리지 용량 | `20Gi` | +| `elasticsearch.deployment.resources.requests.cpu` | CPU 요청량 | `"4"` | +| `elasticsearch.deployment.resources.requests.memory` | 메모리 요청량 | `"16Gi"` | +| `elasticsearch.service.type` | 서비스 타입 | `ClusterIP` | + + + +### 5) MinIO 서비스 설정 +- 객체 스토리지 서비스 설정 + +| Name | 설명 | 기본값 | +| --------------------------- | ------------------------------------------------------------ | ----------------------- | +| `minio.image.repository` | MinIO 이미지 저장소 | `quay.io/minio/minio` | +| `minio.image.tag` | MinIO 이미지 태그 | `RELEASE.2023-12-20T01-00-02Z` | +| `minio.storage.className` | 스토리지 클래스 이름 | `` | +| `minio.storage.capacity` | 스토리지 용량 | `5Gi` | +| `minio.service.type` | 서비스 타입 | `ClusterIP` | + + + +### 6) MySQL 서비스 설정 +- 관계형 데이터베이스 서비스 설정 + +| Name | 설명 | 기본값 | +| --------------------------- | ------------------------------------------------------------ | ----------------------- | +| `mysql.image.repository` | MySQL 이미지 저장소 | `mysql` | +| `mysql.image.tag` | MySQL 이미지 태그 | `8.0.39` | +| `mysql.storage.className` | 스토리지 클래스 이름 | `` | +| `mysql.storage.capacity` | 스토리지 용량 | `5Gi` | +| `mysql.service.type` | 서비스 타입 | `ClusterIP` | + + + +### 7) Redis 서비스 설정 +- 캐시 및 세션 스토리지 서비스 설정 + +| Name | 설명 | 기본값 | +| --------------------------- | ------------------------------------------------------------ | ----------------------- | +| `redis.image.repository` | Redis 이미지 저장소 | `valkey/valkey` | +| `redis.image.tag` | Redis 이미지 태그 | `8` | +| `redis.storage.className` | 스토리지 클래스 이름 | `` | +| `redis.storage.capacity` | 스토리지 용량 | `5Gi` | +| `redis.persistence.enabled` | 데이터 영속성 활성화 | `true` | +| `redis.service.type` | 서비스 타입 | `ClusterIP` | + + + +### 8) Ingress 설정 + +#### 8.1) 기본 Ingress 설정 + +- RAGFlow 웹 인터페이스 외부 노출을 위한 Ingress 설정 + ``` yaml + ingress: + enabled: true + className: "kong" + hosts: + - host: ragflow.example.org + paths: + - path: / + pathType: ImplementationSpecific + tls: + - secretName: ragflow-tls + hosts: + - ragflow.example.org + ``` + +#### 8.2) TLS 시크릿 직접 생성 + +- Ingress 사용을 위해서는 인증서를 secret으로 제공해야한다. 로컬 파일을 이용해 secret을 생성하는 방법은 다음과 같다. + ``` sh + kubectl create secret tls ragflow-tls --cert= --key= -n + ``` + +#### 8.3) cert-manager를 이용한 자동 생성 + +- cert manager를 통해 인증서 자동 생성 시 `custom-values.yaml` 수정한다. +- `ingress.annotations.cert-manager.io/cluster-issuer`에 미리 배포된 Cluster Issuer의 이름으로 변경한다. + ``` yaml + ingress: + enabled: true + className: "kong" + annotations: + cert-manager.io/cluster-issuer: "selfsigned-issuer" + cert-manager.io/duration: 8760h + cert-manager.io/renew-before: 720h + hosts: + - host: ragflow.example.org + paths: + - path: / + pathType: ImplementationSpecific + tls: + - hosts: + - ragflow.example.org + secretName: ragflow-tls + ``` + + +## 3. 주요 설정 가이드 + +### 3.1) 문서 엔진 선택 +- `env.DOC_ENGINE`을 통해 문서 엔진을 선택할 수 있습니다. + - `elasticsearch`: 안정적이고 검증된 검색 엔진 + - `infinity`: 고성능 벡터 검색 엔진 (권장) + +### 3.2) 리소스 설정 +- 각 서비스별로 `deployment.resources`에서 CPU/메모리 리소스를 설정할 수 있습니다. +- Elasticsearch는 기본적으로 4 CPU, 16Gi 메모리를 요청합니다. + +### 3.3) 스토리지 설정 +- 모든 서비스에서 `storage.className`을 통해 스토리지 클래스를 지정할 수 있습니다. +- 각 서비스별로 적절한 스토리지 용량을 설정하세요. + +### 3.4) 보안 설정 +- 모든 비밀번호는 기본값에서 변경하여 사용하세요. +- OIDC를 통한 외부 인증 시스템 연동이 가능합니다. \ No newline at end of file diff --git a/charts/ragflow/custom-values.yaml b/charts/ragflow/custom-values.yaml new file mode 100644 index 0000000..3cb4481 --- /dev/null +++ b/charts/ragflow/custom-values.yaml @@ -0,0 +1,164 @@ +# Based on docker compose .env file +env: + # The type of doc engine to use. + # Available options: + # - `elasticsearch` (default) + # - `infinity` (https://github.com/infiniflow/infinity) + # DOC_ENGINE: elasticsearch + DOC_ENGINE: infinity + + # The version of Elasticsearch. + STACK_VERSION: "8.11.3" + + # The password for Elasticsearch + ELASTIC_PASSWORD: infini_rag_flow_helm + + # The password for MySQL + MYSQL_PASSWORD: infini_rag_flow_helm + # The database of the MySQL service to use + MYSQL_DBNAME: rag_flow + + # The username for MinIO. + MINIO_ROOT_USER: rag_flow + # The password for MinIO + MINIO_PASSWORD: infini_rag_flow_helm + + # The password for Redis + REDIS_PASSWORD: infini_rag_flow_helm + + # The RAGFlow Docker image to download. + # Defaults to the v0.19.0-slim edition, which is the RAGFlow Docker image without embedding models. + RAGFLOW_IMAGE: infiniflow/ragflow:v0.19.0-slim + # + # To download the RAGFlow Docker image with embedding models, uncomment the following line instead: + # RAGFLOW_IMAGE: infiniflow/ragflow:v0.19.0 + # + # The Docker image of the v0.19.0 edition includes: + # - Built-in embedding models: + # - BAAI/bge-large-zh-v1.5 + # - BAAI/bge-reranker-v2-m3 + # - maidalun1020/bce-embedding-base_v1 + # - maidalun1020/bce-reranker-base_v1 + # - Embedding models that will be downloaded once you select them in the RAGFlow UI: + # - BAAI/bge-base-en-v1.5 + # - BAAI/bge-large-en-v1.5 + # - BAAI/bge-small-en-v1.5 + # - BAAI/bge-small-zh-v1.5 + # - jinaai/jina-embeddings-v2-base-en + # - jinaai/jina-embeddings-v2-small-en + # - nomic-ai/nomic-embed-text-v1.5 + # - sentence-transformers/all-MiniLM-L6-v2 + # + # + + # The local time zone. + TIMEZONE: "Asia/Shanghai" + + # Uncomment the following line if you have limited access to huggingface.co: + # HF_ENDPOINT: https://hf-mirror.com + + # The maximum file size for each uploaded file, in bytes. + # You can uncomment this line and update the value if you wish to change 128M file size limit + # MAX_CONTENT_LENGTH: "134217728" + # After making the change, ensure you update `client_max_body_size` in nginx/nginx.conf correspondingly. + +ragflow: + deployment: + strategy: + resources: + service: + # Use LoadBalancer to expose the web interface externally + type: ClusterIP + api: + service: + enabled: true + type: ClusterIP + +infinity: + image: + repository: infiniflow/infinity + tag: v0.6.0-dev3 + storage: + className: + capacity: 5Gi + deployment: + strategy: + resources: + service: + type: ClusterIP + +elasticsearch: + storage: + className: + capacity: 20Gi + deployment: + strategy: + resources: + requests: + cpu: "4" + memory: "16Gi" + service: + type: ClusterIP + +minio: + image: + repository: quay.io/minio/minio + tag: RELEASE.2023-12-20T01-00-02Z + storage: + className: + capacity: 5Gi + deployment: + strategy: + resources: + service: + type: ClusterIP + +mysql: + image: + repository: mysql + tag: 8.0.39 + storage: + className: + capacity: 5Gi + deployment: + strategy: + resources: + service: + type: ClusterIP + +redis: + image: + repository: valkey/valkey + tag: 8 + storage: + className: + capacity: 5Gi + persistence: + enabled: true + deployment: + strategy: + resources: + service: + type: ClusterIP + + +# This block is for setting up web service ingress. For more information, see: +# https://kubernetes.io/docs/concepts/services-networking/ingress/ +ingress: + enabled: true + className: "kong" + annotations: + cert-manager.io/cluster-issuer: root-ca-issuer + cert-manager.io/duration: 8760h + cert-manager.io/renew-before: 720h + konghq.com/https-redirect-status-code: '301' + konghq.com/protocols: https + hosts: + - host: ragflow.gke.paasup.io + paths: + - path: / + pathType: ImplementationSpecific + tls: + - secretName: ragflow-tls + hosts: + - ragflow.gke.paasup.io