Skip to main content

Kubernetes Deployment Architecture

This page describes the full production deployment architecture on a managed Kubernetes cluster. A cloud provider can be selected below for provider-specific details.

Application Stack Components​

The AI/Run CodeMie application consists of multiple integrated components organized into functional categories:

Application Stack

Core AI/Run CodeMie Services​

Proprietary services that provide the main AI/Run CodeMie functionality:

ComponentContainer RegistryDescription
CodeMie APIeurope-west3-docker.pkg.dev/.../codemie:x.y.zBackend service handling business logic, data processing, and API operations
CodeMie UIeurope-west3-docker.pkg.dev/.../codemie-ui:x.y.zFrontend web application providing the user interface
NATS Auth Callouteurope-west3-docker.pkg.dev/.../codemie-nats-auth-callout:x.y.zAuthentication and authorization service for NATS messaging (Plugin Engine component)
MCP Connecteurope-west3-docker.pkg.dev/.../codemie-mcp-connect-service:x.y.zBridge enabling CodeMie to communicate with MCP servers
Mermaid Servereurope-west3-docker.pkg.dev/.../mermaid-server:x.y.zDiagram generation service for visualization in chats

Data Layer​

Database and search components for data persistence:

ComponentContainer RegistryDescription
Elasticsearchdocker.elastic.co/elasticsearch/elasticsearch:x.y.zPrimary data store for AI/Run CodeMie (datasources, projects, conversations, etc.)
Kibanadocker.elastic.co/kibana/kibana:x.y.zAnalytics and visualization interface for Elasticsearch data

Security & Identity Management​

Authentication and authorization components:

ComponentContainer RegistryDescription
Keycloak Operatorepamedp/keycloak-operator:x.y.zManages Keycloak deployment and configuration
Keycloakquay.io/keycloak/keycloak:x.y.zIdentity and access management (IAM) solution providing SSO, authentication
OAuth2 Proxyquay.io/oauth2-proxy/oauth2-proxy:x.y.zAuthentication middleware integrating with Keycloak for secure access

Infrastructure Services​

Essential Kubernetes infrastructure components:

ComponentContainer RegistryDescription
Nginx Ingress Controllerregistry.k8s.io/ingress-nginx/controller:x.y.zRoutes external traffic to internal services
Storage ClassCloud-provider CSI driver (EBS, Azure Disk, or GCP Persistent Disk)Provides persistent volumes for stateful components

Messaging & Integration​

Message broker for Plugin Engine:

ComponentContainer RegistryDescription
NATSnats:x.y.zHigh-performance messaging system for Plugin Engine communication

Observability​

Logging and monitoring components:

ComponentContainer RegistryDescription
Fluent Bitcr.fluentbit.io/fluent/fluent-bit:x.y.zLightweight log collector enabling agent observability

Optional Components​

Components that can be omitted based on configuration:

ComponentContainer RegistryDescription
LLM Proxy–Optional proxy for load balancing and high availability of AI model requests and usage insights

Deployment Dependencies​

Components must be deployed in the following order due to dependencies:

  1. Infrastructure → Ingress Controller, Storage Class
  2. Operators → Keycloak Operator
  3. Data Layer → Elasticsearch
  4. Security → Keycloak (with database credentials), OAuth2 Proxy
  5. Messaging → NATS
  6. Core Services → CodeMie API, UI, MCP Connect, NATS Auth
  7. Observability → Fluent Bit, Kibana
  8. Optional → LLM Proxy (if needed)

Cloud Infrastructure​

A cloud provider can be selected below for provider-specific infrastructure details.

AI/Run CodeMie is deployed on Amazon Elastic Kubernetes Service (EKS) with supporting AWS services for networking, storage, and identity management.

High-Level Architecture Diagram

The diagram below illustrates the complete AI/Run CodeMie infrastructure deployment on AWS:

AWS Architecture Diagram

Architecture Customization

The architecture can be customized based on your organization's security policies, compliance requirements, and operational preferences. Consult with your deployment team to discuss specific requirements.

Kubernetes Resource Requirements​

Container Resource Requirements​

The table below specifies resource requirements for AI/Run CodeMie components sized for high-scale production deployments supporting 500+ concurrent users.

ComponentPodsRAMvCPUStorage
CodeMie API28Gi2.0–
CodeMie UI1128Mi0.1–
Elasticsearch216Gi4.0200 GB per pod
Kibana11Gi1.0–
Mermaid-server1512Mi1.0–
PostgreSQLManaged service in cloud––30-50 GB
Keycloak PostgreSQL (optional)Managed service in cloud––20 GB
Keycloak14Gi2.0–
Oauth2-proxy1128Mi0.1–
NATS + Auth Callout1 + 1512Mi1.0–
MCP Connect11Gi0.5–
Fluent BitDaemonSet128Mi0.1–
LLM Proxy14Gi1.0–
Scaling Considerations

The listed requirements are designed for high-scale production deployments. For smaller teams and lower concurrency, some resources can be scaled down:

  • User Concurrency: API replicas can be scaled depending on the load
  • Data Volume: Elasticsearch stores vector datasources, user metrics and container logs, therefore storage grows with datasources amount and size and log retention policies
  • Database Sizing: PostgreSQL managed service tier depends on user count and the amount of resources they create in CodeMie. When Keycloak uses a dedicated database instance, each instance can be sized independently; when Keycloak shares the CodeMie database, the combined workload must be accounted for when choosing the service tier
  • LLM Proxy: Resource requirements depend on the exact LLM proxy type being used