KubApp — Execution Flow (How the Platform Comes Alive)
KubApp is a closed-loop GitOps control system.
It does not only "deploy applications".
It continuously converges system reality toward Git-defined intent.
Terraform → Build → Registry → GitOps → ArgoCD
↑ ↑ ↑
Snapshot ← Verification ← Cluster ← Reconcile ←┘
#
1. Laptop push
↓
2. GitHub repo updated
↓
3. Build workflow runs
↓
4. Docker images built + pushed
↓
5. Artifacts created
↓
6. update.yml triggered
↓
7. GitOps repo updated + committed again
↓
8. ArgoCD detects Git change
↓
9. Kubernetes updates automatically
#
1. Developer pushes code
↓
2. Build workflow
- builds images
- pushes registry
- creates artifacts
↓
3. Update workflow
- reads artifacts
- updates GitOps repo
- commits changes
↓
4. ArgoCD
- detects Git change
- syncs automatically
- reports health status
↓
5. Verify workflow
- uses ArgoCD CLI/API ONLY
- checks health
- triggers rollback via Git tag switch
Every stage is deterministic, reversible, and observable.
Kubernetes is the runtime body.
Terraform is the foundation layer.
------------------------------------------------------------
1. INFRASTRUCTURE BOOTSTRAP (TERRAFORM ORIGIN) iac/infra
------------------------------------------------------------
Everything begins with infrastructure provisioning.
Terraform establishes the physical execution environment:
- VPC + networking topology
- IAM roles and access boundaries
- OIDC authentication bridge
- backend state coordination
- No GitOps system is active
- Only raw compute + cluster foundation exists
This stage creates the "empty operating system"
on which the entire platform will run.
A fully provisioned Kubernetes cluster with no workload logic.
------------------------------------------------------------
2. GITOPS CONTROL PLANE ACTIVATION (BOOTSTRAP PHASE) iac/k8s + iac/manifests
------------------------------------------------------------
Once the cluster exists, it is transformed into a GitOps system.
Bootstrap workflow installs:
- ArgoCD (reconciliation engine)
- SOPS + encryption tooling
- cluster identity bindings
- metrics + observability hooks
- GitHub authentication integration
Critical transition happens here:
The cluster stops being "manual infrastructure"
and becomes a continuously reconciled system.
Git becomes the only valid configuration interface.
------------------------------------------------------------
3. APPLICATION BUILD PHASE (ARTIFACT GENERATION) build.yml
------------------------------------------------------------
The system now moves from infrastructure to workload creation.
CI pipeline scans application definitions:
- Image is tagged (commit-based + semantic)
- Image is pushed to registry
Output is NOT deployment.
Output is intent artifacts.
These artifacts become the input for GitOps reconciliation.
------------------------------------------------------------
4. GITOPS REGISTRY GENERATION (INTENT LAYER)
------------------------------------------------------------
After build completion, the system writes a declarative registry:
This is the source of truth for what SHOULD exist.
- Nothing is deployed yet
- No Kubernetes changes happen
- This is pure declarative state definition
If it is not in the registry, it does not exist in the platform.
------------------------------------------------------------
5. GITOPS MATERIALIZATION (HELM + CONFIG RENDERING) add_new_app.yml
------------------------------------------------------------
Registry entries are transformed into deployable manifests:
gitops/envs///values.yaml
- resolves image versions
- injects environment-specific configuration
- aligns runtime parameters
- prepares Kubernetes manifests
This is state compilation.
Git is updated → ArgoCD observes → Kubernetes will later converge
------------------------------------------------------------
6. RECONCILIATION ENGINE (ARGOCD ACTIVATION LOOP) setup_argocd.yml
------------------------------------------------------------
ArgoCD continuously watches:
- ArgoCD detects divergence (Git vs Cluster)
- Kubernetes resources are created or updated
- workloads are reconciled in real time
Git change → ArgoCD detection → Kubernetes mutation
No manual intervention exists in this loop.
This is the moment the platform becomes autonomous.
------------------------------------------------------------
7. INGRESS + ROUTING SYNCHRONIZATION
------------------------------------------------------------
Routing is treated as a first-class system, not static config.
The ingress layer enforces:
- every registered service must be routable
- no orphan routes are allowed (remove_svc.yml ensures that)
- registry is authoritative for traffic mapping
- missing routes → auto-added or flagged
- stale routes → removed or corrected
If a service exists → it must be reachable.
If it is reachable → it must exist in registry.
------------------------------------------------------------
8. DRIFT DETECTION (INFRASTRUCTURE + SYSTEM CONSISTENCY)
------------------------------------------------------------
Terraform and runtime state are continuously validated:
- terraform plan -detailed-exitcode
- cluster state comparison
- configuration divergence detection
- NO_DRIFT → system aligned
- DRIFT → divergence detected
This layer never modifies infrastructure.
It only observes and reports deviation.
------------------------------------------------------------
9. RUNTIME VERIFICATION (SYSTEM CONVERGENCE CHECK)
------------------------------------------------------------
After reconciliation completes, the system enters validation mode.
- Kubernetes health and readiness
- ArgoCD sync status correctness
- service endpoint reachability
- ingress routing validation
- workload stability confirmation
The system is treated as production-critical.
Git state == ArgoCD state == Kubernetes state == Network state
------------------------------------------------------------
10. SNAPSHOT + STABILITY ANCHORING
------------------------------------------------------------
Once validation passes, the system locks in a stable state.
- full system metadata record
- commit + environment mapping
Then a stability marker is created:
- a full platform convergence point
- not just an application version
- a system-wide known-good state
It becomes the atomic rollback unit of the entire platform.
------------------------------------------------------------
------------------------------------------------------------
KubApp does not behave like a CI/CD pipeline.
It behaves like a closed-loop control system:
Actual State (Kubernetes)
Validation (Runtime Checks)
Stabilization (Snapshots)
Feedback Loop (Drift Detection)
This loop runs continuously.
- Infrastructure is self-healing
- Deployments are deterministic
- State is always traceable
- System converges instead of drifting