Skip to content

Commit 083465f

Browse files
committed
Update installation docs for Helm, fix links in README shown in GitHub
1 parent e8fcbaa commit 083465f

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed

docs/README.md

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# redis-operator
22

3-
[![Build Status](https://github.com/spotahome/redis-operator/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/spotahome/redis-operator)
4-
[![Go Report Card](https://goreportcard.com/badge/github.com/spotahome/redis-operator)](https://goreportcard.com/report/github.com/spotahome/redis-operator)
3+
[![Build Status](https://github.com/powerhome/redis-operator/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/powerhome/redis-operator/actions)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/powerhome/redis-operator)](https://goreportcard.com/report/github.com/powerhome/redis-operator)
55

66
Redis Operator creates/configures/manages redis-failovers atop Kubernetes.
77

@@ -16,20 +16,21 @@ All dependencies have been vendored, so there's no need to any additional downlo
1616
## Operator deployment on Kubernetes
1717

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

2121
### Using the Helm chart
2222

23-
From the root folder of the project, execute the following:
24-
23+
1. Clone this repo
24+
2. (Optional) Checkout a tag with specific version you want to use
25+
3. Install the chart with
2526
```
26-
helm repo add redis-operator https://spotahome.github.io/redis-operator
27-
helm repo update
28-
helm install redis-operator redis-operator/redis-operator
27+
helm install redis-operator <path_to_cloned_repo>/charts/redisoperator
2928
```
3029

3130
#### Update helm chart
3231

32+
**NOTE:** This doc section is outdated, please create a PR to update it after you actually do it!
33+
3334
Helm chart only manage the creation of CRD in the first install. In order to update the CRD you will need to apply directly.
3435

3536
```
@@ -42,6 +43,8 @@ helm upgrade redis-operator redis-operator/redis-operator
4243
```
4344
### Using kubectl
4445

46+
**NOTE:** This doc section is outdated, please create a PR to update it after you actually do it!
47+
4548
To create the operator, you can directly create it with kubectl:
4649

4750
```
@@ -54,6 +57,8 @@ This will create a deployment named `redisoperator`.
5457

5558
### Using kustomize
5659

60+
**NOTE:** This doc section is outdated, please create a PR to update it after you actually do it!
61+
5762
The kustomize setup included in this repo is highly customizable using [components](https://kubectl.docs.kubernetes.io/guides/config_management/components/),
5863
but it also comes with a few presets (in the form of overlays) supporting the most common use cases.
5964

@@ -89,17 +94,17 @@ resources:
8994
- github.com/spotahome/redis-operator/manifests/kustomize/overlays/full
9095
```
9196
92-
Take a look at the manifests inside [manifests/kustomize](manifests/kustomize) for more details.
97+
Take a look at the manifests inside [manifests/kustomize](/manifests/kustomize) for more details.
9398
9499
## Usage
95100
96101
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.
97102
98-
In order to deploy a new redis-failover a [specification](example/redisfailover/basic.yaml) has to be created:
103+
In order to deploy a new redis-failover a [specification](/example/redisfailover/basic.yaml) has to be created:
99104
100105
```
101-
REDIS_OPERATOR_VERSION=v1.2.4
102-
kubectl create -f https://raw.githubusercontent.com/spotahome/redis-operator/${REDIS_OPERATOR_VERSION}/example/redisfailover/basic.yaml
106+
REDIS_OPERATOR_VERSION=v4.3.1
107+
kubectl create -f https://raw.githubusercontent.com/powerhome/redis-operator/${REDIS_OPERATOR_VERSION}/example/redisfailover/basic.yaml
103108
```
104109

105110
This redis-failover will be managed by the operator, resulting in the following elements created inside Kubernetes:
@@ -118,21 +123,21 @@ This redis-failover will be managed by the operator, resulting in the following
118123

119124
The operator has the ability of add persistence to Redis data. By default an `emptyDir` will be used, so the data is not saved.
120125

121-
In order to have persistence, a `PersistentVolumeClaim` usage is allowed. The full [PVC definition has to be added](example/redisfailover/persistent-storage.yaml) to the Redis Failover Spec under the `Storage` section.
126+
In order to have persistence, a `PersistentVolumeClaim` usage is allowed. The full [PVC definition has to be added](/example/redisfailover/persistent-storage.yaml) to the Redis Failover Spec under the `Storage` section.
122127

123-
**IMPORTANT**: By default, the persistent volume claims will be deleted when the Redis Failover is. If this is not the expected usage, a `keepAfterDeletion` flag can be added under the `storage` section of Redis. [An example is given](example/redisfailover/persistent-storage-no-pvc-deletion.yaml).
128+
**IMPORTANT**: By default, the persistent volume claims will be deleted when the Redis Failover is. If this is not the expected usage, a `keepAfterDeletion` flag can be added under the `storage` section of Redis. [An example is given](/example/redisfailover/persistent-storage-no-pvc-deletion.yaml).
124129

125130
### NodeAffinity and Tolerations
126131

127-
You can use NodeAffinity and Tolerations to deploy Pods to isolated groups of Nodes. Examples are given for [node affinity](example/redisfailover/node-affinity.yaml), [pod anti affinity](example/redisfailover/pod-anti-affinity.yaml) and [tolerations](example/redisfailover/tolerations.yaml).
132+
You can use NodeAffinity and Tolerations to deploy Pods to isolated groups of Nodes. Examples are given for [node affinity](/example/redisfailover/node-affinity.yaml), [pod anti affinity](/example/redisfailover/pod-anti-affinity.yaml) and [tolerations](/example/redisfailover/tolerations.yaml).
128133

129134
## Topology Spread Contraints
130135

131-
You can use the `topologySpreadContraints` to ensure the pods of a type(redis or sentinel) are evenly distributed across zones/nodes. Examples are for using [topology spread constraints](example/redisfailover/topology-spread-contraints.yaml). Further document on how `topologySpreadConstraints` work could be found [here](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/).
136+
You can use the `topologySpreadContraints` to ensure the pods of a type(redis or sentinel) are evenly distributed across zones/nodes. Examples are for using [topology spread constraints](/example/redisfailover/topology-spread-contraints.yaml). Further document on how `topologySpreadConstraints` work could be found [here](https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/).
132137

133138
### Custom configurations
134139

135-
It is possible to configure both Redis and Sentinel. This is done with the `customConfig` option inside their spec. It is a list of configurations and their values. Example are given in the [custom config example file](example/redisfailover/custom-config.yaml).
140+
It is possible to configure both Redis and Sentinel. This is done with the `customConfig` option inside their spec. It is a list of configurations and their values. Example are given in the [custom config example file](/example/redisfailover/custom-config.yaml).
136141

137142
In order to have the ability of this configurations to be changed "on the fly", without the need of reload the redis/sentinel processes, the operator will apply them with calls to the redises/sentinels, using `config set` or `sentinel set mymaster` respectively. Because of this, **no changes on the configmaps** will appear regarding this custom configurations and the entries of `customConfig` from Redis spec will not be written on `redis.conf` file. To verify the actual Redis configuration use [`redis-cli CONFIG GET *`](https://redis.io/commands/config-get).
138143

@@ -147,21 +152,21 @@ In order to have the ability of this configurations to be changed "on the fly",
147152

148153
By default, a custom shutdown file is given. This file makes redis to `SAVE` it's data, and in the case that redis is master, it'll call sentinel to ask for a failover.
149154

150-
This behavior is configurable, creating a configmap and indicating to use it. An example about how to use this option can be found on the [shutdown example file](example/redisfailover/custom-shutdown.yaml).
155+
This behavior is configurable, creating a configmap and indicating to use it. An example about how to use this option can be found on the [shutdown example file](/example/redisfailover/custom-shutdown.yaml).
151156

152157
**Important**: the configmap has to be in the same namespace. The configmap has to have a `shutdown.sh` data, containing the script.
153158

154159
### Custom SecurityContext
155160

156161
By default Kubernetes will run containers as the user specified in the Dockerfile (or the root user if not specified), this is not always desirable.
157162
If you need the containers to run as a specific user (or provide any other PodSecurityContext options) then you can specify a custom `securityContext` in the
158-
`redisfailover` object. See the [SecurityContext example file](example/redisfailover/security-context.yaml) for an example. You can visit kubernetes documentation for detailed docs about [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
163+
`redisfailover` object. See the [SecurityContext example file](/example/redisfailover/security-context.yaml) for an example. You can visit kubernetes documentation for detailed docs about [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
159164

160165
### Custom containerSecurityContext at container level
161166

162167
By default Kubernetes will run containers with default docker capabilities for exemple, this is not always desirable.
163168
If you need the containers to run with specific capabilities or with read only root file system (or provide any other securityContext options) then you can specify a custom `containerSecurityContext` in the
164-
`redisfailover` object. See the [ContainerSecurityContext example file](example/redisfailover/container-security-context.yaml) for an example. Keys available under containerSecurityContext are detailed [here](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#securitycontext-v1-core)
169+
`redisfailover` object. See the [ContainerSecurityContext example file](/example/redisfailover/container-security-context.yaml) for an example. Keys available under containerSecurityContext are detailed [here](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#securitycontext-v1-core)
165170

166171
### Custom command
167172

@@ -170,7 +175,7 @@ By default, redis and sentinel will be called with the basic command, giving the
170175
- Redis: `redis-server /redis/redis.conf`
171176
- Sentinel: `redis-server /redis/sentinel.conf --sentinel`
172177

173-
If necessary, this command can be changed with the `command` option inside redis/sentinel spec. An example can be found in the [custom command example file](example/redisfailover/custom-command.yaml).
178+
If necessary, this command can be changed with the `command` option inside redis/sentinel spec. An example can be found in the [custom command example file](/example/redisfailover/custom-command.yaml).
174179

175180
### Custom Priority Class
176181
In order to use a custom Kubernetes [Priority Class](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass) for Redis and/or Sentinel pods, you can set the `priorityClassName` in the redis/sentinel spec, this attribute has no default and depends on the specific cluster configuration. **Note:** the operator doesn't create the referenced `Priority Class` resource.
@@ -181,11 +186,11 @@ In order to use a custom Kubernetes [Service Account](https://kubernetes.io/docs
181186
### Custom Pod Annotations
182187
By default, no pod annotations will be applied to Redis nor Sentinel pods.
183188

184-
In order to apply custom pod Annotations, you can provide the `podAnnotations` option inside redis/sentinel spec. An example can be found in the [custom annotations example file](example/redisfailover/custom-annotations.yaml).
189+
In order to apply custom pod Annotations, you can provide the `podAnnotations` option inside redis/sentinel spec. An example can be found in the [custom annotations example file](/example/redisfailover/custom-annotations.yaml).
185190
### Custom Service Annotations
186191
By default, no service annotations will be applied to the Redis nor Sentinel services.
187192

188-
In order to apply custom service Annotations, you can provide the `serviceAnnotations` option inside redis/sentinel spec. An example can be found in the [custom annotations example file](example/redisfailover/custom-annotations.yaml).
193+
In order to apply custom service Annotations, you can provide the `serviceAnnotations` option inside redis/sentinel spec. An example can be found in the [custom annotations example file](/example/redisfailover/custom-annotations.yaml).
189194

190195
### Allow Operator to Be Namespace-Scoped
191196
By default operator is cluster wide.
@@ -209,7 +214,7 @@ to resource is creates you can modify the labelWhitelist option in the spec.
209214

210215
By default specifying no whitelist or an empty whitelist will cause all labels to still be copied as not to break backwards compatibility.
211216

212-
Items in the array should be regular expressions, see [here](example/redisfailover/control-label-propagation.yaml) as an example of how they can be used and
217+
Items in the array should be regular expressions, see [here](/example/redisfailover/control-label-propagation.yaml) as an example of how they can be used and
213218
[here](https://github.com/google/re2/wiki/Syntax) for a syntax reference.
214219

215220
The whitelist can also be used as a form of blacklist by specifying a regular expression that will not match any label.
@@ -315,10 +320,10 @@ If you are wanting to migrate off of a pre-existing Redis instance, you can prov
315320
This `bootstrapNode` can be configured as follows:
316321
| Key | Type | Description | Example File |
317322
|:--------------:|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
318-
| host | **required** | The IP of the target Redis address or the ClusterIP of a pre-existing Kubernetes Service targeting Redis pods | [bootstrapping.yaml](example/redisfailover/bootstrapping.yaml) |
319-
| port | _optional_ | The Port that the target Redis address is listening to. Defaults to `6379`. | [bootstrapping-with-port.yaml](example/redisfailover/bootstrapping-with-port.yaml) |
320-
| allowSentinels | _optional_ | Allow the Operator to also create the specified Sentinel resources and point them to the target Node/Port. By default, the Sentinel resources will **not** be created when bootstrapping. | [bootstrapping-with-sentinels.yaml](example/redisfailover/bootstrapping-with-sentinels.yaml) |
321-
| enabled | _optional_ | Allow the Operator to toggle the bootstrapping status of a RedisFailover. By default, Bootstrap mode is enabled, prompting Redis nodes to attempt a connection with the source host. When set to `false`, the Operator disables bootstrapping mode on the Redisfailover. | [bootstrapping-disabled.yaml](example/redisfailover/bootstrapping-disabled.yaml) |
323+
| host | **required** | The IP of the target Redis address or the ClusterIP of a pre-existing Kubernetes Service targeting Redis pods | [bootstrapping.yaml](/example/redisfailover/bootstrapping.yaml) |
324+
| port | _optional_ | The Port that the target Redis address is listening to. Defaults to `6379`. | [bootstrapping-with-port.yaml](/example/redisfailover/bootstrapping-with-port.yaml) |
325+
| allowSentinels | _optional_ | Allow the Operator to also create the specified Sentinel resources and point them to the target Node/Port. By default, the Sentinel resources will **not** be created when bootstrapping. | [bootstrapping-with-sentinels.yaml](/example/redisfailover/bootstrapping-with-sentinels.yaml) |
326+
| enabled | _optional_ | Allow the Operator to toggle the bootstrapping status of a RedisFailover. By default, Bootstrap mode is enabled, prompting Redis nodes to attempt a connection with the source host. When set to `false`, the Operator disables bootstrapping mode on the Redisfailover. | [bootstrapping-disabled.yaml](/example/redisfailover/bootstrapping-disabled.yaml) |
322327

323328
#### What is Bootstrapping?
324329
When a `bootstrapNode` is provided, the Operator will always set all of the defined Redis instances to replicate from the provided `bootstrapNode` host value.
@@ -338,7 +343,7 @@ When `allowSentinels` is provided, the Operator will also create the defined Sen
338343

339344
### Default versions
340345

341-
The image versions deployed by the operator can be found on the [defaults file](api/redisfailover/v1/defaults.go).
346+
The image versions deployed by the operator can be found on the [defaults file](/api/redisfailover/v1/defaults.go).
342347
## Cleanup
343348

344349
### Operator and CRD
@@ -363,9 +368,10 @@ kubectl delete redisfailover <NAME>
363368

364369
### Redis Operator
365370

366-
[![Redis Operator Image](https://quay.io/repository/spotahome/redis-operator/status "Redis Operator Image")](https://quay.io/repository/spotahome/redis-operator)
371+
[![Redis Operator Image](https://img.shields.io/docker/v/powerhome/redis-operator?sort=semver)](https://hub.docker.com/r/powerhome/redis-operator)
372+
367373
## Documentation
368374

369375
For the code documentation, you can lookup on the [GoDoc](https://godoc.org/github.com/spotahome/redis-operator).
370376

371-
Also, you can check more deeply information on the [docs folder](docs).
377+
Also, you can check more deeply information on the [docs folder](/docs).

0 commit comments

Comments
 (0)