Skip to main content

Scalable Microservices

Deploy resilient, auto-scaling microservices using Managed Kubernetes.

Architecture Overview

This architecture utilizes the Substrate Managed Kubernetes Service to orchestrate containerized microservices.

Key Features

  • Ingress Controller: Manages external access to the services in a cluster (typically HTTP).
  • Horizontal Pod Autoscaler (HPA): Automatically scales the number of pods based on observed CPU utilization.
  • Persistent Volumes (PVC): Provides durable storage for stateful services like databases or caches.
  • Namespace Isolation: Separates different environments (Dev, Staging, Prod) within the same cluster.

Deployment Guide

1. Cluster Provisioning

  • Go to Enterprise > Kubernetes.
  • Create a cluster with at least 3 worker nodes for high availability.
  • Enable the Cluster Autoscaler to automatically add nodes when pods are pending.

2. Service Exposure

  • Install NGINX Ingress Controller via Helm.
  • Define Ingress resources to route usage based on paths (e.g., /api/auth -> Auth Service).

3. Scaling

  • Define resource requests and limits for your deployments.
  • Apply HPA rules:
    apiVersion: autoscaling/v2
    kind: HorizontalPodAutoscaler
    metadata:
    name: auth-service-hpa
    spec:
    scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: auth-service
    minReplicas: 2
    maxReplicas: 10
    metrics:
    - type: Resource
    resource:
    name: cpu
    target:
    type: Utilization
    averageUtilization: 70