Learn KOP - Part 1 - Setup - Rafay Product Documentation

Part 1: Setup

What Will You Do

In this section, you will perform a one-time configuration of a GitOps pipeline to enable System Sync to communicate with a Git repository.

Once this part is complete, in subsequent parts, you will test System Sync to sync bidirectionally, from System to Git and then from Git to System.


Step 1: Create GitOps Agent

We must first create a GitOps Agent that will allow the pipeline to access your Git repository. The agent will run on your existing cluster.

This will create an agent on the cluster specified. The agent will be used to communicate with the Git repository. It will take a few minutes for the agent to be deployed and become healthy.


Step 2: Create Repository

Next, we will create a repository in GitHub. This repository will be used by System Sync to store the configuration files of the resources within the organization.

This will create a new private repository in your Git system (e.g. GitHub). An example shown below.


Step 3: Add Repository

Note: It does not matter if your GitHub repo is public or private. If public, you do not need to provide access credentials.


Step 4: Create Pipeline

The GitOps pipeline will ensure that the resources in the system are "always kept reconciled" with the desired specifications in the Git repository. It will also ensure the Git repository is reconciled with the system if a change is made directly on the system.

We will now create a GitOps Pipeline.


Add Stage

A pipeline can have multiple stages, with completely different actions to model your desired workflows. In this exercise, we will test with a simple, single stage pipeline.


Add Trigger

A pipeline can be executed based on an "external trigger". For example, changes to the manifests in your Git repository. In this exercise, we will configure a trigger that will receive a webhook notification when specific files in your Git repository are modified.

You will now be presented with the webhook configuration details that you need to copy/paste to your GitHub repository. Once you complete this step, the GitOps pipeline will be configured to receive webhook notifications whenever the repository is updated in Git.


Setup GitHub Webhook


Activate Pipeline

By default, newly created pipelines start life in a deactivated state.


Step 5: Initial Sync

We will manually run the pipeline in order to sync the existing system resources to the GitHub repository. Note, only the resources that were included in the pipeline stage will be synced. In this case, only cluster resources will be synced.

We can see that a project folder has been created in the Git repository by the pipeline.


Recap

In this part, you successfully configured a GitOps pipeline to enable System Sync between the system and your Git repository. You are now ready to move to subsequent parts of the exercise to start testing System Sync with AKS clusters.