Skip to content
Merged
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
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,33 @@ The following environment variables are supported:

| Variable | Required | Description |
| --- | --- | --- |
| `EXTERNAL_API_URL` | **Yes** | Target HTTP/HTTPS endpoint that receives `POST` JSON payloads. |
| `EXTERNAL_API_URL` | No* | Target HTTP/HTTPS endpoint that receives `POST` JSON payloads. |
| `EXTERNAL_API_TOKEN` | No | Optional Bearer token sent in the `Authorization: Bearer <token>` header. |

These should be mounted from a Secret source on the namespace.
> **NOTE**: one of `--api-url` flag or `EXTERNAL_API_URL` environment variable
> are required.

These should be mounted from a Secret source on the namespace, e.g.:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: prober-config
namespace: prober-system
type: Opaque
stringData:
EXTERNAL_API_TOKEN: 'my-secret-token'
EXTERNAL_API_URL: 'https://webhooks.example.com'
```

### CLI Flags

The following CLI flags can be passed to the binary:

| Flag | Default | Description |
| --- | --- | --- |
| `--api-url` | `""` | External endpoint URL to deliver payloads to. |
| `--leader-elect` | `false` | Enable leader election for high-availability multi-replica deployments. |
| `--metrics-bind-address` | `:8080` | Address the Prometheus metrics endpoint binds to. |
| `--health-probe-bind-address` | `:8081` | Address the `/healthz` and `/readyz` endpoints bind to. |
Expand Down
9 changes: 0 additions & 9 deletions deploy/manifests/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,3 @@ spec:
readOnlyRootFilesystem: true
capabilities:
drop: ['ALL']
---
apiVersion: v1
kind: Secret
metadata:
name: prober-config
namespace: prober-system
type: Opaque
stringData:
EXTERNAL_API_TOKEN: 'my-secret-token'
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ func main() {
}

ctrl.SetLogger(zap.New(zap.UseDevMode(true)))

if apiURL == "" {
apiURL = os.Getenv("EXTERNAL_API_URL")
}
if apiURL == "" {
setupLog.Error(nil, "missing required --api-url flag or EXTERNAL_API_URL environment variable")
flag.Usage()
os.Exit(2)
}

setupLog.Info("initializing the controller", "version", version)

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Expand All @@ -66,6 +76,7 @@ func main() {
}

apiToken := os.Getenv("EXTERNAL_API_TOKEN")

// Register the HTTPRouteWatcher reconciler
if err = (&controllers.HTTPRouteWatcher{
Client: mgr.GetClient(),
Expand Down
Loading