Skip to content

Commit 86513c1

Browse files
alon-zadaUbuntu
and
Ubuntu
authored
promoting version 7.2.4-12 (#271)
* promoting version 7.2.4-12 * Remove. --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-48-195.eu-central-1.compute.internal>
1 parent 1cdfab5 commit 86513c1

27 files changed

+191
-690
lines changed

active_active_database_readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This document describes how to deploy an Active-Active database with Redis Enter
2020
* [Update existing participating cluster (RERC) details](#update-existing-participating-cluster-rerc-details)
2121
* [Update existing participating cluster (RERC) secret](#update-existing-participating-cluster-rerc-secret)
2222
* [Active-Active database with Redis modules](#active-active-database-with-redis-modules)
23+
* [Upgrade REC with Active-Active database](#upgrade-rec-with-active-active-database)
2324
* [Test your Active-Active database](#test-your-active-active-database)
2425
* [Limitations](#limitations)
2526

@@ -725,6 +726,16 @@ To enable modules for Active-Active databases, set a boolean environment variabl
725726
Important note:
726727
upgrading modules with Active-Active databases is currently not supported via the operator, to upgrade please use the RS APIs directly and after the module has successfully upgraded update the module version on the REAADB custom resource.
727728

729+
## Upgrade REC with Active-Active database
730+
731+
Upgrading REC with REAADBs is supported.
732+
Please follow [upgrade Redis Enterprise Cluster documentation](https://docs.redis.com/latest/kubernetes/re-clusters/upgrade-redis-cluster/).
733+
734+
Notes:
735+
- It is recommended to upgrade all of the participating clusters to the same operator version.
736+
- [Optional] - Please view following documentation regarding upgrade the Active-Active database [here](https://docs.redis.com/latest/rs/installing-upgrading/upgrading/upgrade-active-active/)
737+
- In case you are upgrading from version with the Active-Active database controller as public preview you may remove the following flags from the environment variables: `ACTIVE_ACTIVE_DATABASE_CONTROLLER_ENABLED` and `REMOTE_CLUSTER_CONTROLLER_ENABLED`, and in case the alpha features flag is enabled only for the REC 'ingressOrRoutesSpec' field you may remove the: `ENABLE_ALPHA_FEATURES` as well.`
738+
728739
## Test your Active-Active database
729740

730741
The easiest way to test your Active-Active database is to set a key-value pair in one database and retrieve it from the other.

admission/README.md

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,3 @@
1-
# Redis Enterprise Admission Controller
1+
# Redis Enterprise admission controller
22

3-
Redis Labs' Redis Enterprise Operator provides an installable admission control that can be used to verify RedisEnterpriseDatabase, RedisEnterpriseActiveActiveDatabase and RedisEnterpriseRemoteCluster resources on creation and modification for correctness. This prevents end users from creating syntatically valid but functionally invalid database configurations. The admission control leverages Kubernetes' built in [Dynamic Admission Control](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/).
4-
5-
## Hooking up the Admission controller directly with Kubernetes
6-
**NOTE**: This only has to be done the first time setting up the redis enterprise operator, it can be skipped on update
7-
8-
1. Wait for the secret to be created
9-
10-
```shell script
11-
kubectl get secret admission-tls
12-
NAME TYPE DATA AGE
13-
admission-tls Opaque 2 2m43s
14-
```
15-
16-
2. Enable the Kubernetes webhook using the generated certificate stored in a kubernetes secret
17-
18-
**NOTE**: One must replace REPLACE_WITH_NAMESPACE in the following command with the namespace the REC was installed into.
19-
20-
```shell script
21-
# save cert
22-
CERT=`kubectl get secret admission-tls -o jsonpath='{.data.cert}'`
23-
sed 's/NAMESPACE_OF_SERVICE_ACCOUNT/REPLACE_WITH_NAMESPACE/g' webhook.yaml | kubectl create -f -
24-
25-
# create patch file
26-
cat > modified-webhook.yaml <<EOF
27-
webhooks:
28-
- name: redisenterprise.admission.redislabs
29-
clientConfig:
30-
caBundle: $CERT
31-
admissionReviewVersions: ["v1beta1"]
32-
EOF
33-
# patch webhook with caBundle
34-
kubectl patch ValidatingWebhookConfiguration redis-enterprise-admission --patch "$(cat modified-webhook.yaml)"
35-
```
36-
37-
## Verifying Installation
38-
39-
In order to verify that the all the components of the Admission Controller are installed correctly, we will try to apply an invalid resource that should force the admission controller to reject it. If it applies succesfully, it means the admission controller has not been hooked up correctly.
40-
41-
```shell script
42-
$ kubectl apply -f - << EOF
43-
apiVersion: app.redislabs.com/v1alpha1
44-
kind: RedisEnterpriseDatabase
45-
metadata:
46-
name: redis-enterprise-database
47-
labels:
48-
app: redis-enterprise
49-
spec:
50-
evictionPolicy: illegal
51-
defaultUser: false
52-
EOF
53-
```
54-
55-
This must fail with an error output by the admission webhook redisenterprise.admission.redislabs that is being denied because 'illegal' is not a valid eviction policy.
56-
57-
```shell script
58-
Error from server: error when creating "STDIN": admission webhook "redisenterprise.admission.redislabs" denied the request: eviction_policy: u'illegal' is not one of [u'volatile-lru', u'volatile-ttl', u'volatile-random', u'allkeys-lru', u'allkeys-random', u'noeviction', u'volatile-lfu', u'allkeys-lfu']
59-
```
60-
61-
## Upgrading from previous version
62-
63-
In Redis Enterprise Operator versions 6.4.X and above, the admission webhook has been renamed from `redb-admission` to `redis-enterprise-admission`.
64-
The reason for that is to reflect that the updated admission webhook now verifies multiple resources beyond RedisEnterpriseDatabase, including RedisEnterpriseActiveActiveDatabase and RedisEnterpriseRemoteCluster resources as well. The previous version only verified RedisEnterpriseDatabases.
65-
66-
If you're using version 6.4.X or above, make sure to delete the old `redb-admission` ValidatingWebhookConfiguration and apply the updated webhook.
3+
This content has moved to [docs.redis.com](https://docs.redis.com/latest/); see [Enable the admission controller](https://docs.redis.com/latest/kubernetes/deployment/quick-start/#enable-the-admission-controller).

admission/webhook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ webhooks:
1717
resources: ["redisenterprisedatabases", "redisenterpriseactiveactivedatabases", "redisenterpriseremoteclusters"]
1818
clientConfig:
1919
service:
20-
namespace: NAMESPACE_OF_SERVICE_ACCOUNT
20+
namespace: OPERATOR_NAMESPACE
2121
name: admission
2222
path: /admission
2323
caBundle: "" # Fill in with BASE64 encoded signed cert

bundle.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ spec:
245245
ingressOrRouteMethodStatus:
246246
description: The ingressOrRouteSpec/ActiveActive spec method that exist
247247
type: string
248+
redisEnterpriseIPFamily:
249+
type: string
248250
spec:
249251
description: RedisEnterpriseClusterSpec defines the desired state of RedisEnterpriseCluster
250252
properties:
@@ -365,6 +367,14 @@ spec:
365367
true. Note that this field is cleared automatically after the cluster
366368
is recovered
367369
type: boolean
370+
redisEnterpriseIPFamily:
371+
description: Reserved, future use, only for use if instructed by Redis.
372+
IPFamily dictates what IP family to choose for pods' internal
373+
and external communication.
374+
type: string
375+
enum:
376+
- IPv4
377+
- IPv6
368378
containerTimezone:
369379
description: Container timezone configuration. While the default timezone
370380
on all containers is UTC, this setting can be used to set the timezone
@@ -7769,6 +7779,8 @@ spec:
77697779
ldap:
77707780
type: boolean
77717781
type: object
7782+
redisEnterpriseIPFamily:
7783+
type: string
77727784
spec:
77737785
properties:
77747786
activeActive:
@@ -7848,6 +7860,11 @@ spec:
78487860
type: string
78497861
clusterRecovery:
78507862
type: boolean
7863+
redisEnterpriseIPFamily:
7864+
type: string
7865+
enum:
7866+
- IPv4
7867+
- IPv6
78517868
containerTimezone:
78527869
properties:
78537870
propagateHost:
@@ -14854,6 +14871,8 @@ apiVersion: apiextensions.k8s.io/v1
1485414871
kind: CustomResourceDefinition
1485514872
metadata:
1485614873
name: redisenterprisedatabases.app.redislabs.com
14874+
labels:
14875+
app: redis-enterprise
1485714876
spec:
1485814877
group: app.redislabs.com
1485914878
names:
@@ -16462,7 +16481,7 @@ spec:
1646216481
serviceAccountName: redis-enterprise-operator
1646316482
containers:
1646416483
- name: redis-enterprise-operator
16465-
image: redislabs/operator:7.2.4-7
16484+
image: redislabs/operator:7.2.4-12
1646616485
command:
1646716486
- operator-root
1646816487
- operator
@@ -16512,7 +16531,7 @@ spec:
1651216531
drop:
1651316532
- ALL
1651416533
- name: admission
16515-
image: redislabs/operator:7.2.4-7
16534+
image: redislabs/operator:7.2.4-12
1651616535
command:
1651716536
- operator-root
1651816537
- admission
@@ -16532,6 +16551,10 @@ spec:
1653216551
valueFrom:
1653316552
fieldRef:
1653416553
fieldPath: metadata.namespace
16554+
- name: POD_NAME
16555+
valueFrom:
16556+
fieldRef:
16557+
fieldPath: metadata.name
1653516558
resources:
1653616559
limits:
1653716560
cpu: 1000m

cluster_credentials.md

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,3 @@
11
# Management of the Redis Enterprise Cluster credentials
2-
## Background
3-
When the operator creates a Redis Enterprise Cluster (REC) it generates random credentials that are used by the operator to perform operations on the Redis Enterprise Cluster using the cluster APIs.
4-
The credentials are saved in a K8s secret (or Vault, see [README](vault/README.md)). When a K8s secret is used, the secret name default to the name of the Redis Enterprise Cluster.
5-
## Using the Redis Enterprise Cluster Credentials
6-
The credentials can be used to access the Redis Enterprise Cluster UI or API. Make sure connectivity is configured to the cluster pods using an appropriate service (or by a solution such as kubectl port forwarding). To inspect the random username and password created by the operator, use kubectl:
7-
```
8-
$ kubectl get secret rec -o jsonpath='{.data}'
9-
map[password:MVUyTjd1Mm0= username:ZGVtb0ByZWRpc2xhYnMuY29t]
10-
$ echo MVUyTjd1Mm0= | base64 --decode
11-
```
12-
> Note - other utilities to view secrets are available
132

14-
## Changing the Redis Enterprise Cluster Credentials
15-
### Replacing the password
16-
Please follow the following steps:
17-
1. Take note of the current password, see above
18-
2. Exec into a Redis Enterprise Cluster node pod using the following command:
19-
```
20-
kubectl exec -it <Redis Enterprise Cluster resource name>-0 bash
21-
```
22-
3. Within the pod console, run a command to add the new password as supported for the existing user, replace with the existing credentials and the new password:
23-
```
24-
REC_USER="`cat /opt/redislabs/credentials/username`"; REC_PASSWORD="`cat /opt/redislabs/credentials/password`";curl -k --request POST --url https://localhost:9443/v1/users/password -u "$REC_USER:$REC_PASSWORD" --header 'Content-Type: application/json' --data "{\"username\":\"$REC_USER\",\"old_password\":\"$REC_PASSWORD\", \"new_password\":\"<NEW PASSWORD>\"}"
25-
```
26-
4. Update the cluster credential secret: using the commands ran outside of the Redis Enterprise Cluster node pod:
27-
> Note: For Vault users, see the instruction described [below](./cluster_credentials.md#creds_with_vault) and proceed to the next step.
28-
29-
a. Save the existing username to a text file (replace <current username> with actual).
30-
```
31-
echo -n "<current username>" > username
32-
```
33-
b. Save the new password to a text file (replace <new password> with actual).
34-
```
35-
echo -n "<new password>" > password
36-
```
37-
c. Update the secret:
38-
```
39-
kubectl create secret generic <cluster secret name> --from-file=./username --from-file=./password --dry-run -o yaml | kubectl apply -f -
40-
```
41-
5. Wait 5 minutes to make sure all components have read the new password from the updated secret
42-
6. in case this cluster is participating in Active-Active database via REAADB follow the instructions [here](active_active_database_readme.md) under `Update existing participating cluster (RERC) secret`.
43-
7. Exec into a Redis Enterprise Cluster node pod (see above) and run the following command to remove the previous password so only the new one applies. Important: replace OLD PASSWORD with the one being replaced, see step 1 above.
44-
```
45-
REC_USER="`cat /opt/redislabs/credentials/username`"; REC_PASSWORD="`cat /opt/redislabs/credentials/password`";curl -k --request DELETE --url https://localhost:9443/v1/users/password -u "$REC_USER:$REC_PASSWORD" --header 'Content-Type: application/json' --data "{\"username\":\"$REC_USER\",\"old_password\":\"<OLD PASSWORD\"}"
46-
```
47-
> Note: the username to be used with the K8s secret is the email displayed on the Redis Enterprise UI
48-
49-
> Note: this procedure is only supported for version 6.0.20-5 or above
50-
### Replacing the password and the username
51-
Please follow the following steps:
52-
1. Log into the Redis Enterprise Cluster UI using the credentials as explained above.
53-
2. Add another admin user, choose a password
54-
3. Set the new username with the Redis Enterprise Cluster spec (username field)
55-
4. Update the cluster credential secret:
56-
> Note: For Vault users, see the instruction described [below](#creds_with_vault) and proceed to the next step.
57-
58-
a. Save the new username to a text file (replace <new username> with actual).
59-
```
60-
echo -n "<new username>" > username
61-
```
62-
b. Save the new password to a text file (replace <new password> with actual).
63-
```
64-
echo -n "<new password>" > password
65-
```
66-
c. Update the secret:
67-
```
68-
kubectl create secret generic <cluster secret name> --from-file=./username --from-file=./password --dry-run -o yaml | kubectl apply -f -
69-
```
70-
> Note: the username to be used with the K8s secret is the email displayed on the Redis Enterprise UI
71-
5. Wait 5 minutes to make sure all components have read the new password from the updated secret
72-
6. in case this cluster is participating in Active-Active database via REAADB follow the instructions [here](active_active_database_readme.md) under `Update existing participating cluster (RERC) secret`.
73-
7. Delete the previous admin user using the Redis Enterprise Cluster UI
74-
> Note: this procedure is only supported for version 6.0.20-5 or above
75-
> Note: the operator might log errors in the time period between updating the username in the REC spec and the secret update
76-
77-
<a name="creds_with_vault"></a>
78-
### Updating the credentials secret in Vault
79-
For users who store secrets in Vault, update the Vault secret containing the Redis Enterprise Cluster's credentials with the following key-value pairs: username:<desired_username>, password:<desired_password>.
80-
For more information about Vault integration with the Redis Enterprise Cluster see [README](vault/README.md#deployment_rec).
3+
This content has moved to [docs.redis.com](https://docs.redis.com/latest/); see [Manage Redis Enterprise cluster (REC) credentials](https://docs.redis.com/latest/kubernetes/security/manage-rec-credentials/).

crds/rec_crd.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ spec:
150150
ingressOrRouteMethodStatus:
151151
description: The ingressOrRouteSpec/ActiveActive spec method that exist
152152
type: string
153+
redisEnterpriseIPFamily:
154+
type: string
153155
spec:
154156
description: RedisEnterpriseClusterSpec defines the desired state of RedisEnterpriseCluster
155157
properties:
@@ -270,6 +272,14 @@ spec:
270272
true. Note that this field is cleared automatically after the cluster
271273
is recovered
272274
type: boolean
275+
redisEnterpriseIPFamily:
276+
description: Reserved, future use, only for use if instructed by Redis.
277+
IPFamily dictates what IP family to choose for pods' internal
278+
and external communication.
279+
type: string
280+
enum:
281+
- IPv4
282+
- IPv6
273283
containerTimezone:
274284
description: Container timezone configuration. While the default timezone
275285
on all containers is UTC, this setting can be used to set the timezone
@@ -7674,6 +7684,8 @@ spec:
76747684
ldap:
76757685
type: boolean
76767686
type: object
7687+
redisEnterpriseIPFamily:
7688+
type: string
76777689
spec:
76787690
properties:
76797691
activeActive:
@@ -7753,6 +7765,11 @@ spec:
77537765
type: string
77547766
clusterRecovery:
77557767
type: boolean
7768+
redisEnterpriseIPFamily:
7769+
type: string
7770+
enum:
7771+
- IPv4
7772+
- IPv6
77567773
containerTimezone:
77577774
properties:
77587775
propagateHost:

crds/redb_crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
name: redisenterprisedatabases.app.redislabs.com
5+
labels:
6+
app: redis-enterprise
57
spec:
68
group: app.redislabs.com
79
names:

0 commit comments

Comments
 (0)