{"id":20607722,"url":"https://github.com/open-feature/cloud-native-demo","last_synced_at":"2025-03-06T17:25:45.366Z","repository":{"id":171171981,"uuid":"626662776","full_name":"open-feature/cloud-native-demo","owner":"open-feature","description":"A cloud-native feature flag demo, featuring multiple providers, telemetry, and a guided tour","archived":false,"fork":false,"pushed_at":"2024-08-16T18:24:03.000Z","size":1142,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-17T02:47:11.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://openfeature.dev","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-feature.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-11T23:23:42.000Z","updated_at":"2023-05-31T07:13:54.000Z","dependencies_parsed_at":"2023-12-15T06:39:10.185Z","dependency_job_id":null,"html_url":"https://github.com/open-feature/cloud-native-demo","commit_stats":null,"previous_names":["open-feature/cloud-native-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcloud-native-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcloud-native-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcloud-native-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcloud-native-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-feature","download_url":"https://codeload.github.com/open-feature/cloud-native-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242252510,"owners_count":20097217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T10:08:26.411Z","updated_at":"2025-03-06T17:25:45.320Z","avatar_url":"https://github.com/open-feature.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFeature ArgoCD Demo\n\nThis demo showcases how the OpenFeature Operator allows to integrate with ArgoCD to control feature flags \nin a GitOps environment. Using the `FeatureFlagConfiguration` and `FlagSourceConfiguration` CRDs which live in the application's GitOps \nreppository, features can be enabled/disabled by creating a pull request for the GitOps repository. Once a PR has been merged,\nArgoCD will pick up that change and automatically apply the updated configuration. \nChanges for a feature flag will be immediately reflected in the demo application, without the need to restart the pod running the application.\nThis is enabled by a Grpc event stream between the application and the flagd instance injected by the OpenFeature Operator. This event stream will\nnotify the application about any changes that have been made to a feature flag.\n\n*Note:* Until https://github.com/open-feature/open-feature-operator/issues/371 has been implemented in the OpenFeature Operator, the  event stream based\nclient-side feature flagging is enabled by an nginx container within the pod running the application. This container can be accessed via a `flagd-service` Kubernetes service\nand will proxy all flagd requests to the flagd container injected by the OpenFeature Operator.\n\n## Setting up the Demo\n\nTo setup the demo, you must be connected to a K8s cluster (this demo has been tested on Kubernetes version `v1.25.6`).\nTo install everything, use the following command:\n\n```shell\nmake install-environment GITOPS_REPO=\"\u003cgitops repo url\u003e\"\n```\n\nThis will install everything you need to deploy the demo application. The installed components are:\n\n1. *Cert-manager:* Required by the OpenFeature Operator\n1. *OpenFeature Operator*: Will inject the flagd sidecar into the application's pod\n1. *ArgoCD:* Will watch the GitOps repository and apply any changes once they have been merged into the main branch\n\nIn addition to deploying these three components, an ArgoCD `Application` will be created. This will ensure that ArgoCD is \nwatching the GitOps repo you specify using the `GITOPS_REPO` parameter for the `make install-environment` command.\n\nYou can afterwards also login to ArgoCD to check if the Application has been created and view its sync status:\n\n1. Create a port-forward to the `argocd-server`. This can be done using: \n\n```shell\nmake port-forward-argo\n```\n\nRunning this command will make ArgoCD accessibla via [http://localhost:8081](http://localhost:8081). When accessing ArgoCD, you will be prompted to enter your credentials.\nThose are auto generated when ArgoCD is installed, and can be retrieved using the `argocd` CLI, using the following command:\n\n```\nargocd admin initial-password -n argocd\n```\n\nThis will give you the login password for ArgoCD. The user name is `admin`.\n\nOnce logged in to the ArgoCD UI, you should see the `openfeature-demo` application:\n\n![Application overview](assets/applications-overview.png)\n\nThis application will be automatically synced every 15 seconds, so you should also see the deployment of the sample application, as well as a `Jaeger` instance in the `open-feature-demo` namespace. \n\n```shell\n$ kubectl get all -n open-feature-demo\n\nNAME                                                           READY   STATUS    RESTARTS   AGE\npod/open-feature-demo-go-feature-flag-proxy-5f969dbd4c-9k6rk   1/1     Running   0          3h22m\npod/open-feature-demo-jaeger-agent-75b58df947-n4n85            1/1     Running   0          3h22m\npod/open-feature-demo-playground-app-65449d5444-q8vph          3/3     Running   0          153m\npod/open-feature-fib-service-6c7b76d997-zk2z5                  2/2     Running   0          3h22m\n\nNAME                                       TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)     AGE\nservice/flagd-service                      ClusterIP   192.168.62.139   \u003cnone\u003e        8013/TCP    172m\nservice/open-feature-demo-goff-service     ClusterIP   192.168.49.26    \u003cnone\u003e        1031/TCP    3h22m\nservice/open-feature-demo-jaeger-service   ClusterIP   192.168.58.66    \u003cnone\u003e        6832/UDP    3h22m\nservice/open-feature-demo-jaeger-ui        ClusterIP   192.168.53.254   \u003cnone\u003e        80/TCP      3h22m\nservice/open-feature-demo-service          ClusterIP   192.168.57.102   \u003cnone\u003e        80/TCP      3h22m\nservice/open-feature-fibonacci-service     ClusterIP   192.168.61.80    \u003cnone\u003e        30002/TCP   3h22m\n\nNAME                                                      READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/open-feature-demo-go-feature-flag-proxy   1/1     1            1           3h22m\ndeployment.apps/open-feature-demo-jaeger-agent            1/1     1            1           3h22m\ndeployment.apps/open-feature-demo-playground-app          1/1     1            1           3h22m\ndeployment.apps/open-feature-fib-service                  1/1     1            1           3h22m\n\nNAME                                                                 DESIRED   CURRENT   READY   AGE\nreplicaset.apps/open-feature-demo-go-feature-flag-proxy-5f969dbd4c   1         1         1       3h22m\nreplicaset.apps/open-feature-demo-jaeger-agent-75b58df947            1         1         1       3h22m\nreplicaset.apps/open-feature-demo-playground-app-65449d5444          1         1         1       172m\nreplicaset.apps/open-feature-fib-service-6c7b76d997                  1         1         1       3h22m\n```\n\n\nThe playground application will be accessible via an Ingress. You can get its IP with the following command:\n\n\n```shell\n$ make get-ingress-address\n\nPlayground application: http://\u003cingress-address\u003e\nJaeger UI:              http://\u003cingress-address\u003e/tracing\n```\n\nThis command will also print out the address of the Jaeger UI, which will be used later in this guide.\n\n## Changing a Feature Flag via PR\n\nTo demonstrate the change of a flag using a PR, adapt one of the flags in the file `deployment/flagd-flag-spec.yaml` and commit/push those changes to a \nbranch of the GitOps repository, e.g.: \n\n![PR for changing background color](assets/change-color-pr.png)\n\nOnce the PR has been merged, the new background color should automatically be visible within ~30 seconds.\n\n![Changed Background Color](assets/green-blue.png)\n\n## Demonstrating Tracing Support\n\nIn addition to the playground application, the `open-feature-demo` namespace also contains a Jaeger instance, where the application sends traces to.\nTo demonstrate this, click on the element in the middle of the screen to start the calculation of the fibonacci number. Being logged out, the backend will\nuse the naive `recursive` algorithm to calculate the number, due to the configuration of the `fib-algo` feature flag. Due to this, the calculation will take a couple of seconds. \nTo inspect the traces an Jaeger, use the following command to get a link to the Jaeger UI:\n\n```shell\n$ make get-ingress-address\n\nPlayground application: http://\u003cingress-address\u003e\nJaeger UI:              http://\u003cingress-address\u003e/tracing\n```\n\nTo inspect the traces of the `calculate` function in Jaeger, select the\n`fib3r` service, and filter for the `GET /calculate` operation (see the screenshot below). This will give you a list of all traces related to this operation:\n\n![Jaeger Traces](assets/jaeger-traces.png)\n\nWhen selecting one, you will get to the detailed breakdown of the spans that are part of that trace. Here you will find the information that the flagd-provider evaluated\nthe `fib-algo` feature flag, which resolved to the `recursive` variant:\n\n![Trace with Recursive Algorithm](assets/recursive-algorithm.png)\n\nNow, to make things faster, we will go back to the app's UI and login with a user name that ends with `@faas.com`:\n\n![Login](assets/login.png)\n\nAfter you are logged in, trigger the calculation again - this time it will be much faster, due to the `binet` algorithm being used for logged in users:\n\n![Fast Calculation](assets/fast-calculation.png)\n\nJust like before, the trace for this operation can then again be inspected, only that this time the overall timespan will be much smaller, due to the different algorithm being chosen:\n\n![Trace with Binet Algorithm](assets/binet-algorithm.png)\n\n# Using other Flag Evaluation Tools\n\nIn addition to FlagD, the demo app supports the following feature provider tools:\n\n- Environment Variable\n- Go Feature Flag\n- CloudBees Feature Management\n- Split\n- Harness\n- LaunchDarkly\n- Flagsmith\n\nTo set up these providers, you need to populate the secret containing the API keys for these platforms. The file containing all the \nrequired keys is located at `environment/feature-flag-providers/api-keys.yaml`. To find instructions on how to set up those keys, please refer to the\n[README of the OF playground app](https://github.com/open-feature/playground#available-providers).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-feature%2Fcloud-native-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-feature%2Fcloud-native-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-feature%2Fcloud-native-demo/lists"}