Skip to main content

Bundles

Similar to OPA, Bundles in Styra Load are the main mechanism for providing policies and data to a Load instance.

In order to make Load more performant for large data sets, the Bundle format used in Styra Load is different from that which is used in OPA. The Load format is based on a binary JSON representation of data which allows Load to process queries using less memory. Load has built in functionality to convert OPA Bundles to the Load Bundle format.

Converting an existing OPA Bundle

If you already have an OPA Bundle, you can convert it to the Load Bundle format using the load bundle convert command. For example, if the OPA Bundle is named bundle.tar.gz:

$ load bundle convert bundle.tar.gz bundle-load.tar.gz

The new archive: bundle-load.tar.gz will contain the same bundle data but in a format suitable for Load to use.

Creating a new Load Bundle

To create a new Load Bundle from a local directory, first use Load to create an OPA Bundle and then convert it to the Load format:

$ ls bundle/
example.rego

$ cat bundle/example.rego
package example

allow := true

$ load build -b bundle/

$ tar tzf bundle.tar.gz
/data.json
/foo/example.rego

$ load bundle convert bundle.tar.gz bundle-load.tar.gz

Bundle Service API with Load Bundles

Other than the difference in the bundle format outlined above, Load handles bundles in the same way as OPA. Using the same configuration options as OPA, Load can be configured to download Load bundles using the Bundle Service API.

note

It's not possible to use the Load Bundle format for Discovery Bundles at this time.

Further reading: