Learn KOP - Part 2 - Sync OPA Resources - Rafay Product Documentation

Part 2: Apply

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

What Will You Do

In part 2, you will create a custom blueprint that contains one of the turnkey OPA Gatekeeper policies and apply the blueprint to a cluster.

Step 1: Create Blueprint

First, we will create a custom cluster blueprint which will enable OPA Gatekeeper and contain one of the newly created custom OPA policies.

Next, we will need to create a version for the blueprint.

Step 2: Apply Blueprint

We will now apply the custom blueprint to the cluster to enable OPA Gatekeeper and the "bp-operational-efficiency" policy

You will now see the blueprint being applied to the cluster

Step 3: Verify OPA Gatekeeper Resources

Now, we will verify that OPA Gatekeeper is running on the cluster with the constraints in our OPA policy

kubectl get pods -n rafay-system

You will see the "gatekeeper" pods running

kubectl get constraints

You will see all of the OPA contraints currently being enforced on the cluster. This list will contain the contraints in the applied OPA policy.

Recap

In this part, you applied a turnkey OPA policy to a cluster using a custom cluster blueprint. You then validated OPA gatekeeper was running and the OPA policy contraints were active on the cluster using Kubectl.