#!/bin/bash # Bifrost Values File Generator # This interactive script helps you generate a custom values.yaml file set -e # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' print_info() { echo -e "${BLUE}ℹ ${NC}$1"; } print_success() { echo -e "${GREEN}✓ ${NC}$1"; } print_warning() { echo -e "${YELLOW}⚠ ${NC}$1"; } print_error() { echo -e "${RED}✗ ${NC}$1"; } print_banner() { echo "" echo -e "${BLUE}╔═══════════════════════════════════════════╗${NC}" echo -e "${BLUE}║ ║${NC}" echo -e "${BLUE}║ Bifrost Values Generator ║${NC}" echo -e "${BLUE}║ ║${NC}" echo -e "${BLUE}╚═══════════════════════════════════════════╝${NC}" echo "" } print_banner OUTPUT_FILE="my-values.yaml" # Storage configuration - per-store backend selection echo "1. Select backend for Config Store:" echo " 1) SQLite (simple, single node)" echo " 2) PostgreSQL (production, scalable)" read -p "Choice [1-2]: " config_store_choice case $config_store_choice in 1) CONFIG_STORE_TYPE="sqlite" ;; 2) CONFIG_STORE_TYPE="postgres" ;; *) print_error "Invalid choice"; exit 1 ;; esac echo "" echo "2. Select backend for Logs Store:" echo " 1) SQLite (simple, single node)" echo " 2) PostgreSQL (production, scalable)" read -p "Choice [1-2]: " logs_store_choice case $logs_store_choice in 1) LOGS_STORE_TYPE="sqlite" ;; 2) LOGS_STORE_TYPE="postgres" ;; *) print_error "Invalid choice"; exit 1 ;; esac # Determine if PostgreSQL is needed (for either store) if [[ "$CONFIG_STORE_TYPE" == "postgres" ]] || [[ "$LOGS_STORE_TYPE" == "postgres" ]]; then NEEDS_POSTGRES="true" else NEEDS_POSTGRES="false" fi # Determine if SQLite persistence is needed (for either store) if [[ "$CONFIG_STORE_TYPE" == "sqlite" ]] || [[ "$LOGS_STORE_TYPE" == "sqlite" ]]; then NEEDS_SQLITE_PERSISTENCE="true" else NEEDS_SQLITE_PERSISTENCE="false" fi # Vector store echo "" echo "3. Do you need vector store for semantic caching?" read -p "Enable vector store? (y/n): " vector_choice if [[ "$vector_choice" =~ ^[Yy]$ ]]; then echo " 1) Weaviate" echo " 2) Redis" echo " 3) Qdrant" read -p "Choice [1-3]: " vector_type_choice case $vector_type_choice in 1) VECTOR_TYPE="weaviate" ;; 2) VECTOR_TYPE="redis" ;; 3) VECTOR_TYPE="qdrant" ;; *) print_error "Invalid choice"; exit 1 ;; esac VECTOR_ENABLED="true" else VECTOR_ENABLED="false" VECTOR_TYPE="none" fi # Deployment type echo "" echo "4. Deployment type:" echo " 1) Development (1 replica, minimal resources)" echo " 2) Production (3+ replicas, auto-scaling)" read -p "Choice [1-2]: " deploy_choice case $deploy_choice in 1) REPLICAS="1" AUTOSCALING="false" CPU_REQUEST="250m" MEM_REQUEST="256Mi" CPU_LIMIT="1000m" MEM_LIMIT="1Gi" ;; 2) REPLICAS="3" AUTOSCALING="true" CPU_REQUEST="1000m" MEM_REQUEST="1Gi" CPU_LIMIT="4000m" MEM_LIMIT="4Gi" ;; *) print_error "Invalid choice"; exit 1 ;; esac # Ingress echo "" read -p "5. Do you want to enable Ingress? (y/n): " ingress_choice if [[ "$ingress_choice" =~ ^[Yy]$ ]]; then INGRESS_ENABLED="true" read -p " Enter your domain (e.g., bifrost.yourdomain.com): " DOMAIN else INGRESS_ENABLED="false" DOMAIN="bifrost.local" fi # Encryption key echo "" read -p "6. Enter encryption key (leave empty to skip): " ENCRYPTION_KEY # Check if output file already exists if [[ -f "$OUTPUT_FILE" ]]; then echo "" print_warning "File '$OUTPUT_FILE' already exists." read -p "Do you want to overwrite it? (y/n): " overwrite_choice if [[ ! "$overwrite_choice" =~ ^[Yy]$ ]]; then print_info "Generation aborted. No files were modified." exit 0 fi fi # Generate the file print_info "Generating values file..." cat > "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <> "$OUTPUT_FILE" <