-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mauricio Salatino
committed
May 4, 2023
1 parent
496d757
commit 1a2f95a
Showing
13 changed files
with
986 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_EXPERIMENTAL_DAGGER_RUNNER_HOST=kube-pod://<podname>?context=<context>&namespace=<namespace>&container=<container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: dagger | ||
spec: | ||
containers: | ||
- name: dagger | ||
image: registry.dagger.io/engine:v0.3.13 | ||
securityContext: | ||
privileged: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Openfeature for Feature Flagging | ||
|
||
On this tutorial we will be writing a small application that consume feature flags that are managed by OpenFeature, a CNCF initiative for feature flags backed up by multiple vendors. | ||
|
||
## Installation | ||
|
||
Based on the documentation that you can find in github | ||
https://github.com/open-feature/open-feature-operator/blob/main/docs/installation.md | ||
|
||
|
||
Prerequisites (CertManager): | ||
``` | ||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.yaml | ||
kubectl wait --for=condition=Available=True deploy --all -n 'cert-manager' | ||
``` | ||
|
||
Installing the OpenFeature K8s Operator with Helm: | ||
|
||
``` | ||
helm repo add openfeature https://open-feature.github.io/open-feature-operator/ | ||
helm repo update | ||
helm upgrade --install openfeature openfeature/open-feature-operator | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# A basic flag custom resource | ||
apiVersion: core.openfeature.dev/v1alpha2 | ||
kind: FeatureFlagConfiguration | ||
metadata: | ||
name: end-to-end | ||
labels: | ||
app: open-feature-demo | ||
spec: | ||
featureFlagSpec: | ||
flags: | ||
new-welcome-message: | ||
state: ENABLED | ||
variants: | ||
'on': true | ||
'off': false | ||
defaultVariant: 'off' | ||
hex-color: | ||
variants: | ||
red: c05543 | ||
green: 2f5230 | ||
blue: 0d507b | ||
defaultVariant: blue | ||
state: ENABLED | ||
fib-algo: | ||
variants: | ||
recursive: recursive | ||
memo: memo | ||
loop: loop | ||
binet: binet | ||
defaultVariant: recursive | ||
state: ENABLED | ||
targeting: | ||
if: | ||
- in: | ||
- "@faas.com" | ||
- var: | ||
- binet | ||
- null | ||
use-remote-fib-service: | ||
state: ENABLED | ||
variants: | ||
'on': true | ||
'off': false | ||
defaultVariant: 'off' | ||
--- | ||
# Deployment of a demo-app using our custom resource | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: open-feature-demo-deployment | ||
labels: | ||
app: open-feature-demo | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: open-feature-demo | ||
template: | ||
metadata: | ||
labels: | ||
app: open-feature-demo | ||
annotations: | ||
openfeature.dev/enabled: "true" | ||
openfeature.dev/featureflagconfiguration: "end-to-end" | ||
spec: | ||
containers: | ||
- name: open-feature-demo | ||
image: ghcr.io/open-feature/playground-app:v0.6.3 # x-release-please-version | ||
args: | ||
- flagd | ||
ports: | ||
- containerPort: 30000 | ||
|
||
--- | ||
# Service exposed using NodePort | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: open-feature-demo-service | ||
labels: | ||
app: open-feature-demo | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: open-feature-demo | ||
ports: | ||
# By default and for convenience, the `targetPort` is set to the same value as the `port` field. | ||
- port: 30000 | ||
targetPort: 30000 | ||
nodePort: 30000 |
Oops, something went wrong.