Skip to content

Commit 2b0c3a7

Browse files
committed
enable cis-profile
1 parent f004a6f commit 2b0c3a7

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

docs/src/topics/flavors/rke2.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# RKE2
2+
3+
This flavor uses RKE2 for the kubernetes distribution. By default it configures the cluster
4+
with the [CIS profile](https://docs.rke2.io/security/hardening_guide#rke2-configuration):
5+
> Using the generic cis profile will ensure that the cluster passes the CIS benchmark (rke2-cis-1.XX-profile-hardened) associated with the Kubernetes version that RKE2 is running. For example, RKE2 v1.28.XX with the profile: cis will pass the rke2-cis-1.7-profile-hardened in Rancher.
6+
7+
```admonish warning
8+
Until [this upstream PR](https://github.com/rancher-sandbox/cluster-api-provider-rke2/pull/301) is merged, CIS profile enabling
9+
will not work for RKE2 versions >= v1.29.
10+
```
11+
212
## Specification
313
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 |
414
|-------------------------------|--------|--------------|-----------------------|------|------|

templates/flavors/rke2/rke2ConfigTemplate.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ spec:
99
agentConfig:
1010
version: ${KUBERNETES_VERSION}
1111
nodeName: '{{ ds.meta_data.label }}'
12+
cisProfile: ${CIS_PROFILE:-"cis-1.23"}
1213
# TODO: use MDS to get public and private IP instead because hostname ordering can't always be assumed
1314
preRKE2Commands:
1415
- |

templates/flavors/rke2/rke2ControlPlane.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
agentConfig:
3434
version: ${KUBERNETES_VERSION}
3535
nodeName: '{{ ds.meta_data.label }}'
36+
cisProfile: ${CIS_PROFILE:-"cis-1.23"}
3637
preRKE2Commands:
3738
- |
3839
mkdir -p /etc/rancher/rke2/config.yaml.d/

0 commit comments

Comments
 (0)