New to Kestra?
Use blueprints to kickstart your first workflows.
Continuously sync flows, files, and dashboards from Git into a Kestra namespace on a schedule. Automate GitOps deployments and stop configuration drift.
id: namespace-sync-from-git
namespace: system
tasks:
- id: sync
type: io.kestra.plugin.git.NamespaceSync
namespace: system
sourceOfTruth: GIT
whenMissingInSource: DELETE
protectedNamespaces:
- system
url: https://github.com/example_org/example_repo
username: "{{ secret('GITHUB_USERNAME') }}"
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
branch: main
gitDirectory: example_directory
triggers:
- id: every_15_minutes
type: io.kestra.plugin.core.trigger.Schedule
cron: "*/15 * * * *"
Keep a Kestra namespace continuously in sync with a Git repository so your version-controlled flows, scripts, and dashboards become the single source of truth. This blueprint runs a scheduled, unidirectional GitOps sync that pulls the latest committed namespace resources from Git into Kestra every 15 minutes, eliminating manual deployments and configuration drift between your repository and your running instance.
io.kestra.plugin.core.trigger.Schedule trigger named every_15_minutes fires on the cron expression */15 * * * *, launching the flow four times an hour.sync task of type io.kestra.plugin.git.NamespaceSync clones the configured Git repository and reconciles its contents into the target namespace.sourceOfTruth is set to GIT, so Git always wins: whatever is committed in the repository defines the desired state of the namespace.whenMissingInSource is set to DELETE, meaning resources removed from Git are also removed from Kestra, keeping the namespace clean.protectedNamespaces lists system, guarding critical resources from accidental deletion during reconciliation.branch: main under gitDirectory: example_directory of the repository at the configured url, authenticating with username and password.Git itself has no scheduler and no awareness of your Kestra instance, so a commit does nothing until something pulls and applies it. Kestra closes that gap: the Schedule trigger drives the pull on a fixed cadence, retries handle transient clone or network failures, and every sync run is recorded with full execution lineage and logs for audit. The entire pipeline is declarative YAML, so the deployment process is itself version-controlled, reviewable, and reproducible across environments.
GITHUB_USERNAME: the Git account or service user used to authenticate.GITHUB_ACCESS_TOKEN: a personal access token with read access to the repository.GITHUB_USERNAME and GITHUB_ACCESS_TOKEN secrets to your Kestra instance.url, gitDirectory, and branch with your repository details.namespace on the sync task to the namespace you want to manage.every_15_minutes trigger reconcile on schedule.cron expression to sync more or less frequently, or replace the schedule with a webhook trigger for push-based deploys.protectedNamespaces to shield additional critical namespaces.whenMissingInSource to KEEP if you prefer additive syncs that never delete.sync to alert a channel when a deployment lands.