ragflow_config.yaml


Overview

The ragflow_config.yaml file is a Kubernetes configuration manifest that defines ConfigMaps for the Ragflow application. ConfigMaps are Kubernetes objects used to store non-confidential configuration data in key-value pairs or configuration files, which can then be mounted into pods or accessed by containers at runtime.

This file serves two main purposes:

  1. Ragflow Service Configuration:
    It dynamically injects the Ragflow service configuration and LLM (Large Language Model) factory definitions into ConfigMaps from Helm chart values. This enables flexible and environment-specific configuration management.

  2. Nginx Configuration for Ragflow Web Service:
    It provides Nginx configuration files as ConfigMaps to configure the Nginx server that acts as a reverse proxy and static file server for the Ragflow web UI and API backend.


Detailed Explanation

Kubernetes ConfigMaps in this file

The file consists of two distinct ConfigMap resources:


1. ragflow-service-config ConfigMap

Template Logic

This portion uses Helm templating syntax to inject values:

{{- with .Values.ragflow.service_conf }}
local.service_conf.yaml: |
  {{- . | toYaml | nindent 4 }}
{{- end }}
{{- with .Values.ragflow.llm_factories }}
llm_factories.json: |
  {{- . | toPrettyJson | nindent 4 }}
{{- end }}

Usage Example:

If in your Helm values you have:

ragflow:
  service_conf:
    someSetting: true
  llm_factories:
    factory1:
      type: openai
      api_key: "xxx"

These will be rendered into the ConfigMap as YAML and JSON respectively, then mounted into the Ragflow pods.


2. nginx-config ConfigMap


Key Configuration Details

ragflow.conf
proxy.conf
nginx.conf

Interaction with Other Parts of the System


Important Implementation Details


Visual Diagram

The following flowchart illustrates the relationships and data flow between configuration sources and consumers within this file:

flowchart TD
    A[Helm Chart Values]
    B[ragflow-service-config ConfigMap]
    C[nginx-config ConfigMap]
    D[Ragflow Service Pods]
    E[Nginx Pods/Containers]

    A -->|Injects service_conf & llm_factories| B
    A -->|Static Nginx config (fixed)| C

    B -->|Mounted or accessed| D
    C -->|Mounted as config files| E

    E -->|Serves static web UI| Users[End Users]
    E -->|Proxies API requests| D

Summary

This file is critical for configuring the Ragflow application’s runtime behavior and web server setup in a Kubernetes environment.


End of documentation for ragflow_config.yaml