Learn KOP - Part 1 - Setup - Rafay Product Documentation

Part 1: Setup

This is Part 1 of a multi-part, self-paced quick start exercise.


What Will You Do

In part 1, you will perform a one-time configuration of resources to enable System Sync to communicate with a Git repository. You will use System Sync to create OPA resources in your project from the turnkey policies defined in the Git repository.


Step 1: Create GitOps Agent

We must first create a GitOps Agent that will allow the System Sync pipeline to access our Git repository.

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: Fork Git Repo

Declarative specification files for the turnkey OPA resources are available in a Git repository

To get started, let us fork an existing repository.


Step 3: Add Repository

Note

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

Optionally,


Step 4: GitOps 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 from the console.

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.


Webhook in GitHub


Activate Pipeline

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


Step 5: Create OPA Resources

In this step, we will update the OPA spec files as needed in the Git repository, commit the change and then witness the OPA resources being created automatically in the system.

### This is a comment

The commit will trigger the GitOps pipeline and it will automatically create the OPA resources defined in the Git repository.

Once the pipeline job has completed, we can view the OPA policies that were created. You should see five new "Custom" policies.

Recap

In this part, you successfully configured a GitOps pipeline with Sytem Sync to create the turnkey OPA resources. You are now ready to move to subsequent parts of the exercise to use the OPA policies in blueprints and test the OPA constraints on your cluster.