Installation & Deployment Guide

Overview

This guide provides comprehensive instructions for deploying the Kredete platform in various environments, from local development to production clusters.


Prerequisites

Development Environment

Requirement Minimum Version Recommended
Docker 20.10+ 24.0+
Docker Compose 2.0+ 2.20+
Kubernetes (kubectl) 1.25+ 1.28+
Helm 3.10+ 3.14+
Go 1.21+ 1.22+
Python 3.10+ 3.12+
Node.js 18 LTS 20 LTS

System Requirements (Development)

Resource Minimum Recommended
CPU 4 cores 8 cores
RAM 16 GB 32 GB
Storage 50 GB SSD 100 GB NVMe
OS macOS 12+ / Ubuntu 22.04+ macOS 14+ / Ubuntu 24.04

Quick Start (Docker Compose)

1. Clone Repositories

# Clone the main compose repository with all submodules
git clone --recurse-submodules -j8 git@gitlab.kredete.com:kredete/kredete-compose.git
cd kredete-compose

# If already cloned, update submodules
git submodule update --init --recursive

2. Environment Configuration

# Copy environment templates
./scripts/setup-env.sh

# This creates .env files for each service

3. Configure Environment Variables

# .env
ENVIRONMENT=development
LOG_LEVEL=debug
SECRET_KEY_BASE=your-secret-key-minimum-64-chars

# Database
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=kredete
POSTGRES_PASSWORD=kredete_dev_password
POSTGRES_DB=kredete_development

# Redis
REDIS_URL=redis://redis:6379/0

# Kafka
KAFKA_BROKERS=kafka:9092

# MongoDB
MONGODB_URI=mongodb://mongo:27017/kredete_dev

4. Build Services

# Build all Docker images
docker-compose build

# Build specific service
docker-compose build kredete-customer

5. Initialize Databases

# Start database containers
docker-compose up -d postgres redis mongo kafka

# Wait for databases to be ready
./scripts/wait-for-services.sh

# Run migrations for each service
docker-compose run --rm kredete-customer ./bin/migrate up
docker-compose run --rm kredete-loan ./bin/migrate up
docker-compose run --rm kredete-ledger ./bin/migrate up
docker-compose run --rm kredete-payment ./bin/migrate up

6. Start All Services

# Start all services in foreground
docker-compose up

# Start in detached mode
docker-compose up -d

# View logs
docker-compose logs -f

7. Verify Installation

# Check all services are running
docker-compose ps

# Health check
curl http://localhost:8000/health

# Expected response:
# {"status":"healthy","services":{"customer":"up","loan":"up","ledger":"up",...}}

Kubernetes Deployment

1. Add Helm Repository

# Add Kredete Helm repo
helm repo add kredete https://charts.kredete.com
helm repo update

# Verify charts are available
helm search repo kredete

2. Create Namespace

# Create production namespace
kubectl create namespace kredete-production

# Set context to production
kubectl config set-context --current --namespace=kredete-production

3. Configure Secrets

# Create secrets from template
kubectl create secret generic kredete-secrets \
  --from-literal=postgres-password='your-secure-password' \
  --from-literal=redis-password='your-redis-password' \
  --from-literal=jwt-secret='your-jwt-secret-key' \
  --namespace kredete-production

4. Install Kredete Stack

# Install the complete Kredete stack
helm install kredete kredete/kredete-stack \
  --namespace kredete-production \
  --values values-production.yaml \
  --wait \
  --timeout 10m

# Verify deployment
kubectl get pods -n kredete-production
kubectl get services -n kredete-production
kubectl get ingress -n kredete-production

Minimal Hosting Requirements

Development Environment

Component Specification
VM/Container 4 vCPU, 16GB RAM
Storage 100GB SSD
Network 100 Mbps

Production Environment (Minimum)

Component Specification Quantity
Application Nodes 8 vCPU, 16GB RAM 5
Scoring Nodes 16 vCPU, 32GB RAM 3
Database Primary 8 vCPU, 32GB RAM, 1TB SSD 1
Database Replicas 8 vCPU, 32GB RAM, 1TB SSD 2
Cache Cluster 4 vCPU, 16GB RAM 3
Kafka Cluster 4 vCPU, 16GB RAM, 500GB SSD 3
Load Balancer Managed (ALB/NLB) 2

Post-Installation Verification

Health Checks

# API Gateway health
curl https://api.kredete.com/health

# Individual service health
curl https://api.kredete.com/v2/customer/health
curl https://api.kredete.com/v2/loan/health
curl https://api.kredete.com/v2/scoring/health

Smoke Tests

# Run automated smoke tests
./scripts/smoke-tests.sh --environment production

# Expected output:
# ✓ API Gateway responding
# ✓ Authentication working
# ✓ Customer service operational
# ✓ Loan service operational
# ✓ Scoring service operational
# All smoke tests passed!

Tip

For production deployments, always run the full smoke test suite before switching traffic to the new deployment.