Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
anishamidi authored Apr 26, 2024
1 parent a8fbecc commit 9affd41
Showing 1 changed file with 16 additions and 58 deletions.
74 changes: 16 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,39 @@
# A toxiproxy chaos operator for simulate chaos experiments on Kubernetes
# A Toxiproxy Chaos Operator for simulating chaos experiments on Kubernetes
The Chaos Operator is designed to simulate chaos within applications and Kubernetes infrastructure, utilizing Toxiproxy under the hood. Its primary objective is to automate the installation of Toxiproxy and persist its configuration within the Kubernetes cluster.
With Chaos Operator, you can conveniently simulate various abnormalities in a controlled way that might occur in reality during development, testing, and production environments. This allows you to find potential problems in the system. Currently, it offers latency and timeout types of fault simulation.


## How the Chaos Operator Works
The Chaos Operator enables you to create proxies with various toxics that mimic real-world network issues. It creates proxy instances that sit between your application and the actual service, intercepting and controlling the network traffic. Toxics are components that introduce various network conditions or issues, simulating problems like latency, timeouts, and connection issues. Toxics are applied to specific proxies, allowing you to selectively introduce these issues for testing.


## Getting Started
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).

### Running on the cluster
1. Install Instances of Custom Resources:
* Install the chaos infrastructure components (RBAC, CRDs) and the Operator
* Create a NetworkChaos custom resource to simulating the chaos

```sh
kubectl apply -f config/samples/
```
## Installation

2. Build and push your image to the location specified by `IMG`:
#### Install Chaos Operator using Helm

```sh
make docker-build docker-push IMG=<some-registry>/chaos-operator:tag
```
#### Create the namespace to install Chaos Operator

3. Deploy the controller to the cluster with the image specified by `IMG`:

```sh
make deploy IMG=<some-registry>/chaos-operator:tag
```

### Uninstall CRDs
To delete the CRDs from the cluster:

```sh
make uninstall
kubectl create ns chaos
```

### Undeploy controller
UnDeploy the controller from the cluster:
#### Verify the installation

```sh
make undeploy
```bash
kubectl get po -n chaos
NAME READY STATUS RESTARTS AGE
chaos-operator-controller-manager-694fcd95fc-r6kjb 2/2 Running 0 1d
```


### How it works
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).

It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

### Test It Out
1. Install the CRDs into the cluster:

```sh
make install
```bash
kubectl get sa -n chaos
NAME SECRETS AGE
chaos-operator-controller-manager 2 1d
```

2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):

```sh
make run
```

**NOTE:** You can also run this in one step by running: `make install run`

### Modifying the API definitions
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:

```sh
make manifests
```

**NOTE:** Run `make --help` for more information on all potential `make` targets

More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)


## Contributing
Expand Down

0 comments on commit 9affd41

Please sign in to comment.