SPITIKOS/DOCS/GETTING-STARTED/PLATFORM-ARCHITECTURE

Platform Architecture

This document provides a high-level overview of the architecture, design patterns, and core concepts used in this project.

1. Core Philosophy: GitOps & Multi-Repo

The entire project is built around a GitOps philosophy using a multi-repo approach. The desired state of all applications, infrastructure, and configurations is defined declaratively across several key repositories under the spitikos GitHub organization. Argo CD acts as the GitOps operator, continuously ensuring the live state of the cluster matches the state defined in Git.

The key principles are:

  • Declarative: All configuration is declarative code, primarily Kubernetes and Helm manifests.
  • Versioned and Auditable: All changes are Git commits, providing a clear audit trail and the ability to revert changes.
  • Automated: The entire lifecycle, from code commit to live deployment, is automated.
  • Separation of Concerns: Each part of the platform (core configuration, charts, applications) has its own dedicated repository.
  • Don't Repeat Yourself (DRY): Common patterns are abstracted into reusable components (the common Helm chart, reusable GitHub workflows).

2. System Components

The platform consists of several key layers:

LayerTechnologyPurpose
HardwareRaspberry Pi 5The physical server running the platform.
Operating SystemUbuntu ServerThe base OS for the Raspberry Pi.
Container Orchestrationk3sA lightweight, certified Kubernetes distribution.
AutoscalingKEDAProvides event-driven, scale-to-zero autoscaling for applications.
Public IngressCloudflare TunnelProvides a secure, outbound-only connection to the Cloudflare network, handling TLS termination.
Internal IngressNGINXRoutes traffic within the cluster from the tunnel to the correct service based on hostname.
Application CachingRedisProvides a high-performance, in-memory cache for processed data, such as documentation.
Application PackagingHelmManages Kubernetes deployments using a reusable "wrapper chart" pattern.
Continuous IntegrationGitHub ActionsBuilds and pushes container images; automatically updates Helm values in the charts repository.
Continuous DeploymentArgo CDDetects changes in the charts repository and automatically syncs them to the Kubernetes cluster.

3. Project Structure

The platform is organized across multiple repositories in the spitikos organization:

  • spitikos/spitikos: The central repository. It contains:
    • argocd/: Argo CD application manifests that define what should be deployed.
    • .github/workflows/: Reusable GitHub Actions workflows for CI/CD.
  • spitikos/api: The monolithic backend server. It provides all gRPC services for the platform, including the DocsService which powers the documentation website.
  • spitikos/docs: Contains all project documentation. Changes to this repository trigger a webhook to the api service to recache the content.
  • spitikos/charts: Contains all the Helm charts for deploying applications and platform services.