Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/connor/tmp host #28

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Feat/connor/tmp host #28

wants to merge 13 commits into from

Conversation

cdirks4
Copy link
Member

@cdirks4 cdirks4 commented Feb 11, 2025

Kubernetes Infrastructure and Deployment Scripts

Overview

This PR implements a complete Kubernetes infrastructure for OpenBookLM, including frontend, backend, database, and nginx ingress configuration, along with helpful deployment and debugging scripts.

Infrastructure Components

1. Core Application (deployment.yaml)

  • Frontend Container

    • Node.js 20 slim image
    • Environment variables for:
      • Clerk authentication
      • Database connection
      • Redis connection
      • Google API integration
      • Cerebras API integration
    • Resource limits: 1Gi-2Gi RAM, 500m-1000m CPU
  • Backend Container

    • Python 3.12 slim image
    • API integrations (Cerebras, Llama, OpenAI)
    • Resource limits: 8Gi-16Gi RAM, 500m-1000m CPU

2. Supporting Services

  • PostgreSQL (postgres.yaml)

    • Persistent storage
    • Internal service access
    • Database initialization
  • Redis (redis.yaml)

    • In-memory caching
    • Session management
    • Internal service access

3. Networking (ingress.yaml)

  • Nginx ingress controller
  • SSL/TLS configuration
  • Extended timeouts (600s)
  • File upload limits (100MB)
  • Path-based routing

4. Added NPM Scripts

{
  "scripts": {
    "logs:backend": "kubectl logs -f -n openbooklm -c backend $(kubectl get pods -n openbooklm -l app=openbooklm -o jsonpath='{.items[0].metadata.name}')",
    "logs:frontend": "kubectl logs -f -n openbooklm -c frontend $(kubectl get pods -n openbooklm -l app=openbooklm -o jsonpath='{.items[0].metadata.name}')",
    "k8s:restart": "kubectl rollout restart deployment openbooklm -n openbooklm",
    "k8s:error": "kubectl describe pod -n openbooklm $(kubectl get pods -n openbooklm | grep CreateContainerConfigError | awk '{print $1}')",
    "k8s:events": "kubectl get events -n openbooklm --sort-by='.lastTimestamp'",
    "k8s:logs:error": "kubectl logs -p -n openbooklm $(kubectl get pods -n openbooklm | grep CreateContainerConfigError | awk '{print $1}')",
    "k8s:containers": "./scripts/view-containers.sh"
  }
}

@cdirks4 cdirks4 marked this pull request as ready for review February 13, 2025 21:31
@cdirks4
Copy link
Member Author

cdirks4 commented Feb 13, 2025

ignore most of the backend in this it gets re written in the next pr morgan reviewed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant