https://github.com/open-feature/watchman
A Kubernetes admission controller driven by open-feature
https://github.com/open-feature/watchman
Last synced: about 1 year ago
JSON representation
A Kubernetes admission controller driven by open-feature
- Host: GitHub
- URL: https://github.com/open-feature/watchman
- Owner: open-feature
- License: mit
- Created: 2022-08-07T17:07:44.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T16:19:25.000Z (over 3 years ago)
- Last Synced: 2025-03-28T15:46:06.341Z (over 1 year ago)
- Language: Go
- Homepage: https://openfeature.dev
- Size: 2.42 MB
- Stars: 14
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# watchman





A general purpose admission controller that uses open-feature to control it's capabilities.
This is a demonstration project that is designed to familiarise the user with how open-feature can be used within Kubernetes to control infrastructure.
This project demonstrates:
- [open-feature golang SDK](https://github.com/open-feature/golang-sdk)
- [flagD](https://github.com/open-feature/flagd)
- [open-feature operator](https://github.com/open-feature/open-feature-operator)
_But how does it work?_

## Run the demo
- Setup a Kubernetes cluster
- Install open-feature-operator as described [here](https://github.com/open-feature/open-feature-operator#deploy-the-latest-release)
- `kubectl create namespace watchman-system`
- `kubectl create -f config/samples/flags.yaml`
- `kubectl create -f config/webhook/certificate.yaml`
- `IMG=cnskunkworks/watchman:0.0.3 make deploy`
You should see that you have watchman injected with flagd.

This now means you can turn on or off pod admission with the watchman `FeatureFlagConfiguration` custom resource named `watchman-flags/watchman-system`

The end result should be that you can turn on or off the admission controller with the `FeatureFlagConfiguration` custom resource.
```
❯ kubectl apply -f config/samples/pod.yaml
Error from server (flag set to block admission): error when creating "config/samples/pod.yaml": admission webhook "mutate-demo.openfeature.dev" denied the request: flag set to block admission
```