# Development

### Pre-requisites

#### Access to Kubernetes cluster

First of all, you will need access to a Kubernetes cluster. The easiest way to start is minikube.

* [Virtualbox](https://www.virtualbox.org/wiki/Downloads) - hypervisor to run a Kubernetes cluster
* [Minikube](https://kubernetes.io/docs/setup/minikube/) - for Kubernetes cluster creation on local machine
* [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - to interact with Kubernetes cluster

#### Tools to build an Operator

Apart from kubernetes cluster, there are some tools which are needed to build and test the redis operator.

Required Tools:-

* [Git](https://git-scm.com/downloads)
* [Go](https://golang.org/dl/)
* [Docker](https://docs.docker.com/install/)
* [Operator SDK](https://github.com/operator-framework/operator-sdk/blob/v0.8.1/doc/user/install-operator-sdk.md)
* [Make](https://www.gnu.org/software/make/manual/make.html)

### Build Locally

To achieve this, execute this command:-

```bash
make build
```

### Build Image

Redis operator gets packaged as a container image for running on the Kubernetes cluster. These instructions will guide you to build an image.

```bash
make build-image
```

### Testing

If you want to play it on Kubernetes. You can use a minikube.

```bash
# Start minikube
minikube start --vm-driver virtualbox

# Deploy the image on minikube
helm upgrade redis-cluster ./helm/redis-setup \
    --set redisSetup.setupMode="cluster" \
    --set redisSetup.clusterSize=3 \
    --install --namespace redis-operator
```

#### Run Tests

```bash
make test
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.opstreelabs.in/redis-operator/development.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
