From 1bcb1c4ad753c4a1e1ff3a7e14461688eef4d569 Mon Sep 17 00:00:00 2001 From: earayu Date: Mon, 19 May 2025 18:17:02 +0800 Subject: [PATCH] feat: add helm chart --- k8s-deploy/install_lightrag.sh | 17 +++++++++++++++++ k8s-deploy/install_lightrag_dev.sh | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/k8s-deploy/install_lightrag.sh b/k8s-deploy/install_lightrag.sh index 2411356b..a326ff76 100755 --- a/k8s-deploy/install_lightrag.sh +++ b/k8s-deploy/install_lightrag.sh @@ -5,6 +5,23 @@ NAMESPACE=rag # Get the directory where this script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +check_dependencies(){ + echo "Checking dependencies..." + command -v kubectl >/dev/null 2>&1 || { echo "Error: kubectl command not found"; exit 1; } + command -v helm >/dev/null 2>&1 || { echo "Error: helm command not found"; exit 1; } + + # Check if Kubernetes is available + echo "Checking if Kubernetes is available..." + kubectl cluster-info &>/dev/null + if [ $? -ne 0 ]; then + echo "Error: Kubernetes cluster is not accessible. Please ensure you have proper access to a Kubernetes cluster." + exit 1 + fi + echo "Kubernetes cluster is accessible." +} + +check_dependencies + # Check and set environment variables if [ -z "$OPENAI_API_KEY" ]; then echo "OPENAI_API_KEY environment variable is not set" diff --git a/k8s-deploy/install_lightrag_dev.sh b/k8s-deploy/install_lightrag_dev.sh index 5e82b393..ba28d7ed 100755 --- a/k8s-deploy/install_lightrag_dev.sh +++ b/k8s-deploy/install_lightrag_dev.sh @@ -5,6 +5,23 @@ NAMESPACE=rag # Get the directory where this script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +check_dependencies(){ + echo "Checking dependencies..." + command -v kubectl >/dev/null 2>&1 || { echo "Error: kubectl command not found"; exit 1; } + command -v helm >/dev/null 2>&1 || { echo "Error: helm command not found"; exit 1; } + + # Check if Kubernetes is available + echo "Checking if Kubernetes is available..." + kubectl cluster-info &>/dev/null + if [ $? -ne 0 ]; then + echo "Error: Kubernetes cluster is not accessible. Please ensure you have proper access to a Kubernetes cluster." + exit 1 + fi + echo "Kubernetes cluster is accessible." +} + +check_dependencies + if [ -z "$OPENAI_API_KEY" ]; then echo "OPENAI_API_KEY environment variable is not set" read -p "Enter your OpenAI API key: " OPENAI_API_KEY