• Shell 79.4%
  • Go Template 20.6%
Find a file
Bart Ramakers ca190c8a4f Merge branch 'renovate/editor-app-2.x' into 'main'
chore(deps): update helm release editor-app to v2.9.0

See merge request logius/nldoc/infra/nldoc!36
2025-10-02 11:13:29 +02:00
charts/db-secrets chore: removed zitadel 2025-08-13 09:24:57 +02:00
scripts chore: added filetracer 2025-09-04 17:54:48 +02:00
values Merge branch 'main' of gitlab.com:logius/nldoc/infra/nldoc 2025-09-17 09:35:46 +02:00
.editorconfig chore: set .editorconfig 2025-04-22 00:08:07 +00:00
.gitignore Revert "chore: added tfplan to gitignore" 2025-08-07 14:14:49 +02:00
CODEOWNERS chore: set CODEOWNERS 2025-04-22 00:24:30 +00:00
helmfile.yaml Merge branch 'renovate/editor-app-2.x' into 'main' 2025-10-02 11:13:29 +02:00
INGRESS.md chore: removed zitadel 2025-08-13 09:24:57 +02:00
INSTALL.md chore: added filetracer 2025-09-04 17:54:48 +02:00
LICENSE chore: add license 2025-04-15 00:18:48 +02:00
list-credentials.sh feat: added filetracer to default charts and apps 2025-09-09 09:43:09 +02:00
README.md chore: removed zitadel 2025-08-13 09:24:57 +02:00
renovate.json Add renovate.json 2025-04-03 20:30:42 +00:00
setup-nldoc.sh chore: added filetracer 2025-09-04 17:54:48 +02:00

NLdoc Application

A document conversion infrastructure, featuring authentication, API access, and a web-based editor.

Quick Start

Prerequisites

Setup

Run the automated setup script:

./setup-nldoc.sh

This script will:

  1. Verify prerequisites
  2. Create Kubernetes namespaces
  3. Set up certificate management
  4. Configure local DNS entries
  5. Deploy all services with Helmfile
  6. Configure authentication with Terraform

Setup Script Options

The setup script supports several command-line flags to customize the installation:

./setup-nldoc.sh [OPTIONS]

Available flags:

  • --verbose or -v - Show verbose output from helmfile operations
  • --reset - Delete all namespaces before setup (runs cleanup script)
  • --skip-ingress - Skip Traefik ingress controller setup
  • --skip-namespaces - Skip namespace creation
  • --skip-hosts - Skip /etc/hosts file configuration
  • --skip-cert - Skip certificate management setup
  • --skip-logging - Skip ELK stack (Elasticsearch, Kibana, Filebeat) deployment

Examples:

# Full setup with verbose output
./setup-nldoc.sh --verbose


# Skip certificate setup for development
./setup-nldoc.sh --skip-cert

For alternative setup methods and detailed manual instructions, see INSTALL.md.

Application Components

Infrastructure Services

  • PostgreSQL - Primary database
  • RabbitMQ - Message queue for async processing
  • MinIO - S3-compatible object storage

Application Services

  • Editor App - Web-based document editor (frontend)
  • API - REST API for document operations (backend)
  • Kimi - Document processing service

Access URLs

After setup, access the application at:

Useful Commands

Check Application Status

# View all pods
kubectl get pods -A

# Check specific services
kubectl get pods -n nld-app      # API and Editor
kubectl get pods -n nld-kimi     # Processing service

View Logs

# API logs
kubectl logs -n nld-app deployment/api -f

# Editor app logs
kubectl logs -n nld-app deployment/editor-app -f

# Processing service logs (with structured logging)
kubectl logs -n nld-kimi -l app.kubernetes.io/name=kimi -f --max-log-requests 100 | ecslog -l info

Credentials and Access

# List all ingress endpoints
kubectl get ingress -A

# Get service credentials
./list-credentials.sh

# Test API authentication
./test_auth.sh

Configuration

Local Development

  • Copy terraform/terraform.tfvars.local.example to terraform/terraform.tfvars.local
  • Modify organization settings as needed
  • Run ./setup-nldoc.sh to apply changes

Production

  • Configure terraform/terraform.tfvars for your environment
  • Set up proper TLS certificates
  • Configure external databases if needed

Troubleshooting

Common Issues

Services not accessible

# Check ingress configuration
kubectl get ingress -A
kubectl describe ingress -n nld-app api

# Check DNS resolution
nslookup api.nldoc.k8s

Certificate issues

# Check certificates
kubectl get certificates -A
kubectl describe certificate -n nld-app api-cert

Pod startup issues

# Check pod status
kubectl get pods -n nld-app
kubectl describe pod -n nld-app <pod-name>

Getting Help

  1. Check logs for the specific service having issues
  2. Verify all prerequisites are properly installed
  3. Ensure Kubernetes cluster is running and accessible
  4. Check that all required ports are available

Development

Architecture

The application follows a microservices pattern:

  • Frontend (Editor App) communicates with Backend (API)
  • API processes requests and queues jobs via RabbitMQ
  • Kimi service processes queued jobs
  • All services use PostgreSQL for persistence
  • MinIO stores file attachments and processed documents

Making Changes

  • Application code is deployed via Helm charts from GitLab registries
  • Infrastructure changes go through the helmfile.yaml
  • Authentication configuration is managed via Terraform

For more detailed development information, see the individual service repositories.

Helper Scripts

The scripts/ directory contains modular helper scripts used by the main setup process:

Core Setup Scripts

  • check-prerequisites.sh - Verifies all required tools are installed and detects Kubernetes environment
  • setup-namespaces.sh - Creates all required Kubernetes namespaces
  • setup-ingress-controller.sh - Installs and configures Traefik ingress controller
  • setup-cert-management.sh - Sets up cert-manager and mkcert for TLS certificates
  • setup-hosts-file.sh - Configures local /etc/hosts entries for service access
  • setup-logging.sh - Configures ELK stack (Elasticsearch, Kibana, Filebeat) with JSON log parsing

Utility Scripts

  • common.sh - Shared functions for colored output and waiting operations
  • delete-all-namespaces.sh - Safely removes all nld-* namespaces with confirmation
  • reset-terraform.sh - Resets Terraform state and configuration
  • setup-kibana-dataview.sh - Creates Kibana data views for log visualization

All scripts can be run independently, but the main setup-nldoc.sh orchestrates them in the correct order. Scripts respect the same flags passed to the main setup script (e.g., --verbose).