Skip to content

CK.Operator -- CKP Cluster Operator

CK.Operator reconciles .ckproject and conceptkernel.yaml files into cluster gateway resources. It reads the declared state (TBox) and makes the cluster match.

Single Rule

If it is not in the ontology, it does not exist in the cluster.

Lineage

CKOP v2.0CKP v3.4CK.Operator v3.5.1
Three orthogonal loopsThree independently-versioned volumesThree persistent volumes per kernel
OPS/TOOL/DATACK/TOOL/DATATBox/RBox/ABox
Custom objects/refs/commitsNative git per volumeGit on volume-mounted filesystem
serving.json with canary weightsserving.json with ck_ref + tool_refExplicit version directories + route rule
NATS topics per loopName-based NATS (primary) + GUID-based (extended)Operator watches resources, not NATS
Manual applyInline YAML via platform toolingOperator reconciles from conceptkernel.yaml
BFO Continuant/OccurrentBFO 2020 full hierarchyBFO + IAO + CCO + PROV-O + ValueFlows

Ontological Grounding

CK.Operator is itself a ckp:HotKernel (BFO:0000040 + cco:Agent). Its actions are ckp:Reconciliation (iao:PlanSpecification + cco:Event). Its outputs are ckp:Instance (iao:DataItem) with PROV-O provenance.

What the Operator Maps

CKP Class (Layer 1)Mid-Level (Layer 0.5)Cluster ResourceRelationship
ckp:Kernelcco:Agent + BFO:0000040Workload, ServiceOne kernel -> one workload
ckp:Actioniao:PlanSpecificationRoute rule /action/*Actions exposed as API endpoints
ckp:Instanceiao:DataItemPersistent volume (DATA loop)Instances written to storage volume
ckp:Edgecco:ArtifactRoute subpath, volume mountEdge dependencies as shared volumes
ckp:GovernanceModeBFO:0000019Security policySTRICT/RELAXED/AUTONOMOUS -> CORS/auth
ckp:KernelTypeBFO:0000019Workload strategyHOT -> process; INLINE -> config artifact; STATIC -> filer only
ckp:ServingDispositionBFO:0000016Route rulesAPIServing -> /action/; WebServing -> filer; NATSListening -> no gateway resource
ckp:Projectcco:OrganizationCKProject custom resourceOne project -> one namespace scope

What the Operator Does NOT Map

Resources without ontological basis are not created:

  • No init containers (unauthorized foreign images)
  • No sidecars (unless declared as edge kernel with COMPOSES predicate)
  • No cluster-scoped resources (operator stays in namespace)
  • No DNS records (external-dns handles that from route rule annotations)
  • No secrets (identity provider operator handles identity secrets)
  • No gateway resource (gateway-system boundary -- operator only creates route rules)

Input: What the Operator Watches

CKProject Custom Resource

yaml
apiVersion: conceptkernel.org/v1
kind: CKProject
metadata:
  name: example-project
spec:
  domain: example.org
  storage: volume       # configmap | filer | volume
  gateway:
    parentRef:
      name: multi-domain-gateway
      namespace: gateway-system

conceptkernel.yaml Fields

The operator reads from TBox only -- it never reads TOOL or DATA loop files:

FieldDL BoxDrives
metadata.nameTBoxCluster resource naming
kernel_classTBoxFiler path, volume naming
qualities.typeTBoxHOT/COLD/INLINE/STATIC -> workload strategy
qualities.governance_modeTBoxSecurity policy generation
spec.web.subdomainTBoxRoute rule hostname
spec.tool.runtimeTBoxWhether to create workload
spec.actions.uniqueTBoxRoute rules for /action/*
spec.edges.outboundTBoxShared volume mounts, subpath routes

Output: What the Operator Creates

Per-Kernel: Three Persistent Volumes

DL BoxVolume NameFiler PathAccess
TBoxck-{conceptkernel}-ck/ck/{project}/concepts/{conceptkernel}/ReadOnlyMany
RBoxck-{conceptkernel}-tool/ck/{project}/concepts/{conceptkernel}/tool/ReadOnlyMany
ABoxck-{conceptkernel}-storage/ck/{project}/concepts/{conceptkernel}/storage/ReadWriteMany

Per-Kernel: Route Rules

Gateway split routing:

/action/*   -> process (TOOL loop)
/cklib/*    -> filer (CK.Lib edge storage/web/)
/v{N}/*     -> filer (versioned DATA loop storage/web/v{N}/)
/*          -> filer (current DATA loop storage/web/)

Per-Kernel: Security Policy

GovernanceModeCORSAuthInter-Kernel
RELAXEDAllow *.{domain}None (anon)Open
STRICTSpecific origins onlyJWT (identity provider)JWT required
AUTONOMOUSNo CORSmTLS (SPIFFE)SVID required

Per-Kernel: Workload (HOT/COLD only)

Process filesystem follows CKP canonical tree:

/app/concepts/{conceptkernel}/
+-- conceptkernel.yaml              <- CK loop volume (ReadOnly)
+-- tool/                           <- TOOL loop volume (ReadOnly)
|   +-- processor.py
|   +-- cklib/                      <- Edge volume: CK.Lib (ReadOnly)
+-- storage/                        <- DATA loop volume (ReadWrite)
    +-- web/
    +-- instances/
    +-- proof/
    +-- ledger/
    +-- index/
    +-- llm/

Edge Dependencies

Edge PredicateCluster ResourceMount
EXTENDSVolume mount (TOOL loop of target)tool/cklib/ or target tool path
COMPOSESRoute subpath to target's web/cklib/, /{edge-name}/
TRIGGERS(no cluster resource -- NATS-level)--

Reconciliation Loop

On CKProject or conceptkernel.yaml change:
|
+-- Read .ckproject -> domain, storage type, gateway parentRef
+-- Scan concepts/ -> list all conceptkernel.yaml
|
+-- For each kernel:
|   +-- Read conceptkernel.yaml (TBox only)
|   +-- Read serving.json (version routing)
|   +-- Determine kernel type (HOT/COLD/INLINE/STATIC)
|   +-- Compute desired state:
|   |   +-- Persistent volumes  (if storage: volume)
|   |   +-- Workload + Service  (if HOT or COLD)
|   |   +-- Route rules         (actions + versions + edges + web)
|   |   +-- Security policy     (from governance_mode)
|   |   +-- Edge volumes/routes (from edges.outbound)
|   |
|   +-- Diff against current cluster state
|   +-- Apply delta (create / update / delete)
|
+-- Record reconciliation as Instance with PROV-O provenance
|
+-- On kernel deleted:
    +-- Delete route rules, security policy
    +-- Delete workload, service
    +-- RETAIN persistent volumes (data preservation)
    +-- Record deletion instance with PROV-O

Data Preservation

When a kernel is deleted, the ABox (DATA loop) persistent volume is NEVER destroyed by the operator. Data is preserved.

NATS Harness

CK.Operator is a HotKernel -- it runs the standard NATS harness alongside the operator loop:

NATS TopicDirectionPayload
input.CK.OperatorSubscribe{ action: "reconcile" }, { action: "status" }, { action: "rollback", kernel: "..." }
event.CK.OperatorPublish{ event: "reconciled", project: "...", kernels: N }
event.CK.OperatorPublish{ event: "kernel.deployed", kernel: "...", type: "HOT", version: "v2" }
event.CK.OperatorPublish{ event: "kernel.deleted", kernel: "..." }
event.CK.OperatorPublish{ event: "error", kernel: "...", reason: "..." }

Versioning Roadmap

VersionScope
v3.5.1Persistent volume creation, route rules, security policy, workload for storage: volume projects
v3.5.2serving.json version routing, explicit /v1/, /v2/ paths, deprecation announcements
v3.5.3Edge dependency volume management, inter-kernel security policy, COMPOSES/EXTENDS resolution
v3.5.4Compliance gate -- refuse to reconcile kernels that fail check.ontology
v3.6.0SPIFFE integration -- mTLS policies derived from grants block

CRD Definition

CKProject CustomResourceDefinition
yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: ckprojects.conceptkernel.org
spec:
  group: conceptkernel.org
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              required: [domain, storage]
              properties:
                domain:
                  type: string
                storage:
                  type: string
                  enum: [configmap, filer, volume]
                gateway:
                  type: object
                  properties:
                    parentRef:
                      type: object
                      properties:
                        name: { type: string }
                        namespace: { type: string }
  scope: Namespaced
  names:
    plural: ckprojects
    singular: ckproject
    kind: CKProject
    shortNames: [ckp]

Released under the MIT License.