{"id":28268407,"url":"https://github.com/riskified/dynamic-environment","last_synced_at":"2026-01-26T14:02:46.830Z","repository":{"id":218461366,"uuid":"699218016","full_name":"Riskified/dynamic-environment","owner":"Riskified","description":"dynamic-environment","archived":false,"fork":false,"pushed_at":"2026-01-18T14:29:20.000Z","size":330,"stargazers_count":107,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-18T21:55:06.349Z","etag":null,"topics":["developer-tools","development-environment","devops","devops-tools","devtools","istio","k8s","kubernetes","kubernetes-operator","networking"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Riskified.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-02T07:25:05.000Z","updated_at":"2025-10-29T08:40:51.000Z","dependencies_parsed_at":"2024-01-29T13:10:27.325Z","dependency_job_id":"fec3f56a-d8ff-47da-898c-e84952bb33ba","html_url":"https://github.com/Riskified/dynamic-environment","commit_stats":null,"previous_names":["riskified/dynamic-environment"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Riskified/dynamic-environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fdynamic-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fdynamic-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fdynamic-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fdynamic-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Riskified","download_url":"https://codeload.github.com/Riskified/dynamic-environment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fdynamic-environment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["developer-tools","development-environment","devops","devops-tools","devtools","istio","k8s","kubernetes","kubernetes-operator","networking"],"created_at":"2025-05-20T15:12:46.890Z","updated_at":"2026-01-26T14:02:46.824Z","avatar_url":"https://github.com/Riskified.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"images/DynamicEnv-logo.png\" width=\"200\"/\u003e\u003c/p\u003e\n\u003cp style=\"font-size: 40px\" align=\"center\"\u003e\u003cb\u003eDynamic Environment\u003c/b\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Riskified/dynamic-environment/actions?query=workflow%3Amain-build\"\u003e\u003cimg src=\"https://github.com/Riskified/dynamic-environment/actions/workflows/docker.yaml/badge.svg\" alt=\"main build\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Riskified/dynamic-environment/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/Riskified/dynamic-environment.svg\" alt=\"GitHub release\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://www.apache.org/licenses/LICENSE-2.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache--2.0-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nDynamicEnv is an innovative Kubernetes operator designed to empower developers by simplifying the process of launching on-demand environments. At its core, DynamicEnv offers a streamlined approach to deploying and testing different versions of specific services within a shared Kubernetes cluster.\n\nIt effectively deals with the issues mentioned by creating special versions just for the services being tested. At the same time, it makes smart use of the 'production' versions for the rest of the environment, ensuring efficient resource use. The traffic is cleverly directed, sending 'real' users to the 'production' version of services and directing the traffic of a test user to the specific test version.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"images/de-in-action.png\"/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://riskified.github.io/dynamic-environment-docs/\" rel=\"dofollow\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\n## Development Setup\n\nThis section describes how to create a working environment for developing _Dynamic Environment_.\nWhile it's not mandatory to follow these instructions or use the same tools, it's highly recommended\nto keep the versions and some installation procedures (e.g., _Istio_ installation into kubernetes)\nto make sure everything passes the tests correctly.\n\n### Tool Versions\n\nIn order to have consistent results across development, tests, etc. we use a specific version of\neach of the tools. The repository contains [asdf][] configuration for each of the tools we use\nduring development/testing. The tools and versions required are configured in the `.tool-versions`\nfile at the top of the repository. Below is the procedure to install the required tool via _asdf_:\n\nAfter [installing asdf][asdf-inst] install the required plugins (it's safe to run this command even\nif some tools are already installed):\n\n```shell\nfor tool in `cat .tool-versions |cut -d\" \" -f1`; do asdf plugin add $tool; done\n```\n\nThen run the following command in the root of the repository (again, it's safe to run this even if\nsome tools are already installed):\n\n```shell\nasdf install\n```\n\nYou should now have the right versions of the tools installed. As long as you installed _asdf_\ncorrectly, and you're running from within the repository root you'll be using the right versions.\n\nHere are other tools that while not required, can make life easier:\n\n* `kubectl`: Make sure it's a version that matches our cluster version according to the [version\n  skew policy][skew] (if you don't want to mess with multiple versions, and you're using minikube\n  you can use `minikube kubectl` instead).\n* `kubectx` and `kubens`: Will help you set the context and default namespace easily.\n* `k9s`: A great tool for interacting with k8s from the command line. Check the [website][k9s] for\n  usage.\n\n### Prepare task\n\nSome of the development requirements are installed via the `Makefile`'s `prepare` task. Run it to\ninstall requirements:\n\n```shell\nmake prepare\n```\n\n## Setting up Kubernetes\n\nAfter we have the tools we need, it's time to install two kubernetes clusters. One for Development and one for\nrunning tests locally. Below is an optional suggestion for installing and configuring these\nclusters. Feel free to replace all the components except _KInd_ (so your test setup will be as\nsimilar to the _CI_ as possible).\n\n### Development Cluster\n\nWe will use [minikube][] as our development cluster. Feel free to use whichever cluster suits you\nbest, but try to preserve the kubernetes version.\n\nAfter installing minikube, we need to start a new\ncluster. You can play a little with the _memory_ and the _cpus_ but since we're going to run\nresources on it, it's better to give it more resources than the default:\n\n```shell\nminikube start --kubernetes-version v1.35.0 --memory 8g --cpus 4\n```\n\nFor the rest of the commands, make sure your _kubectl_ is operating on the minikube context:\n\n```shell\nkubectx -c # should return 'minikube'\n```\n\nNext, install Istio:\n\n```shell\nistioctl install --set profile=demo -y\n```\n\nIf you want some basic building blocks to play with, you can install a slightly modified version of\nthe _Istio_ _BookInfo_ application, so you'll have some application to experiment on. This command\nwill install _BookInfo_ environment on a newly created _services_ namespace. It will also apply\nrequired labels (note that if you're not using these resources you have to apply the\n`istio-injection=enabled` label on any namespace you want istio to operate on)`:\n\n```shell\nkubectl apply -n services -f dev-resources\n\n# Alternatively, if you don't want to install these manifests you have to apply an istio label\n# on each namespace you want istio to operate on\nkubectl label namespace \u003cNAMESPACE\u003e istio-injection=enabled\n```\n\n_Note: On Mac, minikube might start to use a lot of resources if left running for a couple of days.\nIt's better to stop minikube when you're done working for the day_.\n\n### Tests Cluster\n\nSome tests should run against a dedicated cluster. It is recommended that you'll have a\ndefault named _Kind_ cluster for testing.\n\nA prerequisite for running _Kind_ is a docker service. Make sure you have one installed (e.g.,\n_Rancher Desktop_). Assuming you followed the instructions above you should have the right version\nof _Kind_ installed.\n\nCreate the default _Kind_ cluster:\n\n```shell\n./e2e-testing/scripts/setup.sh create\n```\n\nInstall required dependencies and controller docker image:\n\n```shell\n./e2e-testing/scripts/setup.sh deps\n```\n\n`\n\n**From now on, make sure your k8s context points to the test cluster.**\n\nDeploy the controller to the cluster (this step should be repeated every time you update the\ncontroller code):\n\n```shell\n./e2e-testing/scripts/setup.sh deploy\n````\n\nIf you want to clean up the test cluster, you can run one of the following commands:\n\n```shell\n# Undeploy the controller and dependencies\n./e2e-testing/scripts/setup.sh down\n\n# Completely delete the cluster\n./e2e-testing/scripts/setup.sh delete\n```\n\n## Running the Operator Locally for Development\n\nThe development cluster is meant to be used as a target for our development process. As such, it's\nmissing some components:\n\n* Validating webhook.\n* Metrics\n\nTo run our development operator:\n\n```shell\nmake install run\n```\n\n\u003e Note: if you run in development mode not using the `Makefile` add `-zap-devel` to your parameters\n\u003e for better development logging.\n\nOn another shell session you can deploy a sample _dynamic-environment_ resource to see the effect:\n\n```shell\nkubectl create -f config/samples/riskified_v1alpha1_dynamicenv.yaml\n```\n\nThis will install a _dynamic-environment_ resource in the _default_ namespace. Check the status and\nthe various resources on the _services'_ namespace.\n\n## Writing Tests\n\nThere are two types of tests for this controller:\n\n* [Unit Tests](#unit-tests)\n* [End-to-End Tests](#e2e-tests)\n\n### Unit Tests\n\nThese are the regular _go_ tests.\n\n### E2E Tests\n\nThese are tests against a real cluster ([Kind][kind]). We write and run the tests using [kuttl][].\nEach _Kuttl_ test should be located each in its own directory under `./e2e-testing/kuttl`. Make\nsure you follow the rules for creating tests:\n\n* Your first test manifest should create a new namespace (preferably named like your test directory)\n  and all test resources (deployments, destination rules, virtual services, etc.) should be deployed\n  to that namespace. If required, create more than one namespace. This will prevent collisions\n  between test cases.\n* Every namespace added (per the previous step) should contain an _Istio_ namespace:\n    ```yaml\n    apiVersion: v1\n    kind: Namespace\n    metadata:\n      name: \u003cNAME\u003e\n      labels:\n        istio-injection: enabled\n    ```\n* The tested _dynamic-environment_ yaml could be deployed to the default namespace (with resources\n  pointing to the namespaces above).\n* If there are any leftover namespaces in the cluster (should not happen - this problem was fixed in\n  _Kuttl_) remove then manually.\n* Add a `Readme.md` file in each test directory describing the test target (and optionally pointing\n  to the relevant ticket).\n\nYou can run the specific test you're working on (`\u003cTEST_NAME\u003e` is the directory of the test):\n\n```shell\nkuttl test --start-kind=false -n default --timeout 20 ./e2e-testing/kuttl --test \u003cTEST_NAME\u003e\n```\n\n## Running Tests\n\n* Run all unit tests with: `make test`\n* Run all E2E tests with: `make kuttl`\n\n## Running Linters\n\nWhile we run default linters during our _test_ stage, it's advisable to occasionally run other\nlinters. These should not break the build (and not included in our configuration) and might contain\na lot of false positives, however, you should occasionally run them to manually search for errors:\n\n```shell\n# get a list of linters (at the end of the output there are some convenient presets)\ngolangci-lint help linters\n\n# run specific presets (e.g. complexity and error)\ngolangci-lint run -p complexity,error\n```\n\n[asdf]: https://asdf-vm.com/\n\n[asdf-inst]: https://asdf-vm.com/guide/getting-started.html\n\n[kind]: https://kind.sigs.k8s.io/\n\n[kuttl]: https://kuttl.dev/\n\n[minikube]: https://minikube.sigs.k8s.io/\n\n[skew]: https://kubernetes.io/releases/version-skew-policy/\n\n[k9s]: https://k9scli.io/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friskified%2Fdynamic-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friskified%2Fdynamic-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friskified%2Fdynamic-environment/lists"}