This repository contains various GitOps Sample Pipelines using Harness GitOps to help you automate deployments, sync applications, and handle failure scenarios efficiently. These samples cover different aspects of GitOps workflows, including syncing applications, automating PR-based deployments, handling failures, integrating security testing, and setting up notifications for pipeline completion.
Below are the different GitOps workflows covered in this repository:
Learn how to create a Harness GitOps pipeline that fetches application details and syncs it with the desired state defined in Git.
This sample covers:
✔ Setting up a GitOps pipeline in Harness
✔ Fetching application details from the Git repository
✔ Syncing the application using Harness GitOps
This sample demonstrates a PR-based GitOps pipeline, where application updates go through a Pull Request (PR) workflow before being deployed.
Key highlights:
✔ Updating values.yaml in a GitOps repository
✔ Raising a PR to review changes before deployment
✔ Obtaining manual approval before merging
✔ Merging the PR and syncing the GitOps application
This sample builds on the PR pipeline by adding a Failure Strategy to ensure the application remains in a healthy state in case of sync failures.
✔ If GitOps sync fails, the pipeline will revert the merged PR
✔ This restores the application to a previous healthy state
✔ After reverting, the pipeline re-syncs the GitOps application
This sample focuses on adding notifications to a GitOps PR pipeline. It ensures that users are informed when a pipeline completes successfully.
✔ Configuring email notifications
✔ Selecting pipeline events to trigger notifications
✔ Adding recipients and user groups
This sample extends the PR Pipeline by integrating Security Testing Orchestration (STO) to scan for vulnerabilities before deploying changes.
✔ Aqua Trivy for scanning container images for security vulnerabilities
✔ Gitleaks for detecting secrets and vulnerabilities in the Git repository
✔ Failure Strategy to rollback changes if high-severity vulnerabilities are found
✔ Ensures that only secure deployments make it to production
This sample demonstrates how to sync multiple GitOps applications in Harness GitOps pipelines.
✔ Manually select multiple applications for syncing in Harness pipelines.
✔ Use a matrix looping strategy to dynamically sync multiple applications at runtime.
✔ Improve efficiency by syncing multiple applications in a single pipeline execution.
✅ Automate deployments using GitOps principles
✅ Improve visibility into GitOps sync failures and rollback strategies
✅ Enhance control over application updates with PR-based workflows
✅ Get notified when deployments complete successfully
✅ Strengthen security by integrating security testing into the pipeline
✅ Increase efficiency by syncing multiple applications dynamically
These examples provide a step-by-step guide to setting up Harness GitOps pipelines efficiently. Whether you're new to GitOps or looking to enhance your workflows, these samples will help streamline your deployments! 🚀