Files
warehouse13/helm/warehouse13
Mondo Diaz 4641cbb3fa Update Helm chart to use unified app image (API + Frontend)
Changes:
- Replaced separate api and frontend deployments with single unified app deployment
- Updated values.yaml: Changed from api/frontend configs to single app config
- Renamed templates: api-deployment.yaml → app-deployment.yaml
- Removed frontend-deployment.yaml and frontend-service.yaml (no longer needed)
- Updated app image to warehouse13/app (multi-stage Docker build)
- Combined resource allocations: 384Mi memory, 350m CPU (up from separate totals)
- Updated all example values files (dev, production, air-gapped)
- Updated NOTES.txt to reflect single service on port 8000
- Updated ingress to route all traffic to single app service
- Added ARCHITECTURE.md documenting the unified container approach

Architecture:
The application now uses a multi-stage Docker build:
1. Stage 1: Builds Angular frontend with Node
2. Stage 2: Python FastAPI backend that serves static frontend from /static

Benefits:
- Simplified deployment (1 container instead of 2)
- Reduced resource usage (no separate nginx)
- Easier scaling (1 deployment to manage)
- Consistent versioning (frontend/backend always match)

Access pattern:
- http://localhost:8000     → Angular frontend
- http://localhost:8000/api → FastAPI REST API
- http://localhost:8000/docs → API documentation
- http://localhost:8000/health → Health check

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 17:11:39 -05:00
..

Warehouse13 Helm Chart

Enterprise Test Artifact Storage - Kubernetes deployment via Helm

Overview

This Helm chart deploys the complete Warehouse13 stack on Kubernetes:

  • PostgreSQL 15 - Metadata database
  • MinIO - S3-compatible object storage
  • FastAPI Backend - REST API server
  • Angular Frontend - Web UI (nginx-served)

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.0+
  • PV provisioner support (for persistent storage)

Installation

Quick Start

# Add the Warehouse13 chart repository (if published)
helm repo add warehouse13 https://charts.warehouse13.example.com
helm repo update

# Install with default values
helm install my-warehouse13 warehouse13/warehouse13

# Or install from local chart
helm install my-warehouse13 ./helm/warehouse13

Custom Installation

# Install with custom values
helm install my-warehouse13 ./helm/warehouse13 \
  --set postgres.persistence.size=20Gi \
  --set minio.persistence.size=100Gi \
  --set api.replicas=3

# Install in a specific namespace
helm install my-warehouse13 ./helm/warehouse13 \
  --namespace warehouse13 \
  --create-namespace

Configuration

Configurable Images

All component images can be customized via values.yaml or command-line flags:

postgres:
  image:
    repository: postgres
    tag: 15-alpine
    pullPolicy: IfNotPresent

minio:
  image:
    repository: minio/minio
    tag: latest
    pullPolicy: IfNotPresent

api:
  image:
    repository: warehouse13/api
    tag: latest
    pullPolicy: IfNotPresent

frontend:
  image:
    repository: warehouse13/frontend
    tag: latest
    pullPolicy: IfNotPresent

Example: Using custom image registry

helm install my-warehouse13 ./helm/warehouse13 \
  --set postgres.image.repository=myregistry.example.com/postgres \
  --set minio.image.repository=myregistry.example.com/minio \
  --set api.image.repository=myregistry.example.com/warehouse13-api \
  --set frontend.image.repository=myregistry.example.com/warehouse13-frontend

Example: Air-gapped deployment with specific tags

helm install my-warehouse13 ./helm/warehouse13 \
  --set postgres.image.repository=harbor.internal/library/postgres \
  --set postgres.image.tag=15-alpine \
  --set minio.image.repository=harbor.internal/library/minio \
  --set minio.image.tag=RELEASE.2024-01-01T00-00-00Z \
  --set api.image.repository=harbor.internal/warehouse13/api \
  --set api.image.tag=v1.0.0 \
  --set frontend.image.repository=harbor.internal/warehouse13/frontend \
  --set frontend.image.tag=v1.0.0

Key Parameters

Parameter Description Default
global.deploymentMode Deployment mode (standard/airgapped) standard
global.storageBackend Storage backend (minio/s3) minio
postgres.persistence.enabled Enable PostgreSQL persistence true
postgres.persistence.size PostgreSQL PVC size 10Gi
postgres.auth.username PostgreSQL username user
postgres.auth.password PostgreSQL password password
minio.persistence.enabled Enable MinIO persistence true
minio.persistence.size MinIO PVC size 50Gi
minio.auth.rootUser MinIO root username minioadmin
minio.auth.rootPassword MinIO root password minioadmin
api.replicas Number of API replicas 2
frontend.replicas Number of frontend replicas 2
ingress.enabled Enable ingress false
ingress.className Ingress class name nginx
ingress.hosts Ingress hosts configuration See values.yaml

Example Configurations

Production with Ingress

# values-production.yaml
global:
  deploymentMode: "standard"
  storageBackend: "minio"

postgres:
  persistence:
    size: 50Gi
    storageClass: "fast-ssd"
  resources:
    requests:
      memory: "1Gi"
      cpu: "500m"
    limits:
      memory: "2Gi"
      cpu: "1000m"

minio:
  persistence:
    size: 500Gi
    storageClass: "bulk-storage"
  resources:
    requests:
      memory: "2Gi"
      cpu: "1000m"
    limits:
      memory: "4Gi"
      cpu: "2000m"

api:
  replicas: 3
  resources:
    requests:
      memory: "512Mi"
      cpu: "500m"
    limits:
      memory: "1Gi"
      cpu: "1000m"

frontend:
  replicas: 3

ingress:
  enabled: true
  className: "nginx"
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
  hosts:
    - host: warehouse13.example.com
      paths:
        - path: /
          pathType: Prefix
          backend: frontend
        - path: /api
          pathType: Prefix
          backend: api
  tls:
    - secretName: warehouse13-tls
      hosts:
        - warehouse13.example.com
helm install my-warehouse13 ./helm/warehouse13 -f values-production.yaml

Air-Gapped Environment

# values-airgapped.yaml
global:
  deploymentMode: "airgapped"
  storageBackend: "minio"

postgres:
  image:
    repository: harbor.internal.example.com/library/postgres
    tag: 15-alpine
    pullPolicy: IfNotPresent

minio:
  image:
    repository: harbor.internal.example.com/library/minio
    tag: RELEASE.2024-01-01T00-00-00Z
    pullPolicy: IfNotPresent

api:
  image:
    repository: harbor.internal.example.com/warehouse13/api
    tag: v1.0.0
    pullPolicy: IfNotPresent

frontend:
  image:
    repository: harbor.internal.example.com/warehouse13/frontend
    tag: v1.0.0
    pullPolicy: IfNotPresent
helm install my-warehouse13 ./helm/warehouse13 -f values-airgapped.yaml

Development/Testing

# values-dev.yaml
global:
  deploymentMode: "standard"

postgres:
  persistence:
    enabled: false  # Use emptyDir for quick testing
  resources:
    requests:
      memory: "128Mi"
      cpu: "100m"

minio:
  persistence:
    enabled: false
  resources:
    requests:
      memory: "256Mi"
      cpu: "100m"

api:
  replicas: 1
  image:
    tag: dev

frontend:
  replicas: 1
  image:
    tag: dev
helm install my-warehouse13 ./helm/warehouse13 -f values-dev.yaml

Accessing the Application

Port Forwarding (Development)

# Access frontend
kubectl port-forward svc/warehouse13-frontend 4200:80

# Access API
kubectl port-forward svc/warehouse13-api 8000:8000

# Access MinIO console
kubectl port-forward svc/warehouse13-minio 9001:9001

# Then visit:
# - Frontend: http://localhost:4200
# - API: http://localhost:8000
# - MinIO Console: http://localhost:9001

Via Ingress (Production)

If ingress is enabled:

https://warehouse13.example.com

Upgrading

# Upgrade with new values
helm upgrade my-warehouse13 ./helm/warehouse13 \
  --set api.image.tag=v2.0.0 \
  --set frontend.image.tag=v2.0.0

# Upgrade with values file
helm upgrade my-warehouse13 ./helm/warehouse13 -f values-production.yaml

# Upgrade and wait for completion
helm upgrade my-warehouse13 ./helm/warehouse13 --wait --timeout 10m

Uninstalling

# Uninstall the release
helm uninstall my-warehouse13

# Note: PVCs are not deleted automatically. To delete them:
kubectl delete pvc -l app.kubernetes.io/instance=my-warehouse13

Backup and Restore

PostgreSQL Backup

# Create backup
kubectl exec -it warehouse13-postgres-0 -- pg_dump -U user datalake > backup.sql

# Restore
kubectl exec -i warehouse13-postgres-0 -- psql -U user datalake < backup.sql

MinIO Backup

# Install mc (MinIO Client)
# Configure mc alias
mc alias set w13 http://localhost:9001 minioadmin minioadmin

# Mirror bucket
mc mirror w13/artifacts ./backup/artifacts

# Restore
mc mirror ./backup/artifacts w13/artifacts

Troubleshooting

Check Pod Status

kubectl get pods -l app.kubernetes.io/name=warehouse13

View Logs

# API logs
kubectl logs -l app.kubernetes.io/component=api -f

# Frontend logs
kubectl logs -l app.kubernetes.io/component=frontend -f

# PostgreSQL logs
kubectl logs warehouse13-postgres-0 -f

# MinIO logs
kubectl logs warehouse13-minio-0 -f

Check Services

kubectl get svc -l app.kubernetes.io/name=warehouse13

Common Issues

Pods stuck in Pending

  • Check PVC status: kubectl get pvc
  • Verify storage class exists: kubectl get storageclass
  • Check node resources: kubectl describe nodes

Database connection errors

  • Verify postgres pod is running: kubectl get pod warehouse13-postgres-0
  • Check database logs: kubectl logs warehouse13-postgres-0
  • Verify secret exists: kubectl get secret warehouse13-secrets

Frontend cannot reach API

  • Check ingress configuration: kubectl describe ingress warehouse13-ingress
  • Verify API service: kubectl get svc warehouse13-api
  • Check API pod health: kubectl get pods -l app.kubernetes.io/component=api

Security Considerations

Secrets Management

Default credentials are for development only! In production:

  1. Use external secrets management:

    # Use sealed-secrets, external-secrets, or similar
    postgres:
      auth:
        username: "{{ .Values.externalSecrets.postgresUser }}"
        password: "{{ .Values.externalSecrets.postgresPassword }}"
    
  2. Or create secrets manually:

    kubectl create secret generic warehouse13-secrets \
      --from-literal=postgres-username=secure-user \
      --from-literal=postgres-password=secure-password \
      --from-literal=minio-root-user=secure-minio-user \
      --from-literal=minio-root-password=secure-minio-password
    
    # Then install without default secrets
    helm install my-warehouse13 ./helm/warehouse13 --set createSecrets=false
    
  3. Enable TLS:

    ingress:
      enabled: true
      annotations:
        cert-manager.io/cluster-issuer: "letsencrypt-prod"
      tls:
        - secretName: warehouse13-tls
          hosts:
            - warehouse13.example.com
    

Support

For issues and questions: