diff --git a/langfuse/justfile b/langfuse/justfile index 5014ec7..896a0c2 100644 --- a/langfuse/justfile +++ b/langfuse/justfile @@ -98,8 +98,8 @@ install: --version ${LANGFUSE_CHART_VERSION} -n ${LANGFUSE_NAMESPACE} --wait \ -f langfuse-values.yaml -# Uninstall Langfuse -uninstall: +# Uninstall Langfuse (delete-data: true to delete database and storage) +uninstall delete-data='false': #!/bin/bash set -euo pipefail helm uninstall langfuse -n ${LANGFUSE_NAMESPACE} --wait --ignore-not-found @@ -108,19 +108,29 @@ uninstall: # Clean up Keycloak client and Vault secrets to avoid stale credentials just delete-keycloak-client || true - echo "Langfuse uninstalled successfully" - echo "" - echo "Note: The following resources were NOT deleted:" - echo " - PostgreSQL user and database (langfuse)" - echo " - ClickHouse user and database (langfuse)" - echo " - MinIO user and bucket (langfuse)" - echo " - Keycloak user (langfuse)" - echo "" - echo "To delete these resources, run:" - echo " just langfuse::delete-postgres-user-and-db" - echo " just langfuse::delete-clickhouse-user" - echo " just langfuse::delete-minio-user" - echo " just langfuse::delete-keycloak-user" + if [ "{{ delete-data }}" = "true" ]; then + echo "Deleting database and storage..." + just delete-postgres-user-and-db || true + just delete-clickhouse-user || true + just delete-minio-user || true + just delete-keycloak-user || true + just delete-salt || true + just delete-nextauth-secret || true + just delete-redis-password || true + echo "Langfuse uninstalled with all data deleted." + else + echo "Langfuse uninstalled successfully" + echo "" + echo "Note: The following resources were NOT deleted:" + echo " - PostgreSQL user and database (langfuse)" + echo " - ClickHouse user and database (langfuse)" + echo " - MinIO user and bucket (langfuse)" + echo " - Keycloak user (langfuse)" + echo " - Vault secrets (langfuse/*)" + echo "" + echo "To delete all data, run:" + echo " just langfuse::uninstall true" + fi # Create all secrets (PostgreSQL, Keycloak, MinIO, Redis) create-secrets: diff --git a/langfuse/langfuse-values.gomplate.yaml b/langfuse/langfuse-values.gomplate.yaml index 0a089c5..4f20fda 100644 --- a/langfuse/langfuse-values.gomplate.yaml +++ b/langfuse/langfuse-values.gomplate.yaml @@ -69,13 +69,13 @@ langfuse: tls: enabled: true - # Resource configuration based on Goldilocks/VPA recommendations - # CPU limits increased to handle startup spikes + # Resource recommendations from Goldilocks VPA + # web target: cpu=15m, memory=717Mi web: resources: requests: - cpu: 15m - memory: 704Mi + cpu: 25m + memory: 768Mi limits: cpu: 100m memory: 1.5Gi @@ -89,10 +89,12 @@ langfuse: timeoutSeconds: 30 failureThreshold: 5 + # Resource recommendations from Goldilocks VPA + # worker target: cpu=15m, memory=380Mi worker: resources: requests: - cpu: 15m + cpu: 25m memory: 512Mi limits: cpu: 100m @@ -113,6 +115,16 @@ redis: username: "default" existingSecret: redis-auth existingSecretPasswordKey: secret + # Resource recommendations from Goldilocks VPA + # valkey target: cpu=15m, memory=100Mi + master: + resources: + requests: + cpu: 25m + memory: 128Mi + limits: + cpu: 100m + memory: 256Mi clickhouse: deploy: false