Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how plugin can be used with vendored and GOPATH OPA dependency. #94

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ IP/port of the Istio Ingress gateway.
curl --user bob:password -i http://$GATEWAY_URL/api/v1/products
```

## How to use the OPA-Istio plugin

### Option 1: Using `vendored` OPA dependency
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a scenario where this option makes sense? I'm wondering if we should only recommend (1) running the opa_istio binary/container produced by the makefile or (2) building the .so file with the GOPATH option and then running with either (i) upstream OPA (of the correct version) or (ii) a custom OPA executable.


In this option, the shared object file `opa_istio_plugin.so` generated by running `make build-plugin` can only be loaded using the `opa_istio` binary generated by running `make build`.

Step-by-step instructions to use this option can be found [here](./docs/plugin_vendor.md).

### Option 2: Using `GOPATH` OPA dependency

In this option, the shared object file `opa_istio_plugin.so` generated by running `make build-plugin` can be loaded by a OPA binary built from source by cloning the OPA repo.

Step-by-step instructions to use this option can be found [here](./docs/plugin.md).

## Configuration

To deploy OPA-Istio include the following container in your Kubernetes Deployments:
Expand Down
2 changes: 1 addition & 1 deletion docs/plugin.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Instructions to build the OPA-Istio plugin as a Go plugin:
## Instructions to load the OPA-Istio plugin using `GOPATH` OPA:

1. Clone OPA in your `GOPATH`.

Expand Down
28 changes: 28 additions & 0 deletions docs/plugin_vendor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Instructions to load the OPA-Istio plugin using `vendored` OPA:

1. Build the OPA-Istio binary.

```bash
make build
```

2. Build the OPA-Istio plugin.

```bash
make build-plugin
```

3. Create a configuration file.

```yaml
plugins:
envoy.ext_authz.grpc:
addr: :9191
query: data.istio.authz.allow
```

4. Run OPA-Istio

```bash
opa_istio --plugin-dir=. run --server --config-file=config.yaml
```