A bundle is how OPA ships policy and data as one artifact. The engine was built for sidecars and daemons in cloud-native setups, so distribution, updates, and observability show up early — not as an afterthought.
Bundles cover:
- Central config for policy + data
- Hot(ish) policy refresh without redeploying every consumer
- Health, metrics, and decision logs from many OPA instances
With Rego on top, that’s what makes OPA feel like a general policy layer instead of a one-off authz library.
Below: bundle layout, server APIs, remote bundle config, embedding options, and metrics. There’s a docker-compose demo in the koans repo—run it locally once you’ve skimmed the sections.
Bundle是OPA管理policy和data的一种方式。
OPA实现的轻量级策略引擎,一开始就是为了云原生环境的service提供解耦的策略服务,分布式是必然要考虑的问题。
在Bundle api的设计中,其实就全面考虑并体现了在分布式应用中如何更好的解耦策略引擎的管理。
比如:
- 如何做集中配置管理
- 如何动态更新策略
- 如何监控策略引擎节点的状态以及决策日志收集
有了这些功能,再加上其高效的策略描述语言Rego,OPA才真正称得上是云原生时代的通用策略引擎。
本文将带大家简单梳理一遍Bundle的组织方式、管理api、及监控方式。
考虑到一次性过完不易消化,文末会提供一个直接可实操的docker-compose版本的demo,将全面覆盖本文细节
建议大家看完本文,本机运行去体验一下,会有更直观的理解。
Read More
Read More