{"id":22048896,"url":"https://github.com/chaostoolkit-incubator/chaostoolkit-istio","last_synced_at":"2025-10-18T11:12:46.036Z","repository":{"id":52503952,"uuid":"131842839","full_name":"chaostoolkit-incubator/chaostoolkit-istio","owner":"chaostoolkit-incubator","description":"Chaos Toolkit driver extension for Istio","archived":false,"fork":false,"pushed_at":"2024-04-18T13:09:55.000Z","size":88,"stargazers_count":10,"open_issues_count":9,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-01T06:35:25.081Z","etag":null,"topics":["chaos-engineering","chaostoolkit","chaostoolkit-extension","istio","service-mesh"],"latest_commit_sha":null,"homepage":"https://chaostoolkit.org/","language":"Python","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/chaostoolkit-incubator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-02T11:45:41.000Z","updated_at":"2022-09-29T08:31:04.000Z","dependencies_parsed_at":"2024-06-19T00:10:40.888Z","dependency_job_id":null,"html_url":"https://github.com/chaostoolkit-incubator/chaostoolkit-istio","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-istio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-istio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-istio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-istio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaostoolkit-incubator","download_url":"https://codeload.github.com/chaostoolkit-incubator/chaostoolkit-istio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227351639,"owners_count":17768412,"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":["chaos-engineering","chaostoolkit","chaostoolkit-extension","istio","service-mesh"],"created_at":"2024-11-30T14:13:39.815Z","updated_at":"2025-10-18T11:12:40.991Z","avatar_url":"https://github.com/chaostoolkit-incubator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":" # Chaos Toolkit Extension for Istio Fault Injection\n \n[![Build](https://github.com/chaostoolkit-incubator/chaostoolkit-istio/actions/workflows/build.yaml/badge.svg)](https://github.com/chaostoolkit-incubator/chaostoolkit-istio/actions/workflows/build.yaml)\n[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-istio.svg)](https://www.python.org/)\n\n\nThis project is a collection of [actions][] and [probes][], gathered as an\nextension to the [Chaos Toolkit][chaostoolkit].\n\n[actions]: http://chaostoolkit.org/reference/api/experiment/#action\n[probes]: http://chaostoolkit.org/reference/api/experiment/#probe\n[chaostoolkit]: http://chaostoolkit.org\n\n## Install\n\nThis package requires Python 3.8+\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n```\n$ pip install -U chaostoolkit-istio\n```\n\n## Usage\n\nBelow is an example of using this extension to inject a delay of 5 seconds to\na specific user.\n\nNote this example can be applied against the\n[bookinfo Istio sample application](https://istio.io/docs/examples/bookinfo/).\n\nTo run it, simple set the `KUBERNETES_CONTEXT` environment variable to the\ntarget cluster and ensure your local kubeconfig is properly populated for that\ncontext. Set also the `PRODUCT_PAGE_SERVICE_BASE_URL` to the address of the\nIstio gateway.\n\nFor instance:\n\n```\n$ export PRODUCT_PAGE_SERVICE_BASE_URL=$(kubectl get po -l istio=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name==\"http2\")].nodePort}')\n```\n\n```json\n{\n    \"title\": \"Network latency does not impact our users\",\n    \"description\": \"Using Istio fault injection capability, let's explore how latency impacts a single user\",\n    \"configuration\": {\n        \"product_page_url\": {\n            \"type\": \"env\",\n            \"key\": \"PRODUCT_PAGE_SERVICE_BASE_URL\"\n        }\n    },\n    \"secrets\": {\n        \"istio\": {\n            \"KUBERNETES_CONTEXT\": {\n                \"type\": \"env\",\n                \"key\": \"KUBERNETES_CONTEXT\"\n            }\n        }\n    },\n    \"steady-state-hypothesis\": {\n        \"title\": \"Our service should respond under 1 second\",\n        \"probes\": [\n            {\n                \"type\": \"probe\",\n                \"name\": \"sign-in-as-jason\",\n                \"tolerance\": 0,\n                \"provider\": {\n                    \"type\": \"process\",\n                    \"path\": \"curl\",\n                    \"arguments\": \"-v -X POST -d 'username=jason\u0026passwd=' -c /tmp/cookie.txt --silent ${product_page_url}/login\"\n                }\n            },\n            {\n                \"type\": \"probe\",\n                \"name\": \"fetch-productpage-for-jason-in-due-time\",\n                \"tolerance\": 0,\n                \"provider\": {\n                    \"type\": \"process\",\n                    \"path\": \"curl\",\n                    \"arguments\": \"-v --connect-timeout 1 --max-time 1 -b /tmp/cookie.txt --silent ${product_page_url}/productpage\"\n                }\n            }\n        ]\n    },\n    \"method\": [\n        {\n            \"type\": \"action\",\n            \"name\": \"inject-fault-for-jason-only\",\n            \"provider\": {\n                \"type\": \"python\",\n                \"module\": \"chaosistio.fault.actions\",\n                \"func\": \"add_delay_fault\",\n                \"secrets\": [\"istio\"],\n                \"arguments\": {\n                    \"virtual_service_name\": \"reviews\",\n                    \"fixed_delay\": \"5s\",\n                    \"percentage\": {\n                        \"value\":  100.0\n                    },\n                    \"routes\": [\n                        {\n                            \"destination\": {\n                                \"host\": \"reviews\",\n                                \"subset\": \"v2\"\n                            }\n                        }\n                    ]\n                }\n            },\n            \"pauses\": {\n                \"after\": 2\n            }\n        }\n    ],\n    \"rollbacks\": [\n        {\n            \"type\": \"action\",\n            \"name\": \"remove-fault-for-jason-only\",\n            \"provider\": {\n                \"type\": \"python\",\n                \"module\": \"chaosistio.fault.actions\",\n                \"func\": \"remove_delay_fault\",\n                \"secrets\": [\"istio\"],\n                \"arguments\": {\n                    \"virtual_service_name\": \"reviews\",\n                    \"routes\": [\n                        {\n                            \"destination\": {\n                                \"host\": \"reviews\",\n                                \"subset\": \"v2\"\n                            }\n                        }\n                    ]\n                }\n            }\n        }\n    ]\n}\n```\n\nThat's it!\n\nPlease explore the code to see existing probes and actions.\n\n## Configuration\n\nThis extension needs you specify how to connect to the Kubernetes cluster. This\ncan be done by setting the `KUBERNETES_CONTEXT` in the `secrets` payload.\n\n\n## Contribute\n\nIf you wish to contribute more functions to this package, you are more than\nwelcome to do so. Please, fork this project, make your changes following the\nusual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for\nreview.\n\n[pep8]: https://pycodestyle.readthedocs.io/en/latest/\n\nThe Chaos Toolkit projects require all contributors must sign a\n[Developer Certificate of Origin][dco] on each commit they would like to merge\ninto the master branch of the repository. Please, make sure you can abide by\nthe rules of the DCO before submitting a PR.\n\n[dco]: https://github.com/probot/dco#how-it-works\n\n### Develop\n\nIf you wish to develop on this project, make sure to install the development\ndependencies, using [pdm](https://pdm-project.org/en/latest/):\n\n```console\n$ pdm install --dev\n```\n\nNow, you can edit the files and they will be automatically be seen by your\nenvironment, even when running from the `chaos` command locally.\n\n### Test\n\nTo run the tests for the project execute the following:\n\n```\n$ pdm run test\n```\n\n### Formatting and Linting\n\nWe use [`ruff`][ruff] to both lint and format this repositories code.\n\n[ruff]: https://github.com/astral-sh/ruff\n\nBefore raising a Pull Request, we recommend you run formatting against your\ncode with:\n\n```console\n$ pdm run format\n```\n\nThis will automatically format any code that doesn't adhere to the formatting\nstandards.\n\nAs some things are not picked up by the formatting, we also recommend you run:\n\n```console\n$ pdm run lint\n```\n\nTo ensure that any unused import statements/strings that are too long, etc.\nare also picked up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-istio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-istio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-istio/lists"}