How kanisterio/kanister works
Project type and purpose
• Kanister is an _open-source, Kubernetes-centric data protection workflow management tool_.
• It implements the Kubernetes Operator pattern (CRDs + controllers), provides a CLI/SDK, and integrates with object stores (S3, Azure, GCS) and backup engines (Kopia).
File structure
• Top-level “cmd/” folders hold executables:
• cmd/controller → the Kanister Operator (runs controllers/reconcilers)
• cmd/kanctl → CLI for users to create ActionSets, Blueprints, Profiles, etc.
• cmd/kando → an alternative CLI for event-driven use
• cmd/reposervercontroller → a specialized controller for the RepositoryServer CRD
• “pkg/apis” defines the CRDs (Blueprint, ActionSet, Profile, RepositoryServer).
• “pkg/controllers” and “pkg/controller” contain the reconciliation loops.
• “pkg/function” holds the atomic data-operation functions that run in Job pods.
• “pkg/datamover” abstracts data transfer (push/pull) to object stores.
• “pkg/client” is the Kubernetes client-go code for CRD types.
• “pkg/kanx” implements a gRPC service (kanx server) for synchronous execution.
• “pkg/kopia” provides Kopia integration.
• The “helm/kanister-operator” and “docker” folders contain deployment assets.
README for additional insights
• Kanister exposes Custom Resources (Blueprint, ActionSet, Profile, RepositoryServer)
• Users define Blueprints (workflows), instantiate ActionSets, and Kanister’s controllers execute them asynchronously via Job pods or synchronously via ExecStream.
• The operator handles security (RBAC), metrics, and events.
Final advice
• Be as granular as reasonable: break out each CRD and its reconciler, the datamover abstraction, kopia integration, and the synchronous ExecStream path.