Skip to content

Commit dd0f61f

Browse files
create REC with helm (#3288)
1 parent b7e4058 commit dd0f61f

1 file changed

Lines changed: 132 additions & 19 deletions

File tree

  • content/operate/kubernetes/deployment

content/operate/kubernetes/deployment/helm.md

Lines changed: 132 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ The steps below use the following placeholders to indicate command line paramete
3131
- `<namespace-name>` is the name of the new namespace the Redis operator will run in (example: `ns1`)
3232
- `<path-to-chart>` is the filepath to the Helm chart, if it is stored in a local directory (example: `/home/charts/redis-enterprise-operator`)
3333

34-
## Install
34+
## Install the operator
35+
36+
Below are several ways to install the operator using Helm. To create the REC in the same step, see [Create the REC at install time](#create-the-rec-at-install-time).
37+
38+
- [Install from the Redis Helm repository](#install-from-the-redis-helm-repository)
39+
- [Install from local directory](#install-from-local-directory)
40+
- [Specify values during install](#specify-values-during-install)
41+
- [Install with values file](#install-with-values-file)
42+
43+
### Install from the Redis Helm repository
3544

3645
1. Add the Redis repository.
3746

@@ -75,7 +84,7 @@ To monitor the installation add the `--debug` flag. The installation runs severa
7584
2. Install the Helm chart, overriding specific value defaults using `--set`.
7685

7786
```sh
78-
helm install <operator-name> <repo-name>/redis-enterprise-operator \
87+
helm install <release-name> <repo-name>/redis-enterprise-operator \
7988
--version <chart-version> \
8089
--namespace <namespace-name> \
8190
--create-namespace
@@ -92,36 +101,61 @@ helm install <operator-name> <repo-name>/redis-enterprise-operator \
92101
3. Install the chart with the `--values` option.
93102

94103
```sh
95-
helm install <operator-name> <repo-name>/redis-enterprise-operator \
104+
helm install <release-name> <repo-name>/redis-enterprise-operator \
96105
--version <chart-version> \
97106
--namespace <namespace-name> \
98107
--create-namespace \
99108
--values <path-to-values-file>
100109
```
101110

102-
## Migrate from a non-Helm installation
111+
## Create the REC at install time
103112

104-
To migrate an existing non-Helm installation of the Redis Enterprise operator to a Helm-based installation:
113+
The chart can create the `RedisEnterpriseCluster` (REC) custom resource at install time, so a single `helm install` deploys both the operator and the cluster. To enable this, set `cluster.create` to `true` and define the cluster under `cluster.spec` in your values file. The `spec` field accepts any field from the `RedisEnterpriseCluster` CRD. For the full list, see the [RedisEnterpriseCluster API reference]({{<relref "/operate/kubernetes/reference/api/redis_enterprise_cluster_api">}}).
105114

106-
1. [Upgrade]({{<relref "operate/kubernetes/upgrade">}}) your existing Redis Enterprise operator to match the version of the Helm chart you want to install. Use the same non-Helm method you used for the original installation.
115+
{{<note>}}
116+
`cluster.create` defaults to `false`. When `false`, the chart installs only the operator and you create the REC yourself.
117+
{{</note>}}
107118

108-
2. [Install](#install) the Helm chart adding the `--take-ownership` flag:
119+
1. Create a values file with a `cluster` section. For example:
109120

110-
```sh
111-
helm install <release-name> <repo-name>/redis-enterprise-operator --take-ownership
112-
```
121+
```yaml
122+
cluster:
123+
create: true
124+
spec:
125+
nodes: 3
126+
redisEnterpriseImageSpec:
127+
repository: redislabs/redis
128+
redisEnterpriseServicesRiggerImageSpec:
129+
repository: redislabs/k8s-controller
130+
bootstrapperImageSpec:
131+
repository: redislabs/operator
132+
```
113133
114-
- The `--take-ownership` flag is available with Helm versions 3.18 or later.
115-
- This flag is only needed for the first installation of the chart. Subsequent upgrades don't require this flag.
116-
- Use the `helm install` command, not `helm upgrade`.
134+
2. Install the chart with the values file.
117135
118-
3. Delete the old `ValidatingWebhookConfiguration` object from the previous non-Helm installation:
136+
```sh
137+
helm install <release-name> <repo-name>/redis-enterprise-operator \
138+
--version <chart-version> \
139+
--namespace <namespace-name> \
140+
--create-namespace \
141+
--values <path-to-values-file>
142+
```
119143

120-
```sh
121-
kubectl delete validatingwebhookconfiguration redis-enterprise-admission
122-
```
144+
The chart runs a Kubernetes Job to create the REC. The Job deletes itself on success.
123145

124-
This step is only needed when the `admission.limitToNamespace` chart value is set to `true` (the default). In this case, the webhook object installed by the chart is named `redis-enterprise-admission-<namespace>`, and the original webhook object, named `redis-enterprise-admission`, becomes redundant. If `admission.limitToNamespace` is set to `false`, the webhook installed by the chart is named `redis-enterprise-admission`, and the existing webhook object is reused.
146+
3. Confirm the operator deployment is running.
147+
148+
```sh
149+
kubectl get deployment redis-enterprise-operator --namespace <namespace-name>
150+
```
151+
152+
4. Wait for the REC to reach the `Running` state. Initialization takes about a minute.
153+
154+
```sh
155+
kubectl get rec --namespace <namespace-name>
156+
```
157+
158+
To update or uninstall an REC created by the chart, see [Update an REC created by the chart](#update-an-rec-created-by-the-chart) and [Uninstall the REC and operator together](#uninstall-the-rec-and-operator-together).
125159

126160
## Upgrade the chart
127161

@@ -155,6 +189,43 @@ If your databases use user-defined modules (custom non-bundled modules), you mus
155189

156190
For more information and options when upgrading charts, see [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/).
157191

192+
### Update an REC created by the chart
193+
194+
If you used `cluster.create: true`, change REC settings by editing `cluster.spec` in your values file and running `helm upgrade`.
195+
196+
1. Update your values file. For example, to add labels:
197+
198+
```yaml
199+
cluster:
200+
create: true
201+
spec:
202+
nodes: 3
203+
redisEnterpriseImageSpec:
204+
repository: redislabs/redis
205+
redisEnterpriseServicesRiggerImageSpec:
206+
repository: redislabs/k8s-controller
207+
bootstrapperImageSpec:
208+
repository: redislabs/operator
209+
extraLabels:
210+
environment: production
211+
```
212+
213+
2. Apply the changes.
214+
215+
```sh
216+
helm upgrade <release-name> <repo-name>/redis-enterprise-operator \
217+
--namespace <namespace-name> \
218+
--values <path-to-values-file>
219+
```
220+
221+
Some REC fields trigger a StatefulSet rolling update. Others, such as `extraLabels`, take effect immediately.
222+
223+
3. Confirm the change.
224+
225+
```sh
226+
kubectl get rec <rec-name> --namespace <namespace-name> -o yaml
227+
```
228+
158229
## Uninstall
159230

160231
1. Delete any custom resources managed by the operator. See [Delete custom resources]({{<relref "operate/kubernetes/re-clusters/delete-custom-resources">}}) for detailed steps. You must delete custom resources in the correct order to avoid errors.
@@ -169,8 +240,50 @@ This removes all Kubernetes resources associated with the chart and deletes the
169240

170241
{{<note>}}Custom Resource Definitions (CRDs) installed by the chart are not removed during chart uninstallation. To remove them manually after uninstalling the chart, run `kubectl delete crds -l app=redis-enterprise`.{{</note>}}
171242

243+
### Uninstall the REC and operator together
244+
245+
When `cluster.create` is `true`, `helm uninstall` removes both the REC and the operator. You don't need to delete the REC first.
246+
247+
```sh
248+
helm uninstall <release-name> --namespace <namespace-name>
249+
```
250+
251+
Confirm all resources are gone.
252+
253+
```sh
254+
kubectl get all --namespace <namespace-name>
255+
```
256+
257+
{{<note>}}
258+
This applies only to RECs the chart created. If you created the REC outside the chart, follow [Delete custom resources]({{<relref "operate/kubernetes/re-clusters/delete-custom-resources">}}) before you run `helm uninstall`.
259+
{{</note>}}
260+
261+
## Migrate from a non-Helm installation
262+
263+
To migrate an existing non-Helm installation of the Redis Enterprise operator to a Helm-based installation:
264+
265+
1. [Upgrade]({{<relref "operate/kubernetes/upgrade">}}) your existing Redis Enterprise operator to match the version of the Helm chart you want to install. Use the same non-Helm method you used for the original installation.
266+
267+
2. [Install](#install-the-operator) the Helm chart adding the `--take-ownership` flag:
268+
269+
```sh
270+
helm install <release-name> <repo-name>/redis-enterprise-operator --take-ownership
271+
```
272+
273+
- The `--take-ownership` flag is available with Helm versions 3.18 or later.
274+
- This flag is only needed for the first installation of the chart. Subsequent upgrades don't require this flag.
275+
- Use the `helm install` command, not `helm upgrade`.
276+
277+
3. Delete the old `ValidatingWebhookConfiguration` object from the previous non-Helm installation:
278+
279+
```sh
280+
kubectl delete validatingwebhookconfiguration redis-enterprise-admission
281+
```
282+
283+
This step is only needed when the `admission.limitToNamespace` chart value is set to `true` (the default). In this case, the webhook object installed by the chart is named `redis-enterprise-admission-<namespace>`, and the original webhook object, named `redis-enterprise-admission`, becomes redundant. If `admission.limitToNamespace` is set to `false`, the webhook installed by the chart is named `redis-enterprise-admission`, and the existing webhook object is reused.
284+
172285
## Known limitations
173286

174-
- The steps for [creating the RedisEnterpriseCluster (REC)]({{<relref "operate/kubernetes/deployment/quick-start#create-a-redis-enterprise-cluster-rec">}}) and other custom resources remain the same.
287+
- Custom resources other than the REC must still be created using the standard process. The chart doesn't manage them.
175288
- The chart doesn't include configuration options for multiple namespaces, rack-awareness, and Vault integration. The steps for configuring these options remain the same.
176289
- The chart has had limited testing in advanced setups, including Active-Active configurations, air-gapped deployments, and IPv6/dual-stack environments.

0 commit comments

Comments
 (0)