Skip to content

Commit 6d03051

Browse files
merge fix
Signed-off-by: James Milligan <[email protected]>
1 parent 9c2d242 commit 6d03051

File tree

1 file changed

+0
-142
lines changed

1 file changed

+0
-142
lines changed

README.md

Lines changed: 0 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -28,145 +28,3 @@ Thanks so much to our contributors.
2828
<a href="https://github.com/open-feature/flagd/graphs/contributors">
2929
<img src="https://contrib.rocks/image?repo=open-feature/open-feature-operator" />
3030
</a>
31-
32-
<!---x-release-please-start-version-->
33-
34-
```
35-
kubectl create namespace open-feature-operator-system
36-
kubectl apply -f https://github.com/open-feature/open-feature-operator/releases/download/v0.2.21/release.yaml
37-
```
38-
39-
<!---x-release-please-end-->
40-
41-
42-
### Release contents
43-
44-
- `release.yaml` contains the configuration of:
45-
- `FeatureFlagConfiguration` `CustomResourceDefinition` (custom type that holds the configured state of feature flags).
46-
- Standard kubernetes primitives (e.g. namespace, accounts, roles, bindings, configmaps).
47-
- Operator controller manager service.
48-
- Operator webhook service.
49-
- Deployment with containers kube-rbac-proxy & manager.
50-
- `MutatingWebhookConfiguration` (configures webhooks to call the webhook service).
51-
52-
### How to deploy a flag consuming application
53-
54-
_Prerequisite: the release and certificates have been deployed as outlined above._
55-
56-
Deploying a flag consuming application requires (at minimum) the creation of the following 2 resources (an example can be found [here](./config/samples/end-to-end.yaml)):
57-
58-
#### FeatureFlagConfiguration
59-
60-
This is a `CustomResourceDefinition` which contains the feature flags specification and a name of the spec.
61-
62-
#### Deployment (or Statefulset/Daemonset)
63-
64-
This is a kubernetes primitive for deploying an application. The metadata annotations must include `openfeature.dev/featureflagconfiguration`
65-
with the value set as the name of the `FeatureFlagConfiguration` created in the step prior.
66-
67-
e.g.
68-
```
69-
metadata:
70-
annotations:
71-
openfeature.dev/featureflagconfiguration: "demo"
72-
```
73-
74-
## Architecture
75-
76-
As per the issue [here](https://github.com/open-feature/ofep/issues/1)
77-
78-
As per v0.1.1, the default sync provider has been optimized as per this OpenFeature Enhancement Proposal [issue](https://github.com/open-feature/ofep/blob/main/004-OFEP-kubernetes-sync-service.md).
79-
80-
High level architecture is as follows:
81-
82-
<img src="images/arch-0.png" width="700">
83-
84-
### Requirements
85-
86-
#### Namespace
87-
88-
The Kubernetes resources created by OpenFeature Operator are under the `open-feature-operator-system` namespace. This means
89-
any resources that want to communicate with the OFO system (e.g. an application calling flag evaluations) must fall under
90-
this namespace.
91-
92-
#### Cert Manager
93-
94-
OpenFeature Operator is a server that communicates with Kubernetes components within the cluster, as such it requires a means of
95-
authorizing requests between peers. [Cert manager](https://cert-manager.io/) handles the authorization by
96-
adding certificates and certificate issuers as resource types in Kubernetes clusters, and simplifies the process of
97-
obtaining, renewing and using those certificates.
98-
99-
## Example
100-
101-
When wishing to leverage feature flagging within the local pod, the following steps are required:
102-
103-
1. Create a new feature flag custom resource.
104-
105-
_See [here](config/samples/crds/custom_provider.yaml) for additional custom resource parameters_
106-
107-
```
108-
apiVersion: core.openfeature.dev/v1alpha2
109-
kind: FeatureFlagConfiguration
110-
metadata:
111-
name: featureflagconfiguration-sample
112-
spec:
113-
featureFlagSpec:
114-
flags:
115-
foo:
116-
state: "ENABLED"
117-
variants:
118-
"bar": "BAR"
119-
"baz": "BAZ"
120-
defaultVariant: "bar",
121-
targeting: {}
122-
```
123-
124-
1. Reference the CR within the pod spec annotations
125-
The `openfeature.dev/featureflagconfiguration` annotation is a comma separated list of CR references, listed as `{namespace}/{name}`. e.g. `"default/featureflagconfiguration-sample, test/featureflagconfiguration-sample-2"`. If no namespace is defined, it is assumed that the flag configuration is in the same namespace as the deployed pod.
126-
127-
```
128-
apiVersion: v1
129-
kind: Pod
130-
metadata:
131-
name: nginx
132-
annotations:
133-
openfeature.dev/enabled: "true"
134-
openfeature.dev/featureflagconfiguration: "default/featureflagconfiguration-sample"
135-
spec:
136-
containers:
137-
- name: nginx
138-
image: nginx:1.14.2
139-
ports:
140-
- containerPort: 80
141-
```
142-
143-
3. Example usage from host container
144-
145-
```
146-
root@nginx:/# curl -X POST "localhost:8013/schema.v1.Service/ResolveString" -d '{"flagKey":"foo","context":{}}' -H "Content-Type: application/json"
147-
{"value":"BAR","reason":"DEFAULT","variant":"bar"}
148-
```
149-
150-
### Running the operator locally
151-
152-
#### Create a local cluster with cert manager and our operator
153-
154-
1. Create a local cluster with MicroK8s or Kind (forward requests from your localhost:30000 to your cluster, see MicroK8s/Kind doc)
155-
1. `IMG=ghcr.io/open-feature/open-feature-operator:main make deploy-operator`
156-
157-
#### Run the example
158-
159-
1. Apply the end-to-end example: `kubectl apply -f config/samples/end-to-end.yaml`
160-
1. Visit `http://localhost:30000/`
161-
1. Update the value of the `defaultVariant` field in the custom resource instance in `config/samples/end-to-end.yaml` and re-apply to update the flag value!
162-
1. Visit `http://localhost:30000/` and see the change!
163-
164-
## Testing
165-
166-
Run `make test` to run the test suite. The controller integration tests use [envtest](https://book.kubebuilder.io/reference/envtest.html), this sets up and starts an instance of etcd and the Kubernetes API server, without kubelet, controller-manager or other components.
167-
This provides means of asserting that the Kubernetes components reach the desired state without the overhead of using an actual cluster, keeping
168-
test runtime and resource consumption down.
169-
170-
## Releases
171-
172-
This repo uses _Release Please_ to release packages. Release Please sets up a running PR that tracks all changes for the library components, and maintains the versions according to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), generated when [PRs are merged](https://github.com/amannn/action-semantic-pull-request). When Release Please's running PR is merged, any changed artifacts are published.

0 commit comments

Comments
 (0)