diff --git a/README.md b/README.md index 692e1fff6d8b62238e4ce37444426e361c5a5b73..653e4ba9e965280f69c17dbbb9a26629e09a9ed3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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.