Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference

All endpoints return JSON. Flux-facing endpoints return the {"inputs": [...]} structure required by the ResourceSetInputProvider ExternalService contract. CRUD endpoints follow standard REST conventions.

Authentication

All endpoints require a Bearer token in the Authorization header.

ModeRead TokenWrite Token
read-onlyAUTH_TOKEN env varN/A (no write endpoints)
crudAUTH_TOKEN env varCRUD_AUTH_TOKEN env var (falls back to AUTH_TOKEN)
curl -H "Authorization: Bearer $AUTH_TOKEN" http://localhost:8080/health

Flux Read Endpoints

These endpoints are consumed by Flux Operator’s ResourceSetInputProvider. They follow the ExternalService contract.

ExternalService Contract

Every response must satisfy:

  • Top-level inputs array
  • Each item has a unique string id
  • Response body under 900 KiB
  • All JSON value types (strings, numbers, booleans, arrays, objects) are preserved in templates

GET /api/v2/flux/clusters/{cluster_dns}/platform-components

Returns platform components assigned to a cluster, with catalog defaults merged and per-cluster overrides applied.

Path parameters:

ParameterTypeDescription
cluster_dnsstringThe cluster’s DNS name (e.g., demo-cluster-01.k8s.example.com)

Response:

{
  "inputs": [
    {
      "id": "cert-manager",
      "component_path": "cert-manager",
      "component_version": "latest",
      "cluster_env_enabled": false,
      "depends_on": [],
      "enabled": true,
      "patches": {},
      "cluster": {
        "name": "demo-cluster-01",
        "dns": "demo-cluster-01.k8s.example.com",
        "environment": "dev"
      },
      "source": {
        "oci_url": "https://charts.jetstack.io",
        "oci_tag": "latest"
      }
    }
  ]
}

Field reference:

FieldTypeDescription
idstringUnique component identifier, used as Flux resource name suffix
component_pathstringChart name or path within OCI artifact. Cluster override takes precedence over catalog default
component_versionstringUpstream version. "latest" means no version pinning
cluster_env_enabledbooleanIf true, ResourceSet template appends /{environment} to the path
depends_onstring[]Component IDs that must be healthy first. Empty = no dependencies
enabledbooleanfalse causes Flux to garbage-collect the component
patchesobjectPer-cluster key-value overrides, injected via HelmRelease valuesFrom
cluster.namestringCluster identifier
cluster.dnsstringCluster FQDN
cluster.environmentstringTier: dev, qa, uat, prod
source.oci_urlstringHelm repository or OCI registry URL
source.oci_tagstringChart/artifact version tag. Cluster override takes precedence

GET /api/v2/flux/clusters/{cluster_dns}/namespaces

Returns namespaces assigned to a cluster.

Response:

{
  "inputs": [
    {
      "id": "cert-manager",
      "labels": { "app": "cert-manager" },
      "annotations": {},
      "cluster": {
        "name": "demo-cluster-01",
        "dns": "demo-cluster-01.k8s.example.com",
        "environment": "dev"
      }
    }
  ]
}

GET /api/v2/flux/clusters/{cluster_dns}/rolebindings

Returns role bindings assigned to a cluster.

Response:

{
  "inputs": [
    {
      "id": "platform-admins",
      "role": "cluster-admin",
      "subjects": [
        {
          "kind": "Group",
          "name": "platform-team",
          "apiGroup": "rbac.authorization.k8s.io"
        }
      ],
      "cluster": {
        "name": "demo-cluster-01",
        "dns": "demo-cluster-01.k8s.example.com",
        "environment": "dev"
      }
    }
  ]
}

GET /api/v2/flux/clusters

Returns all clusters. Used by management cluster provisioners.

Response:

{
  "inputs": [
    {
      "id": "demo-cluster-01",
      "cluster_name": "demo-cluster-01",
      "cluster_dns": "demo-cluster-01.k8s.example.com",
      "environment": "dev"
    }
  ]
}

CRUD Endpoints

Available when API_MODE=crud. These follow standard REST patterns.

Clusters

MethodPathDescription
GET/clustersList all clusters
POST/clustersCreate a cluster
GET/clusters/{id}Get cluster by ID
PUT/clusters/{id}Update a cluster
DELETE/clusters/{id}Delete a cluster

Cluster payload notes:

  • platform_components[] entries are references with per-cluster override fields (id, enabled, optional oci_tag, optional component_path).
  • namespaces[] entries are reference objects (id only).
  • rolebindings[] entries are reference objects (id only).

Platform Components

MethodPathDescription
GET/platform_componentsList all catalog components
POST/platform_componentsCreate a catalog entry
GET/platform_components/{id}Get component by ID
PUT/platform_components/{id}Update a catalog entry
DELETE/platform_components/{id}Delete a catalog entry

Namespaces

MethodPathDescription
GET/namespacesList all namespace definitions
POST/namespacesCreate a namespace definition
GET/namespaces/{id}Get namespace by ID
PUT/namespaces/{id}Update a namespace definition
DELETE/namespaces/{id}Delete a namespace definition

Rolebindings

MethodPathDescription
GET/rolebindingsList all rolebinding definitions
POST/rolebindingsCreate a rolebinding definition
GET/rolebindings/{id}Get rolebinding by ID
PUT/rolebindings/{id}Update a rolebinding definition
DELETE/rolebindings/{id}Delete a rolebinding definition

Service Endpoints

MethodPathDescription
GET/healthLiveness probe — returns {"status": "ok"}
GET/readyReadiness probe endpoint — currently returns {"status": "ok"}
GET/openapi.yamlOpenAPI 3.0 specification document

Error Responses

StatusCondition
401 UnauthorizedMissing or invalid bearer token
404 Not FoundCluster DNS or resource ID not found
500 Internal Server ErrorData store connection error