You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,20 +16,21 @@ All dependencies have been vendored, so there's no need to any additional downlo
16
16
## Operator deployment on Kubernetes
17
17
18
18
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).
20
20
21
21
### Using the Helm chart
22
22
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
**NOTE:** This doc section is outdated, please create a PR to update it after you actually do it!
47
+
45
48
To create the operator, you can directly create it with kubectl:
46
49
47
50
```
@@ -54,6 +57,8 @@ This will create a deployment named `redisoperator`.
54
57
55
58
### Using kustomize
56
59
60
+
**NOTE:** This doc section is outdated, please create a PR to update it after you actually do it!
61
+
57
62
The kustomize setup included in this repo is highly customizable using [components](https://kubectl.docs.kubernetes.io/guides/config_management/components/),
58
63
but it also comes with a few presets (in the form of overlays) supporting the most common use cases.
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
118
123
119
124
The operator has the ability of add persistence to Redis data. By default an `emptyDir` will be used, so the data is not saved.
120
125
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.
122
127
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).
124
129
125
130
### NodeAffinity and Tolerations
126
131
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).
128
133
129
134
## Topology Spread Contraints
130
135
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/).
132
137
133
138
### Custom configurations
134
139
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).
136
141
137
142
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).
138
143
@@ -147,21 +152,21 @@ In order to have the ability of this configurations to be changed "on the fly",
147
152
148
153
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.
149
154
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).
151
156
152
157
**Important**: the configmap has to be in the same namespace. The configmap has to have a `shutdown.sh` data, containing the script.
153
158
154
159
### Custom SecurityContext
155
160
156
161
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.
157
162
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/)
159
164
160
165
### Custom containerSecurityContext at container level
161
166
162
167
By default Kubernetes will run containers with default docker capabilities for exemple, this is not always desirable.
163
168
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)
165
170
166
171
### Custom command
167
172
@@ -170,7 +175,7 @@ By default, redis and sentinel will be called with the basic command, giving the
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).
174
179
175
180
### Custom Priority Class
176
181
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
181
186
### Custom Pod Annotations
182
187
By default, no pod annotations will be applied to Redis nor Sentinel pods.
183
188
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).
185
190
### Custom Service Annotations
186
191
By default, no service annotations will be applied to the Redis nor Sentinel services.
187
192
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).
189
194
190
195
### Allow Operator to Be Namespace-Scoped
191
196
By default operator is cluster wide.
@@ -209,7 +214,7 @@ to resource is creates you can modify the labelWhitelist option in the spec.
209
214
210
215
By default specifying no whitelist or an empty whitelist will cause all labels to still be copied as not to break backwards compatibility.
211
216
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
213
218
[here](https://github.com/google/re2/wiki/Syntax) for a syntax reference.
214
219
215
220
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
315
320
This `bootstrapNode` can be configured as follows:
| 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)|
322
327
323
328
#### What is Bootstrapping?
324
329
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
338
343
339
344
### Default versions
340
345
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).
0 commit comments