Skip to content

Commit 8bf9e42

Browse files
chore: migration docs (#571)
Signed-off-by: Kavindu Dodanduwa <[email protected]>
1 parent f239a25 commit 8bf9e42

File tree

6 files changed

+83
-9
lines changed

6 files changed

+83
-9
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212

1313
## Get started
1414

15-
The OpenFeature Operator allows you to expose feature flags to your applications. It injects a [flagD](https://github.com/open-feature/flagd) sidecar into relevant pods exposes gRPC and HTTP interfaces for flag evaluation. To get started, follow the installation instructions in the [docs](./docs).
15+
The OpenFeature Operator allows you to expose feature flags to your applications.
16+
It injects a [flagd](https://github.com/open-feature/flagd) sidecar into relevant pods and exposes gRPC and HTTP interfaces for flag evaluation.
17+
To get started, follow the installation instructions in the [docs](./docs).
18+
19+
> [!NOTE]
20+
> With version [v0.5.0](https://github.com/open-feature/open-feature-operator/releases/tag/v0.5.0), we have migrated
21+
> to API version `v1beta1`. Please check the [migration guide](./docs/v1beta_migration.md) to migrate from old configurations.
1622
1723
<h2 align="center"><a href="https://killercoda.com/open-feature/scenario/openfeature-operator-demo" target="_blank">Try the OpenFeature Operator in the Killercoda Playground (in browser)</a></h2>
1824

config/samples/pod.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ kind: Pod
33
metadata:
44
name: nginx
55
annotations:
6+
# enable flagd injection for this workload
67
openfeature.dev/enabled: "true"
7-
openfeature.dev/featureflagconfiguration: "featureflagconfiguration-sample"
8+
# flag source configuration(FeatureFlagSource) crd reference. See end-to-end.yaml for example
9+
openfeature.dev/featureflagsource: "FeatureFlagSource"
810
spec:
911
containers:
10-
- name: nginx
11-
image: nginx:1.14.2
12-
ports:
13-
- containerPort: 80
12+
- name: nginx
13+
image: nginx:1.14.2
14+
ports:
15+
- containerPort: 80

docs/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Documentation
22

3+
> [!NOTE]
4+
> With version [v0.5.0](https://github.com/open-feature/open-feature-operator/releases/tag/v0.5.0), we have migrated
5+
> to API version `v1beta1`. Please check the [migration guide](./v1beta_migration.md) to migrate from old configurations.
6+
37
This directory contains OpenFeature Operator documentation.
48

59
Interested in having OpenFeature Operator up and running within 5 minutes? Follow the quick start guide found below.

docs/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The installation docs for cert manager can be found [here](https://cert-manager.
77
Alternatively, running the commands below will install cert manager into the `cert-manager` namespace.
88

99
```sh
10-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml &&
10+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml &&
1111
kubectl wait --for=condition=Available=True deploy --all -n 'cert-manager'
1212
```
1313

docs/quick_start.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ kind create cluster -n kind
1818
#### 2. Install cert-manager
1919

2020
```sh
21-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml &&
21+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml &&
2222
kubectl wait --for=condition=Available=True deploy --all -n 'cert-manager'
2323
```
2424

@@ -66,7 +66,7 @@ kind: FeatureFlag
6666
metadata:
6767
name: sample-flags
6868
spec:
69-
featureFlagSpec:
69+
flagSpec:
7070
flags:
7171
foo:
7272
state: "ENABLED"

docs/v1beta_migration.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Migrate to v1beta1
2+
3+
OpenFeature Operator version [v0.5.0](https://github.com/open-feature/open-feature-operator/releases/tag/v0.5.0) contain improved, stable CRDs which were upgraded to `v1beta1` api version.
4+
This document shows what was changed and how you can upgrade your existing CRDs to be compatible with this new release.
5+
6+
## Renaming FeatureFlagConfiguration to FeatureFlag
7+
8+
Along with the API version upgrade to `v1beta1`, we have renamed `FeatureFlagConfiguration` to `FeatureFlag`, making the naming clearer for the custom resource maintainers.
9+
In this CRD, spec section naming has changed. The older CRD used `featureFlagSpec` to define flag configurations.
10+
In the new version, flags are configured under `flagSpec` element.
11+
12+
Consider below example with diff from old version to new version,
13+
14+
```diff
15+
- apiVersion: core.openfeature.dev/v1alpha3
16+
+ apiVersion: core.openfeature.dev/v1beta1
17+
kind: FeatureFlagConfiguration
18+
metadata:
19+
name: end-to-end
20+
labels:
21+
app: open-feature-demo
22+
spec:
23+
- featureFlagSpec:
24+
+ flagSpec
25+
flags:
26+
new-welcome-message:
27+
state: ENABLED
28+
variants:
29+
'on': true
30+
'off': false
31+
defaultVariant: 'off'
32+
```
33+
34+
## openfeature.dev annotations
35+
36+
There are several [annotations](./annotations.md) to control how OFO works on your workload.
37+
38+
With the upgrade to `v1beta1`, we no longer support deprecated `openfeature.dev/featureflagconfiguration` annotation.
39+
Workloads which require feature flagging now need to use `openfeature.dev/featureflagsource` annotation, referring a [FeatureFlagSource](./feature_flag_source.md) CRD.
40+
41+
```diff
42+
annotations:
43+
openfeature.dev/enabled: "true"
44+
- openfeature.dev/featureflagconfiguration: "end-to-end"
45+
+ openfeature.dev/featureflagsource: "end-to-end"
46+
```
47+
48+
`FeatureFlagSource` provide more flexibility by allowing users to configure the injected flag with many options.
49+
Consider below example for a `FeatureFlagSource` where flagd is instructed to use `FeatureFlag` custom resource named `end-to-end` as its flag source
50+
51+
```yaml
52+
apiVersion: core.openfeature.dev/v1beta1
53+
kind: FeatureFlagSource
54+
metadata:
55+
name: end-to-end
56+
labels:
57+
app: open-feature-demo
58+
spec:
59+
sources:
60+
- source: end-to-end
61+
provider: kubernetes
62+
```

0 commit comments

Comments
 (0)