Skip to content

Commit 9c2d242

Browse files
merge
Signed-off-by: James Milligan <[email protected]>
2 parents 60ea1ab + df8059f commit 9c2d242

File tree

6 files changed

+160
-6
lines changed

6 files changed

+160
-6
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.20"
2+
".": "0.2.21"
33
}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## [0.2.21](https://github.com/open-feature/open-feature-operator/compare/v0.2.20...v0.2.21) (2022-12-16)
4+
5+
6+
### Features
7+
8+
* add ff shortname, commit httpSyncConfiguration ([11e4652](https://github.com/open-feature/open-feature-operator/commit/11e46528fcd06cdc0c8e6f46944656224cd97441))
9+
* introduce configurable resource limits for flagd sidecar ([e4affcf](https://github.com/open-feature/open-feature-operator/commit/e4affcfb0ccf13dc0406ef1c21c2b884a836f71f))
10+
11+
12+
### Bug Fixes
13+
14+
* **deps:** update github.com/open-feature/schemas digest to 302d0fa ([#246](https://github.com/open-feature/open-feature-operator/issues/246)) ([7d22374](https://github.com/open-feature/open-feature-operator/commit/7d22374afb7a5e2e166550544d327ec7b5b3d1bf))
15+
* **deps:** update kubernetes packages to v0.25.4 ([75bab2d](https://github.com/open-feature/open-feature-operator/commit/75bab2d441c945d51f17f0d32195a217072c3c15))
16+
* include release tag in helm charts publishing ([2746716](https://github.com/open-feature/open-feature-operator/commit/27467164dcd05b0220e0857bf79e42d62e7a40a9))
17+
318
## [0.2.20](https://github.com/open-feature/open-feature-operator/compare/v0.2.19...v0.2.20) (2022-11-18)
419

520

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ IMG ?= controller:latest
55
KUSTOMIZE_OVERLAY ?= DEFAULT
66
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
77
FLAGD_VERSION=v0.2.7
8-
CHART_VERSION=v0.2.20# x-release-please-version
8+
CHART_VERSION=v0.2.21# x-release-please-version
99
ENVTEST_K8S_VERSION = 1.25
1010

1111
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)

README.md

Lines changed: 141 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,144 @@ Thanks so much to our contributors.
2929
<img src="https://contrib.rocks/image?repo=open-feature/open-feature-operator" />
3030
</a>
3131

32-
Made with [contrib.rocks](https://contrib.rocks).
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.

chart/open-feature-operator/Chart.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ version: "v0.2.20" # x-release-please-version
1818
# incremented each time you make changes to the application. Versions are not expected to
1919
# follow Semantic Versioning. They should reflect the version the application is using.
2020
# It is recommended to use it with quotes.
21-
appVersion: "v0.2.20" # x-release-please-version
22-
icon: https://avatars.githubusercontent.com/u/99483952?s=200&v=4
21+
appVersion: "v0.2.21" # x-release-please-version

chart/open-feature-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ controllerManager:
1616
manager:
1717
image:
1818
repository: ghcr.io/open-feature/open-feature-operator
19-
tag: v0.2.20 # x-release-please-version
19+
tag: v0.2.21 # x-release-please-version
2020
resources:
2121
limits:
2222
cpu: 500m

0 commit comments

Comments
 (0)