earayu
commited on
Commit
·
8434428
1
Parent(s):
7f80c6c
feat: add helm chart
Browse files- k8s-deploy/databases/00-config.sh +4 -4
- k8s-deploy/databases/01-prepare.sh +3 -3
- k8s-deploy/databases/02-install-database.sh +49 -11
- k8s-deploy/databases/03-uninstall-database.sh +2 -2
- k8s-deploy/databases/04-cleanup.sh +3 -3
- k8s-deploy/databases/install-kubeblocks.sh +2 -2
- k8s-deploy/databases/uninstall-kubeblocks.sh +2 -2
- k8s-deploy/install_lightrag.sh +28 -71
- k8s-deploy/install_lightrag_dev.sh +0 -1
- k8s-deploy/lightrag/templates/deployment.yaml +9 -0
- k8s-deploy/lightrag/values.yaml +5 -0
k8s-deploy/databases/00-config.sh
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
-
source "$
|
6 |
|
7 |
# Namespace configuration
|
8 |
NAMESPACE="rag"
|
@@ -15,7 +15,7 @@ HELM_REPO="https://apecloud.github.io/helm-charts"
|
|
15 |
# Set to true to enable the database, false to disable
|
16 |
ENABLE_POSTGRESQL=true
|
17 |
ENABLE_REDIS=false
|
18 |
-
ENABLE_ELASTICSEARCH=false
|
19 |
ENABLE_QDRANT=false
|
20 |
-
ENABLE_MONGODB=false
|
21 |
ENABLE_NEO4J=true
|
|
|
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
5 |
+
source "$DATABASE_SCRIPT_DIR/scripts/common.sh"
|
6 |
|
7 |
# Namespace configuration
|
8 |
NAMESPACE="rag"
|
|
|
15 |
# Set to true to enable the database, false to disable
|
16 |
ENABLE_POSTGRESQL=true
|
17 |
ENABLE_REDIS=false
|
|
|
18 |
ENABLE_QDRANT=false
|
|
|
19 |
ENABLE_NEO4J=true
|
20 |
+
ENABLE_ELASTICSEARCH=false
|
21 |
+
ENABLE_MONGODB=false
|
k8s-deploy/databases/01-prepare.sh
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
# Load configuration file
|
6 |
-
source "$
|
7 |
|
8 |
check_dependencies
|
9 |
|
10 |
# Check if KubeBlocks is already installed, install it if it is not.
|
11 |
-
source "$
|
12 |
|
13 |
# Create namespaces
|
14 |
print "Creating namespaces..."
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
5 |
# Load configuration file
|
6 |
+
source "$DATABASE_SCRIPT_DIR/00-config.sh"
|
7 |
|
8 |
check_dependencies
|
9 |
|
10 |
# Check if KubeBlocks is already installed, install it if it is not.
|
11 |
+
source "$DATABASE_SCRIPT_DIR/install-kubeblocks.sh"
|
12 |
|
13 |
# Create namespaces
|
14 |
print "Creating namespaces..."
|
k8s-deploy/databases/02-install-database.sh
CHANGED
@@ -1,23 +1,61 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
-
|
6 |
-
# KubeBlocks database installation script
|
7 |
-
# Install all database clusters
|
8 |
|
9 |
# Load configuration file
|
10 |
-
source "$
|
11 |
|
12 |
print "Installing database clusters..."
|
13 |
|
14 |
# Install database clusters based on configuration
|
15 |
-
[ "$ENABLE_POSTGRESQL" = true ] && print "Installing PostgreSQL cluster..." && helm upgrade --install pg-cluster kubeblocks/postgresql-cluster -f "$
|
16 |
-
[ "$ENABLE_REDIS" = true ] && print "Installing Redis cluster..." && helm upgrade --install redis-cluster kubeblocks/redis-cluster -f "$
|
17 |
-
[ "$ENABLE_ELASTICSEARCH" = true ] && print "Installing Elasticsearch cluster..." && helm upgrade --install es-cluster kubeblocks/elasticsearch-cluster -f "$
|
18 |
-
[ "$ENABLE_QDRANT" = true ] && print "Installing Qdrant cluster..." && helm upgrade --install qdrant-cluster kubeblocks/qdrant-cluster -f "$
|
19 |
-
[ "$ENABLE_MONGODB" = true ] && print "Installing MongoDB cluster..." && helm upgrade --install mongodb-cluster kubeblocks/mongodb-cluster -f "$
|
20 |
-
[ "$ENABLE_NEO4J" = true ] && print "Installing Neo4j cluster..." && helm upgrade --install neo4j-cluster kubeblocks/neo4j-cluster -f "$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
print_success "Database clusters installation completed!"
|
23 |
print "Use the following command to check the status of installed clusters:"
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
|
|
|
5 |
|
6 |
# Load configuration file
|
7 |
+
source "$DATABASE_SCRIPT_DIR/00-config.sh"
|
8 |
|
9 |
print "Installing database clusters..."
|
10 |
|
11 |
# Install database clusters based on configuration
|
12 |
+
[ "$ENABLE_POSTGRESQL" = true ] && print "Installing PostgreSQL cluster..." && helm upgrade --install pg-cluster kubeblocks/postgresql-cluster -f "$DATABASE_SCRIPT_DIR/postgresql/values.yaml" --namespace $NAMESPACE --version $ADDON_CLUSTER_CHART_VERSION
|
13 |
+
[ "$ENABLE_REDIS" = true ] && print "Installing Redis cluster..." && helm upgrade --install redis-cluster kubeblocks/redis-cluster -f "$DATABASE_SCRIPT_DIR/redis/values.yaml" --namespace $NAMESPACE --version $ADDON_CLUSTER_CHART_VERSION
|
14 |
+
[ "$ENABLE_ELASTICSEARCH" = true ] && print "Installing Elasticsearch cluster..." && helm upgrade --install es-cluster kubeblocks/elasticsearch-cluster -f "$DATABASE_SCRIPT_DIR/elasticsearch/values.yaml" --namespace $NAMESPACE --version $ADDON_CLUSTER_CHART_VERSION
|
15 |
+
[ "$ENABLE_QDRANT" = true ] && print "Installing Qdrant cluster..." && helm upgrade --install qdrant-cluster kubeblocks/qdrant-cluster -f "$DATABASE_SCRIPT_DIR/qdrant/values.yaml" --namespace $NAMESPACE --version $ADDON_CLUSTER_CHART_VERSION
|
16 |
+
[ "$ENABLE_MONGODB" = true ] && print "Installing MongoDB cluster..." && helm upgrade --install mongodb-cluster kubeblocks/mongodb-cluster -f "$DATABASE_SCRIPT_DIR/mongodb/values.yaml" --namespace $NAMESPACE --version $ADDON_CLUSTER_CHART_VERSION
|
17 |
+
[ "$ENABLE_NEO4J" = true ] && print "Installing Neo4j cluster..." && helm upgrade --install neo4j-cluster kubeblocks/neo4j-cluster -f "$DATABASE_SCRIPT_DIR/neo4j/values.yaml" --namespace $NAMESPACE --version $ADDON_CLUSTER_CHART_VERSION
|
18 |
+
|
19 |
+
# Wait for databases to be ready
|
20 |
+
print "Waiting for databases to be ready..."
|
21 |
+
TIMEOUT=600 # Set timeout to 10 minutes
|
22 |
+
START_TIME=$(date +%s)
|
23 |
+
|
24 |
+
while true; do
|
25 |
+
CURRENT_TIME=$(date +%s)
|
26 |
+
ELAPSED=$((CURRENT_TIME - START_TIME))
|
27 |
+
|
28 |
+
if [ $ELAPSED -gt $TIMEOUT ]; then
|
29 |
+
print_error "Timeout waiting for databases to be ready. Please check database status manually and try again"
|
30 |
+
exit 1
|
31 |
+
fi
|
32 |
+
|
33 |
+
# Build wait conditions for enabled databases
|
34 |
+
WAIT_CONDITIONS=()
|
35 |
+
[ "$ENABLE_POSTGRESQL" = true ] && WAIT_CONDITIONS+=("kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=pg-cluster -n $NAMESPACE --timeout=10s")
|
36 |
+
[ "$ENABLE_REDIS" = true ] && WAIT_CONDITIONS+=("kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=redis-cluster -n $NAMESPACE --timeout=10s")
|
37 |
+
[ "$ENABLE_ELASTICSEARCH" = true ] && WAIT_CONDITIONS+=("kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=es-cluster -n $NAMESPACE --timeout=10s")
|
38 |
+
[ "$ENABLE_QDRANT" = true ] && WAIT_CONDITIONS+=("kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=qdrant-cluster -n $NAMESPACE --timeout=10s")
|
39 |
+
[ "$ENABLE_MONGODB" = true ] && WAIT_CONDITIONS+=("kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=mongodb-cluster -n $NAMESPACE --timeout=10s")
|
40 |
+
[ "$ENABLE_NEO4J" = true ] && WAIT_CONDITIONS+=("kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=neo4j-cluster -n $NAMESPACE --timeout=10s")
|
41 |
+
|
42 |
+
# Check if all enabled databases are ready
|
43 |
+
ALL_READY=true
|
44 |
+
for CONDITION in "${WAIT_CONDITIONS[@]}"; do
|
45 |
+
if ! eval "$CONDITION &> /dev/null"; then
|
46 |
+
ALL_READY=false
|
47 |
+
break
|
48 |
+
fi
|
49 |
+
done
|
50 |
+
|
51 |
+
if [ "$ALL_READY" = true ]; then
|
52 |
+
print "All database pods are ready, continuing with deployment..."
|
53 |
+
break
|
54 |
+
fi
|
55 |
+
|
56 |
+
print "Waiting for database pods to be ready (${ELAPSED}s elapsed)..."
|
57 |
+
sleep 10
|
58 |
+
done
|
59 |
|
60 |
print_success "Database clusters installation completed!"
|
61 |
print "Use the following command to check the status of installed clusters:"
|
k8s-deploy/databases/03-uninstall-database.sh
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
|
6 |
# Load configuration file
|
7 |
-
source "$
|
8 |
|
9 |
print "Uninstalling database clusters..."
|
10 |
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
5 |
|
6 |
# Load configuration file
|
7 |
+
source "$DATABASE_SCRIPT_DIR/00-config.sh"
|
8 |
|
9 |
print "Uninstalling database clusters..."
|
10 |
|
k8s-deploy/databases/04-cleanup.sh
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
|
6 |
# Load configuration file
|
7 |
-
source "$
|
8 |
|
9 |
print "Uninstalling KubeBlocks database addons..."
|
10 |
|
@@ -18,7 +18,7 @@ print "Uninstalling KubeBlocks database addons..."
|
|
18 |
|
19 |
print_success "Database addons uninstallation completed!"
|
20 |
|
21 |
-
source "$
|
22 |
|
23 |
kubectl delete namespace $NAMESPACE
|
24 |
kubectl delete namespace kb-system
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
5 |
|
6 |
# Load configuration file
|
7 |
+
source "$DATABASE_SCRIPT_DIR/00-config.sh"
|
8 |
|
9 |
print "Uninstalling KubeBlocks database addons..."
|
10 |
|
|
|
18 |
|
19 |
print_success "Database addons uninstallation completed!"
|
20 |
|
21 |
+
source "$DATABASE_SCRIPT_DIR/uninstall-kubeblocks.sh"
|
22 |
|
23 |
kubectl delete namespace $NAMESPACE
|
24 |
kubectl delete namespace kb-system
|
k8s-deploy/databases/install-kubeblocks.sh
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
# Load configuration file
|
6 |
-
source "$
|
7 |
|
8 |
# Check dependencies
|
9 |
check_dependencies
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
5 |
# Load configuration file
|
6 |
+
source "$DATABASE_SCRIPT_DIR/00-config.sh"
|
7 |
|
8 |
# Check dependencies
|
9 |
check_dependencies
|
k8s-deploy/databases/uninstall-kubeblocks.sh
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
-
|
5 |
# Load configuration file
|
6 |
-
source "$
|
7 |
|
8 |
# Check dependencies
|
9 |
print "Checking dependencies..."
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Get the directory where this script is located
|
4 |
+
DATABASE_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
5 |
# Load configuration file
|
6 |
+
source "$DATABASE_SCRIPT_DIR/00-config.sh"
|
7 |
|
8 |
# Check dependencies
|
9 |
print "Checking dependencies..."
|
k8s-deploy/install_lightrag.sh
CHANGED
@@ -2,27 +2,8 @@
|
|
2 |
|
3 |
NAMESPACE=rag
|
4 |
|
5 |
-
# Get the directory where this script is located
|
6 |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
7 |
|
8 |
-
check_dependencies(){
|
9 |
-
echo "Checking dependencies..."
|
10 |
-
command -v kubectl >/dev/null 2>&1 || { echo "Error: kubectl command not found"; exit 1; }
|
11 |
-
command -v helm >/dev/null 2>&1 || { echo "Error: helm command not found"; exit 1; }
|
12 |
-
|
13 |
-
# Check if Kubernetes is available
|
14 |
-
echo "Checking if Kubernetes is available..."
|
15 |
-
kubectl cluster-info &>/dev/null
|
16 |
-
if [ $? -ne 0 ]; then
|
17 |
-
echo "Error: Kubernetes cluster is not accessible. Please ensure you have proper access to a Kubernetes cluster."
|
18 |
-
exit 1
|
19 |
-
fi
|
20 |
-
echo "Kubernetes cluster is accessible."
|
21 |
-
}
|
22 |
-
|
23 |
-
check_dependencies
|
24 |
-
|
25 |
-
# Check and set environment variables
|
26 |
if [ -z "$OPENAI_API_KEY" ]; then
|
27 |
echo "OPENAI_API_KEY environment variable is not set"
|
28 |
read -p "Enter your OpenAI API key: " OPENAI_API_KEY
|
@@ -39,59 +20,24 @@ if [ -z "$OPENAI_API_BASE" ]; then
|
|
39 |
export OPENAI_API_BASE=$OPENAI_API_BASE
|
40 |
fi
|
41 |
|
42 |
-
#
|
43 |
-
echo "
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
while true; do
|
61 |
-
CURRENT_TIME=$(date +%s)
|
62 |
-
ELAPSED=$((CURRENT_TIME - START_TIME))
|
63 |
-
|
64 |
-
if [ $ELAPSED -gt $TIMEOUT ]; then
|
65 |
-
echo "Timeout waiting for databases to be ready. Please check database status manually and try again"
|
66 |
-
exit 1
|
67 |
-
fi
|
68 |
-
|
69 |
-
# Use kubectl wait to check if both databases are ready
|
70 |
-
if kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=pg-cluster -n rag --timeout=10s &> /dev/null &&
|
71 |
-
kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=neo4j-cluster -n rag --timeout=10s &> /dev/null; then
|
72 |
-
echo "Database pods are ready, continuing with LightRAG deployment..."
|
73 |
-
break
|
74 |
fi
|
75 |
-
|
76 |
-
echo "Waiting for database pods to be ready..."
|
77 |
-
sleep 10
|
78 |
-
done
|
79 |
-
else
|
80 |
-
echo "Databases already installed, checking if database pods are ready..."
|
81 |
-
|
82 |
-
# Verify that pods are ready before proceeding
|
83 |
-
echo "Waiting for database pods to be ready..."
|
84 |
-
if ! kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=pg-cluster -n rag --timeout=60s; then
|
85 |
-
echo "PostgreSQL pods are not ready. Please check database status manually."
|
86 |
-
exit 1
|
87 |
-
fi
|
88 |
-
|
89 |
-
if ! kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=neo4j-cluster -n rag --timeout=60s; then
|
90 |
-
echo "Neo4j pods are not ready. Please check database status manually."
|
91 |
-
exit 1
|
92 |
-
fi
|
93 |
-
|
94 |
-
echo "Database pods are ready, proceeding with LightRAG deployment..."
|
95 |
fi
|
96 |
|
97 |
# Get database passwords from Kubernetes secrets
|
@@ -110,6 +56,13 @@ if [ -z "$NEO4J_PASSWORD" ]; then
|
|
110 |
fi
|
111 |
export NEO4J_PASSWORD=$NEO4J_PASSWORD
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
echo "Deploying production LightRAG (using external databases)..."
|
114 |
|
115 |
if ! kubectl get namespace rag &> /dev/null; then
|
@@ -129,7 +82,11 @@ helm upgrade --install lightrag $SCRIPT_DIR/lightrag \
|
|
129 |
--set-string env.EMBEDDING_MODEL=text-embedding-ada-002 \
|
130 |
--set-string env.EMBEDDING_DIM=1536 \
|
131 |
--set-string env.EMBEDDING_BINDING_API_KEY=$OPENAI_API_KEY
|
|
|
132 |
|
133 |
# Wait for LightRAG pod to be ready
|
134 |
echo "Waiting for LightRAG pod to be ready..."
|
135 |
kubectl wait --for=condition=ready pod -l app.kubernetes.io/instance=lightrag --timeout=60s -n rag
|
|
|
|
|
|
|
|
2 |
|
3 |
NAMESPACE=rag
|
4 |
|
|
|
5 |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
if [ -z "$OPENAI_API_KEY" ]; then
|
8 |
echo "OPENAI_API_KEY environment variable is not set"
|
9 |
read -p "Enter your OpenAI API key: " OPENAI_API_KEY
|
|
|
20 |
export OPENAI_API_BASE=$OPENAI_API_BASE
|
21 |
fi
|
22 |
|
23 |
+
# Install KubeBlocks (if not already installed)
|
24 |
+
echo "Preparing to install KubeBlocks and required components..."
|
25 |
+
bash "$SCRIPT_DIR/databases/01-prepare.sh"
|
26 |
+
|
27 |
+
# Install database clusters
|
28 |
+
echo "Installing database clusters..."
|
29 |
+
bash "$SCRIPT_DIR/databases/02-install-database.sh"
|
30 |
+
|
31 |
+
# Create vector extension in PostgreSQL if enabled
|
32 |
+
if [ "$ENABLE_POSTGRESQL" = true ]; then
|
33 |
+
print "Waiting for PostgreSQL pods to be ready..."
|
34 |
+
if kubectl wait --for=condition=ready pods -l app.kubernetes.io/instance=pg-cluster -n $NAMESPACE --timeout=300s; then
|
35 |
+
print "Creating vector extension in PostgreSQL..."
|
36 |
+
kubectl exec -it $(kubectl get pods -l kubeblocks.io/role=primary,app.kubernetes.io/instance=pg-cluster -n $NAMESPACE -o name) -n $NAMESPACE -- psql -c "CREATE EXTENSION vector;"
|
37 |
+
print_success "Vector extension created successfully."
|
38 |
+
else
|
39 |
+
print "Warning: PostgreSQL pods not ready within timeout. Vector extension not created."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
fi
|
42 |
|
43 |
# Get database passwords from Kubernetes secrets
|
|
|
56 |
fi
|
57 |
export NEO4J_PASSWORD=$NEO4J_PASSWORD
|
58 |
|
59 |
+
#REDIS_PASSWORD=$(kubectl get secrets -n rag redis-cluster-redis-account-default -o jsonpath='{.data.password}' | base64 -d)
|
60 |
+
#if [ -z "$REDIS_PASSWORD" ]; then
|
61 |
+
# echo "Error: Could not retrieve Redis password. Make sure Redis is deployed and the secret exists."
|
62 |
+
# exit 1
|
63 |
+
#fi
|
64 |
+
#export REDIS_PASSWORD=$REDIS_PASSWORD
|
65 |
+
|
66 |
echo "Deploying production LightRAG (using external databases)..."
|
67 |
|
68 |
if ! kubectl get namespace rag &> /dev/null; then
|
|
|
82 |
--set-string env.EMBEDDING_MODEL=text-embedding-ada-002 \
|
83 |
--set-string env.EMBEDDING_DIM=1536 \
|
84 |
--set-string env.EMBEDDING_BINDING_API_KEY=$OPENAI_API_KEY
|
85 |
+
# --set-string env.REDIS_URI="redis://default:${REDIS_PASSWORD}@redis-cluster-redis-redis:6379"
|
86 |
|
87 |
# Wait for LightRAG pod to be ready
|
88 |
echo "Waiting for LightRAG pod to be ready..."
|
89 |
kubectl wait --for=condition=ready pod -l app.kubernetes.io/instance=lightrag --timeout=60s -n rag
|
90 |
+
|
91 |
+
#echo "Current LightRAG Config: "
|
92 |
+
#kubectl get secrets lightrag-env -o jsonpath='{.data.\.env}' -n rag | base64 -d
|
k8s-deploy/install_lightrag_dev.sh
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
|
3 |
NAMESPACE=rag
|
4 |
|
5 |
-
# Get the directory where this script is located
|
6 |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
7 |
|
8 |
check_dependencies(){
|
|
|
2 |
|
3 |
NAMESPACE=rag
|
4 |
|
|
|
5 |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
6 |
|
7 |
check_dependencies(){
|
k8s-deploy/lightrag/templates/deployment.yaml
CHANGED
@@ -24,6 +24,15 @@ spec:
|
|
24 |
- name: http
|
25 |
containerPort: {{ .Values.env.PORT }}
|
26 |
protocol: TCP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
resources:
|
28 |
{{- toYaml .Values.resources | nindent 12 }}
|
29 |
volumeMounts:
|
|
|
24 |
- name: http
|
25 |
containerPort: {{ .Values.env.PORT }}
|
26 |
protocol: TCP
|
27 |
+
readinessProbe:
|
28 |
+
httpGet:
|
29 |
+
path: /health
|
30 |
+
port: http
|
31 |
+
initialDelaySeconds: 10
|
32 |
+
periodSeconds: 5
|
33 |
+
timeoutSeconds: 2
|
34 |
+
successThreshold: 1
|
35 |
+
failureThreshold: 3
|
36 |
resources:
|
37 |
{{- toYaml .Values.resources | nindent 12 }}
|
38 |
volumeMounts:
|
k8s-deploy/lightrag/values.yaml
CHANGED
@@ -38,6 +38,8 @@ env:
|
|
38 |
EMBEDDING_BINDING_API_KEY:
|
39 |
LIGHTRAG_KV_STORAGE: PGKVStorage
|
40 |
LIGHTRAG_VECTOR_STORAGE: PGVectorStorage
|
|
|
|
|
41 |
LIGHTRAG_GRAPH_STORAGE: Neo4JStorage
|
42 |
LIGHTRAG_DOC_STATUS_STORAGE: PGDocStatusStorage
|
43 |
# Replace with your POSTGRES credentials
|
@@ -51,3 +53,6 @@ env:
|
|
51 |
NEO4J_URI: neo4j://neo4j-cluster-neo4j:7687
|
52 |
NEO4J_USERNAME: neo4j
|
53 |
NEO4J_PASSWORD:
|
|
|
|
|
|
|
|
38 |
EMBEDDING_BINDING_API_KEY:
|
39 |
LIGHTRAG_KV_STORAGE: PGKVStorage
|
40 |
LIGHTRAG_VECTOR_STORAGE: PGVectorStorage
|
41 |
+
# LIGHTRAG_KV_STORAGE: RedisKVStorage
|
42 |
+
# LIGHTRAG_VECTOR_STORAGE: QdrantVectorDBStorage
|
43 |
LIGHTRAG_GRAPH_STORAGE: Neo4JStorage
|
44 |
LIGHTRAG_DOC_STATUS_STORAGE: PGDocStatusStorage
|
45 |
# Replace with your POSTGRES credentials
|
|
|
53 |
NEO4J_URI: neo4j://neo4j-cluster-neo4j:7687
|
54 |
NEO4J_USERNAME: neo4j
|
55 |
NEO4J_PASSWORD:
|
56 |
+
# Replace with your Qdrant credentials
|
57 |
+
QDRANT_URL: http://qdrant-cluster-qdrant-qdrant:6333
|
58 |
+
# REDIS_URI: redis://default:${REDIS_PASSWORD}@redis-cluster-redis-redis:6379
|