GitOps
Git-based delivery for your local cluster.
LoKO GitOps connects Forgejo to a GitOps controller (FluxCD or ArgoCD), so commits become cluster state.
What You Get
Section titled “What You Get”- A Forgejo
gitopsrepository used as the reconciled source of truth. - A
sample-webapprepository with CI workflows for build, PR previews, and promote-to-prod. - Automatic reconcile on push via webhooks (plus periodic polling).
- Provider-aware PR preview generation.
Architecture (High Level)
Section titled “Architecture (High Level)”- Forgejo hosts repos, webhooks, and Forgejo Actions.
- Provider (FluxCD or ArgoCD) watches Git and applies state.
- GitOps repo (
gitops) containsclusters/<env>/and app overlays.
Provider Differences
Section titled “Provider Differences”| Capability | FluxCD | ArgoCD |
|---|---|---|
| PR trigger mode | Intent label preview, deploy label preview-built | Intent label preview, deploy title suffix [preview-built] |
| PR generator model | ResourceSetInputProvider + ResourceSet | ApplicationSet pullRequest generator |
| Preview host | sample-webapp-pr-{N}.<apps-domain> | sample-webapp-pr-{N}.<apps-domain> |
Typical Flow
Section titled “Typical Flow”- Run
loko gitops init. - Commit to
gitopsto reconcile manifests. - Open PRs in
sample-webappto build preview images. - Add the
previewlabel when you want a PR image pushed to the container registry, then use/previewif you want to activate it later on an existing PR. - Promote approved image to prod via workflow.
Commands
Section titled “Commands”loko gitops init --provider fluxcdloko gitops statusloko gitops reconcile # trigger immediate reconciliation of root constructloko gitops reset # destroy + re-initialize (keeps gitops.enabled: true)loko gitops destroyWhere To Go Next
Section titled “Where To Go Next”- Detailed, step-by-step setup: Tutorial: GitOps Setup
- OCI-based delivery without git write-backs: GitOps: Gitless Mode
- Full command reference: Commands
- Config schema: Config Schema