Skip to content

Commit da710ff

Browse files
Merge branch 'docs-update' into ci-review
2 parents 4c5d604 + 315b9df commit da710ff

File tree

21 files changed

+155
-196
lines changed

21 files changed

+155
-196
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: metric
2+
message: "Try to keep the Automated Readability Index (%s) below 8."
3+
link: https://en.wikipedia.org/wiki/Automated_readability_index
4+
5+
formula: |
6+
(4.71 * (characters / words)) + (0.5 * (words / sentences)) - 21.43
7+
8+
condition: "> 8"
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: metric
2+
message: "Try to keep the Coleman–Liau Index grade (%s) below 9."
3+
link: https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index
4+
5+
formula: |
6+
(0.0588 * (characters / words) * 100) - (0.296 * (sentences / words) * 100) - 15.8
7+
8+
condition: "> 9"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: metric
2+
message: "Try to keep the Flesch–Kincaid grade level (%s) below 8."
3+
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
4+
5+
formula: |
6+
(0.39 * (words / sentences)) + (11.8 * (syllables / words)) - 15.59
7+
8+
condition: "> 8"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: metric
2+
message: "Try to keep the Flesch reading ease score (%s) above 70."
3+
link: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
4+
5+
formula: |
6+
206.835 - (1.015 * (words / sentences)) - (84.6 * (syllables / words))
7+
8+
condition: "< 70"
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: metric
2+
message: "Try to keep the Gunning-Fog index (%s) below 10."
3+
link: https://en.wikipedia.org/wiki/Gunning_fog_index
4+
5+
formula: |
6+
0.4 * ((words / sentences) + 100 * (complex_words / words))
7+
8+
condition: "> 10"

.github/vale/Readability/LIX.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extends: metric
2+
message: "Try to keep the LIX score (%s) below 35."
3+
4+
link: https://en.wikipedia.org/wiki/Lix_(readability_test)
5+
# Very Easy: 20 - 25
6+
#
7+
# Easy: 30 - 35
8+
#
9+
# Medium: 40 - 45
10+
#
11+
# Difficult: 50 - 55
12+
#
13+
# Very Difficult: 60+
14+
formula: |
15+
(words / sentences) + ((long_words * 100) / words)
16+
17+
condition: "> 35"

.github/vale/Readability/SMOG.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extends: metric
2+
message: "Try to keep the SMOG grade (%s) below 10."
3+
link: https://en.wikipedia.org/wiki/SMOG
4+
5+
formula: |
6+
1.0430 * math.sqrt((polysyllabic_words * 30.0) / sentences) + 3.1291
7+
8+
condition: "> 10"

.github/vale/Readability/meta.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"feed": "https://github.com/errata-ai/Readability/releases.atom",
3+
"vale_version": ">=2.13.0"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Common/valid Slang
2+
[C|c]onfig
3+
airgap
4+
5+
# Acronyms
6+
STIG
7+
8+
# Tools
9+
[A|a]nsible
10+
11+
# Kubernetes
12+
Kubernetes
13+
[K|k]ubeconfig
14+
15+
# Linux
16+
[F|f]apolicyd
17+
containerd
18+
SELinux

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ venv/
55
.venv/
66

77
test_inventory*
8+
inventory*
89

910
sample_files/tarball_install/*
1011
!sample_files/tarball_install/README.md

.vale.ini

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
StylesPath = ./.github/vale
2+
3+
MinAlertLevel = suggestion
4+
Vocab = RGS
5+
6+
Packages = Readability
7+
8+
[*.md]
9+
BasedOnStyles = Vale, Readability
10+

README.md

+21-19
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ Thank you for your understanding and cooperation.
2929

3030
Ansible RKE2 (RKE Government) Playbook
3131
---------
32-
[![LINT](https://github.com/rancherfederal/rke2-ansible/actions/workflows/ci.yml/badge.svg)](https://github.com/rancherfederal/rke2-ansible/actions/workflows/ci.yml)
32+
[![LINT](https://github.com/rancherfederal/rke2-ansible/actions/workflows/lint.yml/badge.svg)](https://github.com/rancherfederal/rke2-ansible/actions/workflows/lint.yml?query=branch%3Amain)
33+
34+
[![Rocky 8](https://github.com/rancherfederal/rke2-ansible/actions/workflows/rocky8.yml/badge.svg)](https://github.com/rancherfederal/rke2-ansible/actions/workflows/rocky8.yml?query=branch%3Amain)
35+
36+
[![Ubuntu 20](https://github.com/rancherfederal/rke2-ansible/actions/workflows/ubuntu20.yml/badge.svg)](https://github.com/rancherfederal/rke2-ansible/actions/workflows/ubuntu20.yml?query=branch%3Amain)
3337

3438
RKE2, also known as RKE Government, is Rancher's next-generation Kubernetes distribution. This Ansible playbook installs RKE2 for both the control plane and workers.
3539

@@ -53,40 +57,35 @@ Deployment environment must have Ansible 2.9.0+
5357

5458
Usage
5559
-----
56-
Create a new directory based on the `sample` directory within the `inventory` directory:
60+
Create a new directory based on the one of the sample inventory directories within the `docs` directory:
5761

5862
```bash
59-
cp -R inventory/sample inventory/my-cluster
63+
cp -R ./docs/basic_sample_inventory ./inventory
6064
```
6165

62-
Second, edit `inventory/my-cluster/hosts.yaml` to match the system information gathered above. For example:
66+
Second, edit `inventory/hosts.yaml` to match the system information gathered above. For example:
6367

6468
```yaml
69+
---
6570
rke2_cluster:
6671
children:
6772
rke2_servers:
6873
hosts:
69-
server1.example.com:
74+
server0.example.com:
7075
rke2_agents:
7176
hosts:
72-
agent1.example.com:
73-
agent2.example.com:
74-
node_labels:
75-
- agent2Label=true"
76-
all:
77-
vars:
78-
install_rke2_version: v1.27.10+rke2r1
77+
agent0.example.com:
7978
```
8079
81-
If needed, you can also edit `inventory/my-cluster/group_vars/rke2_agents.yml` and `inventory/my-cluster/group_vars/rke2_servers.yml` to match your environment.
80+
If needed, you can also create `inventory/group_vars/rke2_agents.yml` and `inventory/my-cluster/group_vars/rke2_servers.yml` to match your environment.
8281

8382
Start provisioning of the cluster using the following command:
8483

8584
```bash
86-
ansible-playbook site.yml -i inventory/my-cluster/hosts.yml
85+
ansible-playbook site.yml -i inventory/hosts.yml
8786
```
88-
89-
More detailed information can be found [here](./docs/README.md)
87+
> [!NOTE]
88+
> More detailed information can be found [here](./docs/README.md)
9089

9190

9291
Tarball Install/Air-Gap Install
@@ -96,18 +95,21 @@ Air-Gap/Tarball install information can be found [here](./docs/tarball_install.m
9695

9796
Kubeconfig
9897
----------
99-
The root user will have the `kubeconfig` and `kubectl` made available, to access your cluster login into any server node and `kubectl` will be available for use immideatly.
98+
The root user will have the `kubeconfig` and `kubectl` made available, to access your cluster login into any server node and `kubectl` will be available for use immediately.
10099

101100

102101
Available configurations
103102
------------------------
104-
Variables should be set in `inventory/cluster/group_vars/rke2_agents.yml` and `inventory/cluster/group_vars/rke2_servers.yml`. See sample variables in `inventory/sample/group_vars` for reference.
103+
Variables should be set in `inventory/group_vars/rke2_agents.yml` and `inventory/group_vars/rke2_servers.yml`.
104+
105+
> [!NOTE]
106+
> More detailed information can be found [here](./docs/README.md)
105107

106108

107109
Uninstall RKE2
108110
---------------
109111
Note: Uninstalling RKE2 deletes the cluster data and all of the scripts.
110-
The offical documentation for fully uninstalling the RKE2 cluster can be found in the [RKE2 Documentation](https://docs.rke2.io/install/uninstall/).
112+
The official documentation for fully uninstalling the RKE2 cluster can be found in the [RKE2 Documentation](https://docs.rke2.io/install/uninstall/).
111113

112114
If you used this module to created the cluster and RKE2 was installed via yum, then you can attempt to run this command to remove all cluster data and all RKE2 scripts.
113115

ansible.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[defaults]
22
nocows = True
33
roles_path = ./roles
4-
inventory = ./inventory/my-cluster/hosts.yml
4+
inventory = ./inventory/hosts.yml
55

66
remote_tmp = $HOME/.ansible/tmp
77
local_tmp = $HOME/.ansible/tmp

docs/README.md

+35-24
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@
1010
- [Enabling CIS Modes](#enabling-cis-modes)
1111
- [Special Variables](#special-variables)
1212
- [RKE2 Config Variables](#rke2-config-variables)
13-
- [Defining a PSA Config](#defining-a-psa-config)
13+
- [Defining the RKE2 Version](#defining-the-rke2-version)
1414
- [Example](#example)
15-
- [Defining an Audit Policy](#defining-an-audit-policy)
15+
- [Defining a PSA Config](#defining-a-psa-config)
1616
- [Example](#example-1)
17+
- [Defining an Audit Policy](#defining-an-audit-policy)
18+
- [Example](#example-2)
1719
- [Adding Additional Cluster Manifests](#adding-additional-cluster-manifests)
1820
- [Pre-Deploy Example](#pre-deploy-example)
1921
- [Post-Deploy Example](#post-deploy-example)
20-
- [rke2\_install\_version](#rke2_install_version)
2122
- [Examples](#examples)
2223

2324
# Basic Usage
24-
There are two methods for consuming this repository, one is to simply clone the repository and edit it as neccessary, the other is to import it as a collection, both options are detailed below.
25+
There are two methods for consuming this repository, one is to simply clone the repository and edit it as necessary, the other is to import it as a collection, both options are detailed below.
2526

2627
> [!NOTE]
2728
> If you are looking for airgap or tarball installation instructions, please go [here](./tarball_install.md)
@@ -31,7 +32,7 @@ The simplest method for using this repository (as detailed in the main README.md
3132

3233

3334
## Importing
34-
The second method for using this project is to import it as a collection in your own `requirements.yaml` as this repository does contain a `galaxy.yaml`. To import it add the following to your `galaxy.yaml`:
35+
The second method for using this project is to import it as a collection in your own `requirements.yml` as this repository does contain a `galaxy.yml`. To import it add the following to your `galaxy.yml`:
3536
```yaml
3637
collections:
3738
- name: rancherfederal.rke2-ansible
@@ -51,7 +52,7 @@ Then you can call the RKE2 role in a play like so:
5152
5253
5354
# Defining Your Cluster
54-
This repository is not intended to be opinionated and as a rersult it is important you to have read and understand the [RKE2 docs](https://docs.rke2.io/) before moving forward, this documentation is not intended to be an exhaustive explanation of all possible RKE2 configuration options, it is up to the end user to ensure their options are valid.
55+
This repository is not intended to be opinionated and as a result it is important you to have read and understand the [RKE2 docs](https://docs.rke2.io/) before moving forward, this documentation is not intended to be an exhaustive explanation of all possible RKE2 configuration options, it is up to the end user to ensure their options are valid.
5556
5657
5758
## Minimal Cluster Inventory
@@ -71,7 +72,7 @@ This is the simplest possible inventory file and will deploy the latest availabl
7172
7273
7374
## Structuring Your Variable Files
74-
Configurations and variables can become lengthy annd unwieldy, as a general note of advice it is best to move variables into a `group_vars` folder.
75+
Configurations and variables can become lengthy and unwieldy, as a general note of advice it is best to move variables into a `group_vars` folder.
7576
```
7677
./inventory
7778
├── Cluser_A
@@ -92,7 +93,8 @@ Configurations and variables can become lengthy annd unwieldy, as a general note
9293
9394
9495
## Enabling SELinux
95-
Enabling SELinux in the playbook requires `seliux: true` be set in either the cluster, group, or host level config profiles (Please see [Special Variables](#special-variables) for more info). Though generally this should be set at the cluster and can be done like so:
96+
Enabling SELinux in the playbook requires `selinux: true` be set in either the cluster, group, or host level config profiles (Please see [Special Variables](#special-variables) for more info). Though generally this should be set at the cluster and can be done like so:
97+
__hosts.yml:__
9698
```yaml
9799
---
98100
all:
@@ -104,7 +106,8 @@ For more information please see the RKE2 documentation, [here](https://docs.rke2
104106

105107

106108
## Enabling CIS Modes
107-
Enabling the CIS tasks in the playbook requires a CIS profile be added to the ansible variables file. This can be placed in either the cluster, or group level config profiles (Please see [Special Variables](#special-variables) for more info). Below is an example, in the example the CIS profile is set at the group level, this ensures all server nodes run the CIS hardening profile tasks.
109+
Enabling the CIS tasks in the playbook requires a CIS profile be added to the ansible variables file. This can be placed in either the cluster, or group level config profiles (Please see [Special Variables](#special-variables) for more info). Below is an example, in the example the CIS profile is set at the group level, this ensures all server nodes run the CIS hardening profile tasks.
110+
__hosts.yml:__
108111
```yaml
109112
rke2_cluster:
110113
children:
@@ -132,17 +135,30 @@ There are three levels an RKE2 config variables can be placed in, that is `clust
132135
- `rke2_cluster.children.rke2_agents.vars.hosts.<host>.host_rke2_config`: Defines a list of node labels for a specific agent node
133136

134137
> [!NOTE]
135-
> Through the rest of these docs you may see references to `rke2_servers.yaml`, this is the group vars file for rke2_servers. This is functionally equivalent to `rke2_cluster.children.rke2_servers.vars`. References to `rke2_agents.yaml` is functionally equivalent to `rke2_cluster.children.rke2_agents.vars`
138+
> Through the rest of these docs you may see references to `rke2_servers.yml`, this is the group vars file for rke2_servers. This is functionally equivalent to `rke2_cluster.children.rke2_servers.vars`. References to `rke2_agents.yml` is functionally equivalent to `rke2_cluster.children.rke2_agents.vars`
136139

137140
It is important to understand these variables here are not special in the sense that they enable or disable certain functions in the RKE2 role, with one notable exception being the `profile` key. These variables are special in the sense that they will be condensed into a single config file on each node. Each node will end up with a merged config file comprised of `cluster_rke2_config`, `group_rke2_config`, and `host_rke2_config`.
138141

142+
143+
### Defining the RKE2 Version
144+
A version of RKE2 can be selected to be installed via the `all.vars.rke2_install_version` variable, please see the RKE2 repository for available [releases](releases).
145+
146+
#### Example
147+
__group_vars/all.yml:__
148+
```yaml
149+
---
150+
all:
151+
vars:
152+
rke2_install_version: v1.29.12+rke2r1
153+
```
154+
139155
### Defining a PSA Config
140-
In order to define a PSA config, server nodes will need to have the `rke2_pod_security_admission_config_file_path` variable defined, then the `pod-security-admission-config-file` will need to be defined in the rke2_config variable at the relevant level (please see [RKE Config Variables](#rke2-config-variables)).
156+
In order to define a PSA (Pod Security Admission) config, server nodes will need to have the `rke2_pod_security_admission_config_file_path` variable defined, then the `pod-security-admission-config-file` will need to be defined in the rke2_config variable at the relevant level (please see [RKE Config Variables](#rke2-config-variables)).
141157

142158
#### Example
143159
Below is an example of how this can be defined at the server group level (`rke2_cluster.children.rke2_servers.vars`):
144160

145-
__rke2_servers.yaml:__
161+
__group_vars/rke2_servers.yml:__
146162
```yaml
147163
---
148164
rke2_pod_security_admission_config_file_path: "{{ playbook_dir }}/docs/advanced_sample_inventory/files/pod-security-admission-config.yaml"
@@ -157,7 +173,7 @@ In order to define a audit policy config, server nodes will need to have the `rk
157173
#### Example
158174
Below is an example of how this can be defined at the server group level (`rke2_cluster.children.rke2_servers.vars`):
159175

160-
__rke2_servers.yaml:__
176+
__group_vars/rke2_servers.yml:__
161177
```yaml
162178
rke2_audit_policy_config_file_path: "{{ playbook_dir }}/docs/advanced_sample_inventory/files/audit-policy.yaml"
163179
group_rke2_config:
@@ -169,7 +185,7 @@ group_rke2_config:
169185

170186

171187
### Adding Additional Cluster Manifests
172-
If you have a cluster that needs extra manifests to be deployed or the cluster needs a ciritical component to be configured RKE2's "HelmChartConfig" is an available option (among others). The Ansible repository supports the use of these configuration files, simply place them in a folder and give Ansible the path to the folder, Ansible will enumarte the files and place them on the first server node.
188+
If you have a cluster that needs extra manifests to be deployed or the cluster needs a critical component to be configured RKE2's "HelmChartConfig" is an available option (among others). The Ansible repository supports the use of these configuration files. Simply place the Helm chart configs in a folder, give Ansible the path to the folder, and Ansible will enumerate the files and place them on the first server node.
173189

174190
There are two variables that control the deployment of manifests to the server nodes:
175191
- `rke2_manifest_config_directory`
@@ -178,13 +194,13 @@ There are two variables that control the deployment of manifests to the server n
178194
The first variable is used to deploy manifest to the server nodes before starting the RKE2 server process, this ensures critical components (like the CNI) can be configured when the RKE2 server process starts. The second, ensures applications are deployed after the RKE2 server process starts. There are examples of both below.
179195

180196
#### Pre-Deploy Example
181-
The example used is configuring Cilium with the kube-proxy replacement enabled a fairly common use case:
197+
The example used is configuring Cilium with the kube-proxy replacement enabled (a fairly common use case):
182198

183199
> [!WARNING]
184200
> If this option is used you must provide a `become` password and this must be the password for the local host running the Ansible playbook. The playbook is looking for this directory on the localhost, and will run as root. This imposes some limitations, if you are using an SSH password to login to remote systems (typical for STIG'd clusters) the `become` password must be the same for the cluster nodes AND localhost.
185201

186-
__rke2_servers.yaml:__
187-
For this example to work kube proxy needs to be disabled, and the Cilium CNI needs to be enabled.
202+
__group_vars/rke2_servers.yml:__
203+
For this example to work kube-proxy needs to be disabled, and the Cilium CNI needs to be enabled.
188204
```yaml
189205
rke2_manifest_config_directory: "{{ playbook_dir }}/docs/advanced_sample_inventory/pre-deploy-manifests/"
190206
group_rke2_config:
@@ -218,7 +234,7 @@ spec:
218234

219235
#### Post-Deploy Example
220236
In the example below cert-manager is auto deployed after the RKE2 server process is started.
221-
__rke2_servers.yaml:__
237+
__group_vars/rke2_servers.yml:__
222238
```yaml
223239
rke2_manifest_config_post_run_directory: "{{ playbook_dir }}/docs/advanced_sample_inventory/post-deploy-manifests/"
224240
```
@@ -243,10 +259,5 @@ spec:
243259
enabled: true
244260
```
245261

246-
247-
### rke2_install_version
248-
A version of RKE2 can be selected to be installed via the `all.vars.rke2_install_version` variable
249-
250-
251262
# Examples
252-
There are two examples provided in this folder, "basic_sample_inventory", and "advanced_sample_inventory". The basic example is the simplest possible example, the advanced example is all of the options explained above in one example.
263+
There are two examples provided in this folder, `basic_sample_inventory`, and `advanced_sample_inventory`. The basic example is the simplest possible example, the advanced example is all of the options explained above in one example.

inventory/.gitignore

-4
This file was deleted.

inventory/sample/group_vars/rke2_agents.yml

-10
This file was deleted.

0 commit comments

Comments
 (0)