Skip to content

Commit

Permalink
docs: add Kustomize instructions to README
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Sep 8, 2022
1 parent 5f1e854 commit 88c73fc
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ Redis Operator creates/configures/manages redis-failovers atop Kubernetes.
Redis Operator is meant to be run on Kubernetes 1.19+.
All dependencies have been vendored, so there's no need to any additional download.

## Operator deployment on kubernetes
## Operator deployment on Kubernetes

In order to create Redis failovers inside a Kubernetes cluster, the operator has to be deployed. It can be done with [deployment](example/operator) or with the provided [Helm chart](charts/redisoperator).
In order to create Redis failovers inside a Kubernetes cluster, the operator has to be deployed.
It can be done with plain old [deployment](example/operator), using [Kustomize](manifests/kustomize) or with the provided [Helm chart](charts/redisoperator).

### Using the Helm chart

Expand Down Expand Up @@ -46,6 +47,45 @@ kubectl apply -f https://raw.githubusercontent.com/spotahome/redis-operator/mast

This will create a deployment named `redisoperator`.

### Using kustomize

The kustomize setup included in this repo is highly customizable using [components](https://kubectl.docs.kubernetes.io/guides/config_management/components/),
but it also comes with a few presets (in the form of overlays) supporting the most common use cases.

To install the operator with default settings and every necessary resource (including RBAC, service account, default resource limits, etc), install the `default` overlay:

```shell
kustomize build github.com/spotahome/redis-operator/manifests/kustomize/overlays/default
```

If you would like to customize RBAC or the service account used, you can install the `minimal` overlay.

Finally, you can install the `full` overlay if you want everything this operator has to offer, including Prometheus ServiceMonitor resources.

It's always a good practice to pin the version of the operator in your configuration to make sure you are not surprised by changes on the latest development branch:

```shell
kustomize build github.com/spotahome/redis-operator/manifests/kustomize/overlays/default?ref=v1.2.0
```

You can easily create your own config by creating a `kustomization.yaml` file
(for example to apply custom resource limits, to add custom labels or to customize the namespace):

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: redis-operator

commonLabels:
foo: bar

resources:
- github.com/spotahome/redis-operator/manifests/kustomize/overlays/full
```
Take a look at the manifests inside [manifests/kustomize](manifests/kustomize) for more details.
## Usage
Once the operator is deployed inside a Kubernetes cluster, a new API will be accesible, so you'll be able to create, update and delete redisfailovers.
Expand Down

0 comments on commit 88c73fc

Please sign in to comment.