Deploying OPA in Kubernetes with a PersistentVolume and multiple Pods (or even a HPA) #555
Replies: 6 comments 8 replies
-
Generally we see users distributing data to OPA in an eventually consistent manner using the bundle service API. This is generally the most simple and robust option. Is there a reason that eventually consistent updates for data won't work for you? |
Beta Was this translation helpful? Give feedback.
-
I’m curious if you have tried Gatekeeper (multiple pod deployment of opa in k8s) and the external data feature for your data? https://open-policy-agent.github.io/gatekeeper/website/docs/externaldata |
Beta Was this translation helpful? Give feedback.
-
Sorry for replying late, i seems that my team used a Bundle API in the past and we switched to a push mode (as opposed to a mode where OPA pulls the bundle) for performance/speed issues as there was a significant delay (a few seconds) between the bundle publication and its pull by OPA. Another option I imagine is to push data to multiple instances synchronously but it does not look like the official way to go (that's what we do today but on a single instance/Pod) |
Beta Was this translation helpful? Give feedback.
-
I am wondering if there could be a way to have the best of push and pull worlds and have some kind of trigger system to update bundle in all pods when the remote bundle is updated? We will continue looking into that but we still do not have any satisfying solution for now (except the single replica OPA with local data) |
Beta Was this translation helpful? Give feedback.
-
OPA can download bundles periodically or when manually triggered. The later however is only available when using OPA as a Go package atm. On the former have y'all tried a combination of long polling plus shorter pull frequency? |
Beta Was this translation helpful? Give feedback.
-
Are there already thoughts on or a POC of using Kubernetes upcoming native support for "Read Only Volumes Based On OCI Artifacts" for delivering OPA policies? => OPA policies look to me like a perfect usecase for this new feature. edit: the container runtime used also needs support for this.
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I am looking for information about deploying OPA in Kubernetes with a failure. (and update)-tolerant deployment.
For now we are using OPA in a deployment which looks like the official one: https://www.openpolicyagent.org/docs/latest/deployments/#kicking-the-tires
The issue is that we write data to OPA and evaluate policies which means that our OPA instance has dynamic data which must be shared between all OPA instances.
For now we use only one replica as documented but this is not failure-tolerant and adding more replicas cannot work as OPA does not seem to support a shared storage (with transactions or locks to allow a consistant update of the storage by multiple instances).
Is there a way to have a failure-tolerant deployment of OPA in Kubernetes (i.e. a shared storage and more than one Pod)?
Beta Was this translation helpful? Give feedback.
All reactions