- Source of Truth: In GitOps, Git repositories serve as the single source of truth for your infrastructure and application configurations. Everything needed to run your app is stored as code in these repositories.
- Version Control: Since everything is in Git, you have a complete history of changes. This makes it easy to track who made changes, revert to previous versions if needed, and collaborate with others.
- Automation: GitOps uses automation tools to continuously monitor your Git repositories. When changes are detected, these tools automatically update your applications and infrastructure to match the new configuration. This ensures that what you have in your Git repository is exactly what is running in your environment.
- Consistency and Reliability: By using Git as the source of truth and automating deployments, GitOps ensures that your environments are consistent and reduces the chance of human error, making deployments more reliable.
- Collaboration: Teams can collaborate more effectively since they can propose changes through pull requests, review code, and discuss potential impacts before deploying.
tfy apply command.
Truefoundry follows the same principles as Kubernetes for Infrastructure as Code. This is different than OpenTofu/Terraform way in which you need to learn OpenTofu/Terraform to be able to automate. It’s much simpler and easier to use - copy the YAML from the UI and paste it in your Git repository.
Organizing the Git repository containing the entire Truefoundry configuration
You can understand how to organize your Git repository for all Truefoundry configuration by looking at this sample repository: truefoundry/truefoundry-gitops-sample-repository. It primarily comprises of resources for both AI deployment and Gateway. You can focus on the specific resources in case you are only using AI Deployment or AI Gateway.- clusters/ - contains the cluster configuration
- gateway/ - contains the gateway configuration
- integrations/ - contains the integration configuration
- teams/ - contains the team configuration
- virtualaccounts/ - contains the virtual account configuration

Setup CI/CD
We also provide ready to use GithubActions/Bitbucket Pipelines scripts to setup CI/CD for your Git repository. You can use these scripts or modify them according to your needs.- GitHub Actions
- Bitbucket Pipelines
The GitHub Actions workflows are available in the sample repo here:
.github/workflows/.The template primarily implements two workflows:-
dry_run_on_pr.yaml- Runs on creation or update of a pull request. It validates the spec for all YAML files changed in the PR:- Checks if the changed file is a valid YAML file
- Checks if the changed file name matches the
namefield inside the YAML - Validates the spec using
tfy apply --dry-run
-
apply_on_merge.yaml- Runs on merges to the default branch. It runstfy applyon all files changed in the PR and deletes configurations for files that were removed.
Configure the required repository secrets (for example,
TFY_HOST and TFY_API_KEY) as described in the sample repo README: Truefoundry Sample Gitops Repo.