{"id":13820803,"url":"https://github.com/litmuschaos/chaos-operator","last_synced_at":"2025-04-04T21:11:51.391Z","repository":{"id":35176230,"uuid":"182976945","full_name":"litmuschaos/chaos-operator","owner":"litmuschaos","description":"chaos engineering via kubernetes operator","archived":false,"fork":false,"pushed_at":"2024-04-17T11:28:24.000Z","size":73129,"stargazers_count":123,"open_issues_count":9,"forks_count":86,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-17T23:09:06.263Z","etag":null,"topics":["chaos-engineering","chaos-operator","cloud-native","hacktoberfest","kubernetes","kubernetes-operator","operator"],"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/litmuschaos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2019-04-23T09:06:07.000Z","updated_at":"2024-04-19T13:56:13.186Z","dependencies_parsed_at":"2023-09-29T11:25:18.704Z","dependency_job_id":"7f7bed1a-6189-442e-b1fa-f4ff1ccf2c69","html_url":"https://github.com/litmuschaos/chaos-operator","commit_stats":{"total_commits":333,"total_committers":41,"mean_commits":8.121951219512194,"dds":0.8018018018018018,"last_synced_commit":"2d8472873222d3c6556a5c8d6c64b0332248f086"},"previous_names":[],"tags_count":103,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litmuschaos%2Fchaos-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litmuschaos%2Fchaos-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litmuschaos%2Fchaos-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litmuschaos%2Fchaos-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litmuschaos","download_url":"https://codeload.github.com/litmuschaos/chaos-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249536,"owners_count":20908212,"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","chaos-operator","cloud-native","hacktoberfest","kubernetes","kubernetes-operator","operator"],"created_at":"2024-08-04T08:01:09.346Z","updated_at":"2025-04-04T21:11:51.374Z","avatar_url":"https://github.com/litmuschaos.png","language":"Go","funding_links":[],"categories":["kubernetes","3. Fault Injection"],"sub_categories":["Containers \u0026 Orchestrators"],"readme":"# Litmus chaos-operator for injecting chaos experiments on Kubernetes\n\n[![Slack Channel](https://img.shields.io/badge/Slack-Join-purple)](https://slack.litmuschaos.io)\n![GitHub Workflow](https://github.com/litmuschaos/chaos-operator/actions/workflows/push.yml/badge.svg?branch=master)\n[![Docker Pulls](https://img.shields.io/docker/pulls/litmuschaos/chaos-operator.svg)](https://hub.docker.com/r/litmuschaos/chaos-operator)\n[![GitHub issues](https://img.shields.io/github/issues/litmuschaos/chaos-operator)](https://github.com/litmuschaos/chaos-operator/issues)\n[![Twitter Follow](https://img.shields.io/twitter/follow/litmuschaos?style=social)](https://twitter.com/LitmusChaos)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2597079b1b5240d3866a6deb4112a2f2)](https://www.codacy.com/manual/litmuschaos/chaos-operator?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=litmuschaos/chaos-operator\u0026amp;utm_campaign=Badge_Grade)\n[![Go Report Card](https://goreportcard.com/badge/github.com/litmuschaos/chaos-operator)](https://goreportcard.com/report/github.com/litmuschaos/chaos-operator)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5290/badge)](https://bestpractices.coreinfrastructure.org/projects/5290)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flitmuschaos%2Fchaos-operator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flitmuschaos%2Fchaos-operator?ref=badge_shield)\n[![codecov](https://codecov.io/gh/litmuschaos/chaos-operator/branch/master/graph/badge.svg)](https://codecov.io/gh/litmuschaos/chaos-operator)\n[![YouTube Channel](https://img.shields.io/badge/YouTube-Subscribe-red)](https://www.youtube.com/channel/UCa57PMqmz_j0wnteRa9nCaw)\n\u003cbr\u003e\u003cbr\u003e\n  \nLitmus chaos operator is used by Kubernetes application developers and SREs to inject chaos into the applications \nand Kubernetes infrastructure in a managed fashion. Its objective is to make the process of validation and \nhardening of application workloads on Kubernetes easy by automating the execution of chaos experiments. A sample chaos \ninjection workflow could be as simple as:\n\n-  Install the Litmus infrastructure components (RBAC, CRDs), the Operator \u0026 Experiment custom resource bundles via the operator manifest\n-  Annotate the application under test (AUT), enabling it for chaos\n-  Create a ChaosEngine custom resource tied to the AUT, which describes the experiment to be executed \n\nBenefits provided by the Chaos Operator include: \n\n-  Standardised chaos experiment spec \n-  Categorized chaos bundles for stateless/stateful/vendor-specific\n-  Test-Run resiliency \n-  Ability to chaos run as a background service based on annotations\n\n## What is a chaos operator and how is it built?\n\nThe Chaos Operator is a Kubernetes Operator, which are nothing but custom-controllers with direct access to Kubernetes API\nthat can manage the lifecycle of certain resources or applications, while always trying to ensure the resource is in the \"desired\nstate\". The logic that ensures this is commonly called \"reconcile\" function.\n\nThe Chaos Operator is built using the popular [Operator-SDK](https://github.com/operator-framework/operator-sdk/) framework, \nwhich provides bootstrap support for new operator projects, allowing teams to focus on business/operational logic. \n\nThe Litmus Chaos Operator helps reconcile the state of the ChaosEngine, a custom resource that holds the chaos intent \nspecified by a developer/devops engineer against a particular stateless/stateful Kubernetes deployment. The operator performs\nspecific actions upon CRUD of the ChaosEngine, its primary resource. The operator also defines a secondary resource (the engine \nrunner pod), which is created \u0026 managed by it in order to implement the reconcile functions. \n\n## What is a chaos engine?\n\nThe ChaosEngine is the core schema that defines the chaos workflow for a given application. Currently, it defines the following:\n\n-  Application info (namespace, labels, kind) of primary (AUT) and auxiliary (dependent) applications \n-  ServiceAccount used for execution of the experiment\n-  Flag to turn on/off chaos annotation checks on applications\n-  Chaos Experiment to be executed on the application\n-  Attributes of the experiments (overrides defaults specified in the experiment CRs)\n-  Flag to retain/cleanup chaos resources after experiment execution\n\nThe ChaosEngine is the referenced as the owner of the secondary (reconcile) resource with Kubernetes deletePropagation \nensuring these also are removed upon deletion of the ChaosEngine CR.\n\nHere is a sample ChaosEngineSpec for reference: \u003chttps://v1-docs.litmuschaos.io/docs/getstarted/#prepare-chaosengine\u003e\n\n## What is a litmus chaos chart and how can I use it?\n\nLitmus Chaos Charts are used to install \"Chaos Experiment Bundles\" \u0026 are categorized based on the nature\nof the experiments (general Kubernetes chaos, vendor/provider specific chaos - such as, OpenEBS or \napplication-specific chaos, say NuoDB). They consist of custom resources that hold low-level chaos(test) \nparameters which are queried by the operator in order to execute the experiments. The spec.definition._fields_\nand their corresponding _values_ are used to construct the eventual execution artifact that runs the chaos \nexperiment (typically, the litmusbook, which is a K8s job resource). It also defines the permissions necessary \nto execute the experiment.  \n\nHere is a sample ChaosEngineSpec for reference:\n\n```yaml\napiVersion: litmuschaos.io/v1alpha1\ndescription:\n  message: |\n    Deletes a pod belonging to a deployment/statefulset/daemonset\nkind: ChaosExperiment\nmetadata:\n  name: pod-delete\n  labels:\n    name: pod-delete\n    app.kubernetes.io/part-of: litmus\n    app.kubernetes.io/component: chaosexperiment\n    app.kubernetes.io/version: latest\nspec:\n  definition:\n    scope: Namespaced\n    permissions:\n      - apiGroups:\n          - \"\"\n          - \"apps\"\n          - \"batch\"\n          - \"litmuschaos.io\"\n        resources:\n          - \"deployments\"\n          - \"jobs\"\n          - \"pods\"\n          - \"configmaps\"\n          - \"chaosengines\"\n          - \"chaosexperiments\"\n          - \"chaosresults\"\n        verbs:\n          - \"create\"\n          - \"list\"\n          - \"get\"\n          - \"patch\"\n          - \"update\"\n          - \"delete\"\n    image: \"litmuschaos/go-runner:latest\"\n    imagePullPolicy: Always\n    args:\n    - -c\n    - ./experiments -name pod-delete\n    command:\n    - /bin/bash\n    env:\n\n    - name: TOTAL_CHAOS_DURATION\n      value: '15'\n\n    # Period to wait before/after injection of chaos in sec\n    - name: RAMP_TIME\n      value: ''\n\n    - name: FORCE\n      value: 'true'\n\n    - name: CHAOS_INTERVAL\n      value: '5'\n\n    ## percentage of total pods to target\n    - name: PODS_AFFECTED_PERC\n      value: ''\n\n    - name: LIB\n      value: 'litmus'    \n\n    - name: TARGET_PODS\n      value: ''\n\n    ## it defines the sequence of chaos execution for multiple target pods\n    ## supported values: serial, parallel\n    - name: SEQUENCE\n      value: 'parallel'\n    labels:\n      name: pod-delete\n      app.kubernetes.io/part-of: litmus\n      app.kubernetes.io/component: experiment-job\n      app.kubernetes.io/version: latest\n```\n\n## How to get started?\n\nRefer the LitmusChaos documentation [litmus docs](https://docs.litmuschaos.io)\n\n## How do I contribute?\n\nYou can contribute by raising issues, improving the documentation, contributing to the core framework and tooling, etc.\n\nHead over to the [Contribution guide](CONTRIBUTING.md)\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flitmuschaos%2Fchaos-operator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Flitmuschaos%2Fchaos-operator?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitmuschaos%2Fchaos-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitmuschaos%2Fchaos-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitmuschaos%2Fchaos-operator/lists"}