open-feature-operator

build goversion version status

The open-feature-operator is a Kubernetes native operator that allows you to expose feature flags to your applications. It injects a flagd sidecar into your pod and allows you to poll the flagd server for feature flags in a variety of ways.

Architecture

As per the issue here High level architecture is as follows:

Example

When wishing to leverage featureflagging within the local pod, the following steps are required:

  1. Create a new feature flag custom resource e.g.

apiVersion: core.openfeature.dev/v1alpha1
kind: FeatureFlagConfiguration
metadata:
  name: featureflagconfiguration-sample
spec:
  featureFlagSpec: |
    {
      "foo" : "bar"
    } 
  1. Reference the CR within the pod spec annotations

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  annotations:
    openfeature.dev: "enabled"
    openfeature.dev/featureflagconfiguration: "featureflagconfiguration-sample"
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
    ports:
    - containerPort: 80
  1. Example usage from host container

[email protected]:/# curl localhost:8080
{
  "foo" : "bar"
} 

Running the operator locally

  1. Create a local cluster with MicroK8s or Kind
  2. kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml
  3. IMG=ghcr.io/open-feature/open-feature-operator:main make deploy

GitHub

View Github