Skip to content
/ cortex Public

Synapse Platform Control Plane - Hub cluster for MLOps

Notifications You must be signed in to change notification settings

mdaops/cortex

Repository files navigation

Cortex

Synapse Platform Control Plane - manages fleet clusters via Flux GitOps.

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                       CORTEX (Platform Cluster)                     │
│                                                                     │
│  Flux manages:                                                      │
│  ├── Platform infrastructure (Crossplane, Kyverno, etc.)           │
│  ├── Argo CD installation on fleet clusters                        │
│  └── Tenant boundaries (namespaces, quotas, RBAC)                  │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              │ Deploys control plane TO
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      FLEET CLUSTERS (Spokes)                        │
│                                                                     │
│  Argo CD manages:                                                   │
│  ├── Application workloads                                          │
│  └── Product team resources                                         │
└─────────────────────────────────────────────────────────────────────┘

Structure

cortex/
├── hub/                    # Flux entry point (bootstrapped to cortex)
│   ├── flux-system/        # Flux components (auto-generated)
│   ├── cortex.yaml         # Platform cluster Kustomizations
│   └── dev.yaml            # Dev fleet cluster Kustomizations
│
├── clusters/               # Per-cluster overlays
│   ├── cortex/             # Platform cluster
│   ├── dev/                # Fleet: dev environment
│   └── production/         # Fleet: production environment
│
├── plane/                  # Shared base definitions
│   ├── control/            # Control plane components
│   │   ├── crossplane/     # Crossplane + providers + configs
│   │   ├── argocd/         # Argo CD
│   │   └── tools/          # Argo Workflows, Flink, etc.
│   ├── infrastructure/     # Infrastructure components
│   │   ├── gateway/        # kgateway controller + CRDs
│   │   ├── istio/          # Istio service mesh
│   │   └── tailscale/      # Tailscale operator
│   └── security/           # Security components
│       ├── cert-manager/   # Certificate management
│       └── kyverno/        # Policy engine
│
├── apis/                   # Crossplane composition packages
│   └── management/         # Platform API definitions
│       ├── apis/tenant/    # Tenant XRD + Composition
│       └── functions/      # Composition functions
│
├── pkg/                    # Shared Go libraries
│   ├── composer/           # XR field accessor + error accumulator
│   └── resources/          # k8s resource builders
│
├── kind/                   # Kind cluster configurations
├── scripts/                # Shell scripts
└── go.work                 # Go workspace

Dependency Chain

Flux applies in order: tenantscontrollersconfig

Each namespace has its own set:

  • flux-system/tenantsflux-system/controllersflux-system/config (platform)
  • dev/tenantsdev/controllersdev/config (fleet dev)

Commands

Command Description
just fleet-up Create Kind clusters
just fleet-down Destroy clusters
just fleet-status Check cluster health
just bootstrap <owner> <repo> Bootstrap Flux
just flux-status View Flux status
just flux-reconcile Force reconciliation
just validate Validate manifests

Tailscale Integration

Fleet cluster services are exposed via Tailscale for secure access without port-forwarding.

Prerequisites

  1. Create OAuth client at https://login.tailscale.com/admin/settings/oauth

    • Scopes: devices:write, dns:write
    • Tag: tag:k8s (or your preferred tag)
  2. Create the secret on cortex cluster before bootstrapping:

kubectl --context kind-cortex create namespace dev
kubectl --context kind-cortex create secret generic tailscale-oauth \
  --namespace dev \
  --from-literal=clientId=<your-client-id> \
  --from-literal=clientSecret=<your-client-secret>

Custom Domain Access

Services are exposed via kgateway with TLS termination on custom domains.

Architecture:

Client → DNS → Tailscale (encrypted) → LoadBalancer → kgateway (TLS) → Service

Or use an A record pointing to the Tailscale IP (check with kubectl get svc synapse-gateway -n kgateway-system).

Certificate:

Development uses a self-signed CA. Browser will show a certificate warning.

For production, configure Let's Encrypt with DNS-01 challenge:

  1. Create a ClusterIssuer with your DNS provider credentials
  2. Update deploy/config/gateway/issuer.yaml to use Let's Encrypt
  3. Update deploy/config/gateway/certificate.yaml issuer reference

Adding a Fleet Environment

  1. Create overlay in clusters/<env>/
  2. Create hub file hub/<env>.yaml
  3. Add to hub/kustomization.yaml
  4. Create kubeconfig secret in <env> namespace on cortex

About

Synapse Platform Control Plane - Hub cluster for MLOps

Resources

Stars

Watchers

Forks

Packages