Chapter 6. MagTape and Kubernetes
In this chapter, I am going to focus on MagTape, an OSS PaC project, originally from T-Mobile, that is underpinned by OPA and Rego. MagTape wraps and extends OPA. In the context of design patterns, MagTape applies the Decorator design pattern to give additional functionality to OPA without changing the underlying OPA implementation.
The purpose of MagTape’s extensions is to add business workflows, including a notification layer that integrates to Slack via webhooks. As a decorator or a wrapper of OPA, MagTape operates between the Kubernetes API server and the OPA service, like a proxy. MagTape configures a layer of indirection using init containers for OPA service integration.
According to the project insights, most of the contributions to the MagTape project were made in 2020. There were also some in 2021 and 2022, but the project doesn’t seem to be too active. This is further evidenced by the relatively older versions of OPA and kube-mgmt that the MagTape install is currently set to use. That being said, I included MagTape in this book to expose some interesting ideas and best practices for using OPA in Kubernetes. So let’s get started by exploring how MagTape is installed and configured.
Installing and Uninstalling MagTape
MagTape is easy to install and uninstall via the following install YAML file:
# Download install YAML $ curl -O \ https://raw.githubusercontent.com/tmobile/magtape/v2.4.0/deploy/install.yaml
Although instructions for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access