Enterprise Kubernetes Deployment Guide for Space Sign
Back to BlogDeveloper

Enterprise Kubernetes Deployment Guide for Space Sign

Advanced guide to deploying Space Sign on Kubernetes with high availability, auto-scaling, and zero-downtime updates. Includes Helm charts and production best practices.

Chen Wei

Platform Engineer

Nov 28, 202520 min read

Enterprise Kubernetes Deployment Guide for Space Sign

Running Space Sign on Kubernetes enables enterprise-grade scalability, high availability, and simplified operations. This comprehensive guide covers production deployment with Helm charts, auto-scaling, monitoring, and disaster recovery.

Why Kubernetes for Space Sign?

Benefits of Container Orchestration

Scalability:

  • Automatically scale based on load
  • Handle traffic spikes gracefully
  • Optimize resource utilization
  • Support thousands of concurrent users
  • High Availability:

  • Multi-replica deployments
  • Automatic failover
  • Rolling updates with zero downtime
  • Self-healing capabilities
  • Operational Excellence:

  • Declarative configuration
  • Version-controlled infrastructure
  • Automated deployments
  • Consistent environments (dev/staging/prod)
  • Cost Optimization:

  • Efficient resource usage
  • Better hardware utilization
  • Spot instance support
  • Multi-tenancy capabilities
  • Prerequisites

    Before deploying, ensure you have:

    Infrastructure:

  • Kubernetes cluster (v1.25+)
  • kubectl configured
  • Helm 3 installed
  • Persistent storage provisioner
  • Load balancer (cloud or MetalLB)
  • Resources:

  • Minimum 3 worker nodes
  • 4 CPU cores per node
  • 8GB RAM per node
  • 100GB storage minimum
  • Access:

  • Cluster admin privileges
  • Container registry access
  • DNS management
  • SSL certificate authority
  • Architecture Overview

    Deployment Components

    Application Layer:

  • Next.js frontend (3+ replicas)
  • API server (3+ replicas)
  • Background workers (2+ replicas)
  • WebSocket server (2+ replicas)
  • Data Layer:

  • PostgreSQL (StatefulSet)
  • Redis cache (StatefulSet)
  • Object storage (MinIO or S3)
  • Supporting Services:

  • Nginx Ingress Controller
  • Cert-Manager for SSL
  • Prometheus & Grafana monitoring
  • ELK Stack for logging
  • Helm Chart Installation

    Quick Start

    Add the Space Sign Helm repository:

    Step 1: Add Repository

    helm repo add spacesign https://charts.spacesign.com

    helm repo update

    Step 2: Create Namespace

    kubectl create namespace spacesign-prod

    Step 3: Configure Values

    Create a values-production.yaml file with your customizations.

    Step 4: Install Chart

    helm install spacesign spacesign/spacesign --namespace spacesign-prod --values values-production.yaml

    Production Values Configuration

    Complete production configuration:

    Create a values.yaml with these production settings:

    Global Configuration:

  • Set environment to production
  • Configure domain name
  • Enable SSL/TLS
  • Set replica counts for HA
  • Database Configuration:

  • PostgreSQL version 15
  • Enable persistence with 100GB storage
  • Configure backup schedules
  • Set resource limits (4 CPU, 8GB RAM)
  • Redis Configuration:

  • Enable persistence
  • Configure memory limits
  • Set eviction policies
  • Enable clustering for HA
  • Application Configuration:

  • Set minimum 3 replicas
  • Configure resource requests/limits
  • Enable horizontal pod autoscaling
  • Configure liveness/readiness probes
  • Ingress Configuration:

  • Enable Nginx ingress
  • Configure TLS certificates
  • Set rate limiting
  • Configure CORS policies
  • Monitoring:

  • Enable Prometheus metrics
  • Configure Grafana dashboards
  • Set up alerting rules
  • Enable distributed tracing
  • Storage Configuration

    Persistent Volume Claims

    Space Sign requires persistent storage for:

  • Document uploads
  • Database data
  • Redis persistence
  • Backup data
  • Storage Classes:

    Option 1: Cloud Provider Storage

    Use managed storage from your cloud provider (AWS EBS, Azure Disk, GCP Persistent Disk)

    Option 2: Network Storage

    Configure NFS or Ceph for shared storage across nodes

    Option 3: Local Storage

    Use local SSDs with StatefulSets for high performance

    Database Persistence

    PostgreSQL StatefulSet:

    Configure with proper volume claims, backup schedules, and replication settings for production use.

    High Availability Setup

    Multi-Region Deployment

    Active-Active Configuration:

    Deploy Space Sign across multiple regions:

  • Geographic load balancing
  • Data replication
  • Automatic failover
  • Disaster recovery
  • Regional Architecture:

    Each region contains:

  • Complete Space Sign stack
  • Database replica
  • Object storage
  • Monitoring stack
  • Pod Disruption Budgets

    Protect critical services:

    Configure PodDisruptionBudgets to ensure minimum availability during node maintenance and updates.

    Example Configuration:

  • Frontend: Minimum 2 pods available
  • API: Minimum 2 pods available
  • Workers: Minimum 1 pod available
  • Auto-Scaling Configuration

    Horizontal Pod Autoscaler

    CPU-Based Scaling:

    Scale frontend pods based on CPU utilization (target 70%)

    Custom Metrics Scaling:

    Scale based on Space Sign specific metrics:

  • Active signing sessions
  • Document upload rate
  • API request latency
  • Queue depth
  • Cluster Autoscaler

    Node Auto-Scaling:

    Automatically add/remove nodes based on:

  • Pending pods
  • Resource requests
  • Cost optimization
  • Node utilization
  • Configuration:

  • Minimum nodes: 3
  • Maximum nodes: 20
  • Scale-up delay: 30s
  • Scale-down delay: 10m
  • Network Configuration

    Ingress Setup

    Nginx Ingress Controller:

    Production configuration includes:

  • SSL termination
  • Rate limiting (100 req/min per IP)
  • CORS configuration
  • WebSocket support
  • Custom error pages
  • Service Mesh (Optional)

    Istio Integration:

    For advanced traffic management:

  • Mutual TLS between services
  • Fine-grained access control
  • Circuit breaking
  • Canary deployments
  • Distributed tracing
  • Security Hardening

    Pod Security Policies

    Enforce security standards:

  • Run as non-root
  • Read-only root filesystem
  • Drop capabilities
  • No privilege escalation
  • Network Policies

    Restrict pod-to-pod communication:

    Frontend pods:

  • Allow ingress from Ingress Controller
  • Allow egress to API pods
  • API pods:

  • Allow ingress from Frontend
  • Allow egress to Database and Redis
  • Database pods:

  • Allow ingress from API only
  • Deny all egress
  • Secrets Management

    Options:

    Option 1: Kubernetes Secrets

    Basic secrets with encryption at rest enabled

    Option 2: HashiCorp Vault

    Advanced secrets management with dynamic credentials

    Option 3: Cloud Provider Secrets

    AWS Secrets Manager, Azure Key Vault, GCP Secret Manager

    Best Practices:

  • Rotate secrets regularly
  • Use separate secrets per environment
  • Enable encryption at rest
  • Audit secret access
  • Never commit secrets to git
  • Monitoring & Observability

    Prometheus Metrics

    Space Sign Metrics:

  • spacesign_active_sessions
  • spacesign_document_uploads_total
  • spacesign_signature_completions_total
  • spacesign_api_request_duration
  • spacesign_error_rate
  • System Metrics:

  • CPU usage per pod
  • Memory usage per pod
  • Network I/O
  • Disk I/O
  • Pod restart count
  • Grafana Dashboards

    Pre-built Dashboards:

    Application Dashboard:

  • Active users
  • Document throughput
  • Signature completion rate
  • Error rates
  • Response times
  • Infrastructure Dashboard:

  • Node CPU/Memory
  • Pod health
  • Storage usage
  • Network bandwidth
  • PVC utilization
  • Logging with ELK Stack

    ElasticSearch + Logstash + Kibana:

    Centralized logging for:

  • Application logs
  • Access logs
  • Error logs
  • Audit logs
  • Security logs
  • Log Aggregation:

    All pods ship logs to central ElasticSearch cluster with proper indexing and retention policies.

    Backup & Disaster Recovery

    Database Backups

    Automated Backup Strategy:

    Daily Full Backups:

  • Scheduled at 2 AM UTC
  • Retained for 30 days
  • Stored in separate region
  • Encrypted at rest
  • Hourly Incremental Backups:

  • WAL archiving enabled
  • Point-in-time recovery
  • 7-day retention
  • Backup Testing:

  • Monthly restore tests
  • Verify data integrity
  • Test recovery procedures
  • Document RTO/RPO
  • Application State Backup

    Velero for Kubernetes:

    Backup entire namespace including:

  • Persistent volumes
  • Kubernetes resources
  • Secrets and ConfigMaps
  • Custom Resource Definitions
  • Schedule:

  • Daily namespace backups
  • Weekly cluster backups
  • On-demand pre-upgrade backups
  • CI/CD Integration

    GitOps with ArgoCD

    Automated Deployment Pipeline:

    Development Flow:

    1. Developer pushes code

    2. CI builds Docker image

    3. Updates Helm values in Git

    4. ArgoCD detects changes

    5. Automatically deploys to cluster

    Benefits:

  • Git as single source of truth
  • Declarative deployments
  • Easy rollbacks
  • Audit trail in Git history
  • Blue-Green Deployments

    Zero-Downtime Updates:

    Strategy:

    1. Deploy new version (green)

    2. Run smoke tests

    3. Switch traffic gradually

    4. Monitor metrics

    5. Rollback if issues detected

    Performance Tuning

    Resource Optimization

    Right-Sizing Pods:

    Frontend:

  • Requests: 500m CPU, 512Mi RAM
  • Limits: 2 CPU, 2Gi RAM
  • API:

  • Requests: 1 CPU, 1Gi RAM
  • Limits: 4 CPU, 4Gi RAM
  • Workers:

  • Requests: 500m CPU, 1Gi RAM
  • Limits: 2 CPU, 4Gi RAM
  • Caching Strategy

    Multi-Layer Caching:

    Redis Cache:

  • Session data (15 min TTL)
  • API responses (5 min TTL)
  • User profiles (1 hour TTL)
  • CDN Caching:

  • Static assets (1 year)
  • Document previews (1 day)
  • Public pages (5 minutes)
  • Database Optimization

    PostgreSQL Tuning:

    Key settings for production:

  • shared_buffers: 25% of RAM
  • effective_cache_size: 75% of RAM
  • max_connections: 200
  • work_mem: 64MB
  • Connection Pooling:

    Use PgBouncer to manage database connections efficiently.

    Troubleshooting Guide

    Common Issues

    Pods Stuck in Pending:

  • Check resource availability
  • Verify PVC provisioning
  • Review pod events
  • Check node taints/tolerations
  • High Memory Usage:

  • Review application metrics
  • Check for memory leaks
  • Adjust resource limits
  • Enable memory profiling
  • Slow API Response:

  • Check database performance
  • Review Redis hit rates
  • Analyze slow queries
  • Enable APM tracing
  • Failed Deployments:

  • Review pod logs
  • Check health probes
  • Verify configuration
  • Test rollback procedure
  • Debug Commands

    Useful kubectl commands for troubleshooting:

    View Pod Status:

    kubectl get pods -n spacesign-prod

    View Pod Logs:

    kubectl logs -f pod-name -n spacesign-prod

    Describe Pod:

    kubectl describe pod pod-name -n spacesign-prod

    Execute in Pod:

    kubectl exec -it pod-name -n spacesign-prod -- /bin/bash

    View Events:

    kubectl get events -n spacesign-prod --sort-by='.lastTimestamp'

    Cost Optimization

    Resource Efficiency

    Vertical Pod Autoscaler:

    Automatically adjust resource requests based on actual usage

    Cluster Autoscaler:

    Scale nodes down during low traffic

    Spot Instances:

    Use preemptible/spot instances for non-critical workloads (workers)

    Cost Monitoring

    Track Spending:

  • Use cloud provider cost tools
  • Tag all resources properly
  • Monitor unused resources
  • Review storage costs
  • Optimize data transfer
  • Estimated Monthly Costs:

    Small Deployment (< 1000 users):

  • 3 nodes: $300
  • Storage: $50
  • Load balancer: $20
  • Total: ~$370/month
  • Medium Deployment (1000-10000 users):

  • 10 nodes: $1000
  • Storage: $200
  • Load balancer: $40
  • Total: ~$1240/month
  • Large Deployment (10000+ users):

  • 50 nodes: $5000
  • Storage: $1000
  • Load balancer: $100
  • Total: ~$6100/month
  • Conclusion

    Deploying Space Sign on Kubernetes provides:

    βœ… Enterprise-grade reliability with HA and auto-scaling

    βœ… Operational simplicity through automation

    βœ… Cost efficiency with optimized resource usage

    βœ… Security with network policies and secrets management

    βœ… Observability with comprehensive monitoring

    Next Steps:

    1. Set up your Kubernetes cluster

    2. Install the Space Sign Helm chart

    3. Configure monitoring and alerts

    4. Test disaster recovery procedures

    5. Optimize performance based on metrics


    Need help with your Kubernetes deployment? [Request enterprise support](/request-a-demo) or [join our community](https://github.com/pmspaceai7-wq/space-sign/discussions).

    Ready to Try Space Sign?

    Experience the power of open-source, AI-powered e-signatures.

    Space Sign Assistant

    Hello there πŸ‘‹ I’m the Space Sign Assistant. How can I help you today?