Skip to content

Commit 504af77

Browse files
K8s: sys_resource revision (#1656)
* sys_resource revision * Update content/operate/kubernetes/deployment/helm.md Co-authored-by: David Dougherty <david.dougherty@redis.com> * Update content/operate/kubernetes/deployment/helm.md Co-authored-by: David Dougherty <david.dougherty@redis.com> * review suggestions * fix note formatting --------- Co-authored-by: David Dougherty <david.dougherty@redis.com>
1 parent 103a3b5 commit 504af77

File tree

6 files changed

+164
-136
lines changed

6 files changed

+164
-136
lines changed

content/operate/kubernetes/deployment/helm.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: Install Redis Enterprise for Kubernetes version 7.8.6 using Helm ch
99
linkTitle: Helm
1010
weight: 11
1111
---
12-
1312
Helm charts provide a simple way to install the Redis Enterprise for Kubernetes operator in just a few steps. For more information about Helm, go to [https://helm.sh/docs/](https://helm.sh/docs/).
1413

1514
{{<note>}} This feature is currently in public preview and is not supported on production workloads. Only new installations of the Redis operator are supported at this time. 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.{{</note>}}
@@ -21,6 +20,8 @@ Helm charts provide a simple way to install the Redis Enterprise for Kubernetes
2120
- [Kubernetes client (kubectl)](https://kubernetes.io/docs/tasks/tools/).
2221
- [Helm 3.10 or later](https://helm.sh/docs/intro/install/).
2322

23+
If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/allow-resource-adjustment" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.
24+
2425
### Example values
2526

2627
The steps below use the following placeholders to indicate command line parameters you must provide:

content/operate/kubernetes/deployment/openshift/openshift-cli.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description: Redis Enterprise for Kubernetes and cluster can be installed via CL
1010
linkTitle: OpenShift CLI
1111
weight: 60
1212
---
13+
1314
Use these steps to set up a Redis Enterprise Software cluster with OpenShift.
1415

1516
## Prerequisites
@@ -19,6 +20,10 @@ Use these steps to set up a Redis Enterprise Software cluster with OpenShift.
1920

2021
To see which version of Redis Enterprise for Kubernetes supports your OpenShift version, see [Supported Kubernetes distributions]({{< relref "/operate/kubernetes/reference/supported_k8s_distributions" >}}).
2122

23+
{{<note>}}
24+
If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/enable-privileged-mode" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.
25+
{{</note>}}
26+
2227
## Deploy the operator
2328

2429
1. Create a new project.
@@ -70,16 +75,18 @@ DO NOT modify or delete the StatefulSet created during the deployment process. D
7075

7176
## Security context constraints
7277

73-
Upgrades to versions 7.22.0-6 and later run in **unprivileged mode** without any additional permissions or capabilities. If you don't specifally require additional capabilities, we recommend you maintain the default unprivileged mode, as its more secure. After upgrading, remove the existing `redis-enterprise-scc-v2` SCC and unbind it from the REC service account.
74-
75-
To enable privileged mode, see [Enable privileged mode > OpenShift upgrades]({{<relref "/operate/kubernetes/security/enable-privileged-mode#new-openshift-installations">}}).
78+
Versions 7.22.0-6 and later run in without permissions to [allow automatic resource adjustment]({{<relref "content/operate/kubernetes/security/allow-resource-adjustment">}}). If you use the recommended default security constraints, remove the existing `redis-enterprise-scc-v2` SCC and unbind it from the REC service account after upgrading.
7679

7780
## Create a Redis Enterprise cluster custom resource
7881

7982
1. Apply the `RedisEnterpriseCluster` resource file ([rec_rhel.yaml](https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/openshift/rec_rhel.yaml)).
8083

8184
You can rename the file to `<your_cluster_name>.yaml`, but it is not required. Examples below use `<rec_rhel>.yaml`. [Options for Redis Enterprise clusters]({{< relref "/operate/kubernetes/reference/redis_enterprise_cluster_api" >}}) has more info about the Redis Enterprise cluster (REC) custom resource, or see the [Redis Enterprise cluster API]({{<relref "/operate/kubernetes/reference/redis_enterprise_cluster_api">}}) for a full list of options.
8285

86+
{{<note>}}
87+
If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/enable-privileged-mode" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.
88+
{{</note>}}
89+
8390
The REC name cannot be changed after cluster creation.
8491

8592
{{<note>}}
@@ -88,6 +95,10 @@ Each Redis Enterprise cluster requires at least 3 nodes. Single-node RECs are no
8895

8996
2. Apply the custom resource file to create your Redis Enterprise cluster.
9097

98+
{{<note>}}
99+
If you enabled automatic resource adjustment in your configuration, this step will trigger the operator to apply elevated capabilities. Ensure your security context allows it.
100+
{{</note>}}
101+
91102
```sh
92103
oc apply -f <rec_rhel>.yaml
93104
```

content/operate/kubernetes/deployment/openshift/openshift-operatorhub.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ description: OpenShift provides the OperatorHub where you can install the Redis
1010
linkTitle: OpenShift OperatorHub
1111
weight: 70
1212
---
13-
1413
You can deploy Redis Enterprise for Kubernetes from the Red Hat OpenShift CLI. You can also use a UI, [OperatorHub](https://docs.openshift.com/container-platform/4.11/operators/index.html) (Red Hat) to install operators and create custom resources.
1514

15+
{{<note>}}If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/enable-privileged-mode" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.{{</note>}}
16+
1617
To see which version of Redis Enterprise for Kubernetes supports your OpenShift version, see [Supported Kubernetes distributions]({{< relref "/operate/kubernetes/reference/supported_k8s_distributions" >}}).
1718

1819
## Install the Redis Enterprise operator
@@ -45,19 +46,19 @@ To see which version of Redis Enterprise for Kubernetes supports your OpenShift
4546

4647
## Security context constraints
4748

48-
Upgrades to versions 7.22.0-6 and later run in **unprivileged mode** without any additional permissions or capabilities. If you don't specifally require additional capabilities, we recommend you maintain the default unprivileged mode, as its more secure. After upgrading, remove the existing `redis-enterprise-scc-v2` SCC and unbind it from the REC service account.
49-
50-
To enable privileged mode, see [Enable privileged mode > OpenShift upgrades]({{<relref "/operate/kubernetes/security/enable-privileged-mode#new-openshift-installations">}}).
49+
Versions 7.22.0-6 and later run in without permissions to [allow automatic resource adjustment]({{<relref "content/operate/kubernetes/security/allow-resource-adjustment">}}). If you use the recommended default security constraints, remove the existing `redis-enterprise-scc-v2` SCC and unbind it from the REC service account after upgrading.
5150

5251
## Create Redis Enterprise custom resources
5352

5453
The **Installed Operators**->**Operator details** page shows the provided APIs: **RedisEnterpriseCluster** and **RedisEnterpriseDatabase**. You can select **Create instance** to create custom resources using the OperatorHub interface.
5554

56-
Use the YAML view to create a custom resource file or let OperatorHub generate the YAML file for you by specifying your configuration options in the form view.
5755

58-
<note> The REC name cannot be changed after cluster creation.</note>
56+
Use the YAML view to create a custom resource file or let OperatorHub generate the YAML file for you by specifying your configuration options in the form view.
5957

60-
{{<note>}} In versions 6.4.2-4 and 6.4.2-5, REC creation might fail when using the form view due to an error related to the cluster level LDAP. To avoid this, use the YAML view.
58+
{{<note>}}
59+
If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/enable-privileged-mode" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.
6160
{{</note>}}
6261

62+
<note> The REC name cannot be changed after cluster creation.</note>
63+
6364
For more information on creating and maintaining Redis Enterprise custom resources, see [Redis Enterprise clusters (REC)]({{< relref "/operate/kubernetes/re-clusters/" >}}) and [Redis Enterprise databases (REDB)]({{< relref "/operate/kubernetes/re-databases/" >}}).

content/operate/kubernetes/deployment/quick-start.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: How to install Redis Enterprise Software for Kubernetes.
99
linkTitle: Kubernetes
1010
weight: 10
1111
---
12-
1312
To deploy Redis Enterprise Software for Kubernetes and start your Redis Enterprise cluster (REC), you need to do the following:
1413

1514
- Create a new namespace in your Kubernetes cluster.
@@ -27,7 +26,10 @@ To deploy Redis Enterprise for Kubernetes, you'll need:
2726
- minimum of three worker nodes
2827
- Kubernetes client (kubectl)
2928
- access to DockerHub, RedHat Container Catalog, or a private repository that can hold the required images.
30-
NOTE: If you are applying version 7.8.2-6 or above, check if the [OS](https://redis.io/docs/latest/operate/kubernetes/release-notes/7-8-2-releases/7-8-2-6-nov24/#breaking-changes) installed on the node is supported.
29+
30+
If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/allow-resource-adjustment" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.
31+
32+
{{<note>}}If you are applying version 7.8.2-6 or above, check if the [OS](https://redis.io/docs/latest/operate/kubernetes/release-notes/7-8-2-releases/7-8-2-6-nov24/#breaking-changes) installed on the node is supported.{{</note>}}
3133

3234
### Create a new namespace
3335

@@ -114,6 +116,10 @@ that contains cluster specifications.
114116

115117
The following example creates a minimal Redis Enterprise cluster. See the [RedisEnterpriseCluster API reference]({{<relref "/operate/kubernetes/reference/redis_enterprise_cluster_api">}}) for more information on the various options available.
116118

119+
{{<note>}}
120+
If you suspect your file descriptor limits are below 100,000, you must either manually increase limits or [Allow automatic resource adjustment]({{< relref "/operate/kubernetes/security/allow-resource-adjustment" >}}). Most major cloud providers and standard container runtime configurations set default file descriptor limits well above the minimum required by Redis Enterprise. In these environments, you can safely run without enabling automatic resource adjustment.
121+
{{</note>}}
122+
117123
1. Create a file that defines a Redis Enterprise cluster with three nodes.
118124

119125
{{<note>}}
@@ -151,6 +157,10 @@ Each cluster must have at least 3 nodes. Single-node RECs are not supported.
151157

152158
See the [Redis Enterprise hardware requirements]({{< relref "/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements" >}}) for more information on sizing Redis Enterprise node resource requests.
153159

160+
{{<note>}}
161+
If you enabled automatic resource adjustment in your configuration, this step will trigger the operator to apply elevated capabilities. Ensure your security context allows it.
162+
{{</note>}}
163+
154164
1. Apply your custom resource file in the same namespace as `my-rec.yaml`.
155165

156166
```sh
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- kubernetes
6+
description: Enable automatic system resource adjustments for Redis Enterprise to increase file descriptor limits.
7+
linkTitle: Auto resource adjustment
8+
title: Allow automatic resource adjustment
9+
weight: 98
10+
---
11+
12+
Redis Enterprise for Kubernetes 7.22.0-6 introduces the ability to run with automatic resource adjustment disabled, which drops all capabilities from the Redis Enterprise container and sets `allowPrivilegeEscalation` to `false`. All other security-related settings remain the same as in automatic resource adjustment enabled. Automatic resource adjustment disabled is the default for installations and upgrades of the Redis Enterprise operator for versions 7.22.0-6 and later.
13+
14+
## Default behavior
15+
16+
Automatic resource adjustment is disabled by default for installations and upgrades of the Redis Enterprise operator for versions 7.22.0-6 and later. This default behavior is in effect if REC spec has `allowAutoAdjustment` set to `false` or removed.
17+
18+
If automatic resource adjustment is disabled, the REC security context looks like this:
19+
20+
```yaml
21+
securityContext:
22+
allowPrivilegeEscalation: false
23+
capabilities:
24+
drop:
25+
- ALL
26+
privileged: false
27+
readOnlyRootFilesystem: false
28+
```
29+
30+
## Enable automatic resource adjustment
31+
32+
To allow the Redis Enterprise container to adjust system resource limits automatically, set `allowAutoAdjustment` to `true`. This will grant the container elevated capabilities such as `SYS_RESOURCE`. Note that changing this value on a running cluster will trigger a rolling update.
33+
34+
```yaml
35+
spec:
36+
securityContext:
37+
resourceLimits:
38+
allowAutoAdjustment: true
39+
```
40+
41+
Enabling automatic resource adjustment results in the following security context:
42+
43+
**Note:** Enabling `allowAutoAdjustment` grants the container the `SYS_RESOURCE` capability and permits privilege escalation.
44+
45+
```yaml
46+
securityContext:
47+
allowPrivilegeEscalation: true
48+
capabilities:
49+
add:
50+
- SYS_RESOURCE
51+
drop:
52+
- ALL
53+
privileged: false
54+
readOnlyRootFilesystem: false
55+
```
56+
57+
## OpenShift upgrades
58+
59+
If you're upgrading OpenShift to 7.22.0-6, update your existing SCC (security context constraint).
60+
61+
If running with automatic resource adjustment disabled, remove the custom `redis-enterprise-scc-v2` SCC and unbind it from the REC service account after you complete the upgrade.
62+
63+
```sh
64+
oc delete scc/redis-enterprise-scc-v2
65+
```
66+
67+
```sh
68+
oc adm policy remove-scc-from-user redis-enterprise-scc-v2 -z <service-account-name>
69+
```
70+
71+
If running with automatic resource adjustment enabled, manually reapply the [security context constraints (SCC)](https://docs.openshift.com/container-platform/4.8/authentication/managing-security-context-constraints.html) file ([`scc.yaml`]({{< relref "/operate/kubernetes/deployment/openshift/openshift-cli#deploy-the-operator" >}})).
72+
73+
```sh
74+
oc apply -f openshift/scc.yaml
75+
```
76+
77+
```sh
78+
oc adm policy add-scc-to-user redis-enterprise-scc-v2 \
79+
system:serviceaccount:<my-project>:<rec-name>
80+
```
81+
82+
## New OpenShift installations
83+
84+
New installations of Redis Enterprise for Kubernetes 7.22.0-6 and later automatically run with automatic resource adjustment disabled, using a built-in `nonroot-v2` which is more secure and less permissive.
85+
86+
To enable automatic resource adjustment after installation, apply and grant permissions to the `redis-enterprise-scc-v2` SCC.
87+
88+
1. Apply the `scc.yaml` file.
89+
90+
{{<warning>}}
91+
Do not edit this file.
92+
{{</warning>}}
93+
94+
```sh
95+
oc apply -f openshift/scc.yaml
96+
```
97+
98+
You should see the following output:
99+
100+
```sh
101+
securitycontextconstraints.security.openshift.io "redis-enterprise-scc-v2" configured
102+
```
103+
104+
1. Provide the operator permissions for the pods.
105+
106+
```sh
107+
oc adm policy add-scc-to-user redis-enterprise-scc-v2 \
108+
system:serviceaccount:<my-project>:<rec>
109+
```
110+
111+
## SYS_RESOURCE
112+
113+
Some Redis Enterprise processes may require the `SYS_RESOURCE` capability to raise resource limits, such as the maximum number of open file descriptors.
114+
115+
Some Redis Enterprise processes require the ability to open at least 100,000 file descriptors. If the default is lower and `SYS_RESOURCE` is not enabled, these processes may fail.
116+
117+
## Choose whether to enable automatic resource adjustment
118+
119+
Use the following guidance to decide whether to enable automatic resource adjustment:
120+
121+
- If you're running on a major cloud provider such as AWS, GKE, or AKS, automatic resource adjustment disabled is likely sufficient.
122+
- If you're running on-prem or using Kubespray, verify your file descriptor limits. You can:
123+
- Configure limits manually and use automatic resource adjustment disabled.
124+
- Enable automatic resource adjustment to allow Redis Enterprise to increase limits, which requires privilege escalation.
125+
126+
If you are already running a Redis Enterprise cluster on Kubernetes, your worker nodes are likely configured correctly. In this case, it is safe to upgrade the operator and use automatic resource adjustment disabled.
127+
128+
Based on our testing, all major cloud providers configure Kubernetes worker nodes with file descriptor limits well above the required minimum. These environments typically work without enabling automatic resource adjustment. The only known exception is clusters created with [Kubespray](https://kubespray.io/#/), which sets default file descriptor limits below the required 100,000. If you use Kubespray with default settings, you must run the operator with automatic resource adjustment enabled.

0 commit comments

Comments
 (0)