Skip to content

Commit 7ad3a4f

Browse files
authored
Merge pull request #1 from jLemmings/fix/fix-partition-rke2
Fix/fix partition rke2
2 parents ca88d08 + af001dd commit 7ad3a4f

31 files changed

+430
-147
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ jobs:
2424
fail-fast: ${{ !contains(github.event_name, 'pull_request') }}
2525
matrix:
2626
config:
27-
- image: "rockylinux8"
27+
- image: "rockylinux9"
2828
cgroup_mode: "host"
2929
volumes: "rw"
30-
- image: "ubuntu2204"
30+
- image: "ubuntu2404"
3131
cgroup_mode: "host"
3232
volumes: "rw"
3333
steps:
3434
- name: checkout
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3636
with:
3737
path: 'lablabs.rke2'
3838

3939
- name: Set up Python 3
40-
uses: actions/setup-python@v4
40+
uses: actions/setup-python@v5
4141
with:
4242
python-version: '3.x'
4343

@@ -62,17 +62,17 @@ jobs:
6262
strategy:
6363
matrix:
6464
config:
65-
- image: "ubuntu2204"
65+
- image: "ubuntu2404"
6666
cgroup_mode: "host"
6767
volumes: "rw"
6868
steps:
6969
- name: checkout
70-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
7171
with:
7272
path: 'lablabs.rke2'
7373

7474
- name: Set up Python 3
75-
uses: actions/setup-python@v4
75+
uses: actions/setup-python@v5
7676
with:
7777
python-version: '3.x'
7878

@@ -104,12 +104,12 @@ jobs:
104104
# volumes: "rw"
105105
# steps:
106106
# - name: checkout
107-
# uses: actions/checkout@v3
107+
# uses: actions/checkout@v4
108108
# with:
109109
# path: 'lablabs.rke2'
110110

111111
# - name: Set up Python 3
112-
# uses: actions/setup-python@v4
112+
# uses: actions/setup-python@v5
113113
# with:
114114
# python-version: '3.x'
115115

@@ -142,12 +142,12 @@ jobs:
142142
# volumes: "rw"
143143
# steps:
144144
# - name: checkout
145-
# uses: actions/checkout@v3
145+
# uses: actions/checkout@v4
146146
# with:
147147
# path: 'lablabs.rke2'
148148

149149
# - name: Set up Python 3
150-
# uses: actions/setup-python@v4
150+
# uses: actions/setup-python@v5
151151
# with:
152152
# python-version: '3.x'
153153

.github/workflows/lint.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ jobs:
1212
fail-fast: true
1313
steps:
1414
- name: checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
17-
path: "${{ github.repository }}"
18-
- name: Molecule for Ansible - lint
19-
uses: MonolithProjects/[email protected]
17+
path: 'lablabs.rke2'
18+
19+
- name: Set up Python 3
20+
uses: actions/setup-python@v5
2021
with:
21-
molecule_command: lint
22+
python-version: '3.x'
23+
24+
- name: Install ansible-lint
25+
run: pip3 install ansible-lint
26+
27+
- name: Run ansible-lint
28+
run: ansible-lint --profile production ./tasks
29+
working-directory: ./lablabs.rke2

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
pre-commit:
1010
runs-on: ubuntu-20.04
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-python@v2
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
1414

1515
- name: Run pre-commit
16-
uses: pre-commit/action@v2.0.3
16+
uses: pre-commit/action@v3.0.1

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
update_release_draft:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: release-drafter/release-drafter@v5
19+
- uses: release-drafter/release-drafter@v6
2020
with:
2121
config-name: RELEASE_DRAFTER.yml
2222
env:

.yamllint

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
extends: default
44

55
rules:
6+
comments:
7+
min-spaces-from-content: 1
8+
octal-values:
9+
forbid-implicit-octal: false
10+
forbid-explicit-octal: true
611
braces:
712
max-spaces-inside: 1
813
level: error
@@ -15,7 +20,6 @@ rules:
1520
commas:
1621
max-spaces-after: -1
1722
level: error
18-
comments: disable
1923
comments-indentation: disable
2024
document-start: disable
2125
empty-lines:

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ The Role can install the RKE2 in 3 modes:
2828

2929
## Tested on
3030

31-
* Rocky Linux 8
32-
* Ubuntu 20.04 LTS
33-
* Ubuntu 22.04 LTS
31+
* Rocky Linux 9
32+
* Ubuntu 24.04 LTS
3433

3534
## Role Variables
3635

@@ -39,7 +38,7 @@ This is a copy of `defaults/main.yml`
3938
```yaml
4039
---
4140
# The node type - server or agent
42-
rke2_type: server
41+
rke2_type: "{{ 'server' if inventory_hostname in groups[rke2_servers_group_name] else 'agent' if inventory_hostname in groups[rke2_agents_group_name] }}"
4342

4443
# Deploy the control plane in HA mode
4544
rke2_ha_mode: false
@@ -111,6 +110,9 @@ rke2_kubevip_metrics_port: 2112
111110
# Add additional SANs in k8s API TLS cert
112111
rke2_additional_sans: []
113112

113+
# Configure cluster domain
114+
# rke2_cluster_domain: cluster.example.net
115+
114116
# API Server destination port
115117
rke2_apiserver_dest_port: 6443
116118

@@ -189,7 +191,7 @@ rke2_disable_cloud_controller: false
189191

190192
# Cloud provider to use for the cluster (aws, azure, gce, openstack, vsphere, external)
191193
# applicable only if rke2_disable_cloud_controller is true
192-
rke2_cloud_provider_name: "rke2"
194+
rke2_cloud_provider_name: "external"
193195

194196
# Path to custom manifests deployed during the RKE2 installation
195197
# It is possible to use Jinja2 templating in the manifests
@@ -242,10 +244,11 @@ rke2_etcd_snapshot_destination_dir: "{{ rke2_data_path }}/server/db/snapshots"
242244
# region: "" # optional - defaults to us-east-1
243245
# folder: "" # optional - defaults to top level of bucket
244246
# Override default containerd snapshotter
245-
rke2_snapshooter: overlayfs
247+
rke2_snapshotter: "{{ rke2_snapshooter }}"
248+
rke2_snapshooter: overlayfs # legacy variable that only exists to keep backward compatibility with previous configurations
246249

247-
# Deploy RKE2 with default CNI canal
248-
rke2_cni: canal
250+
# Deploy RKE2 with default CNI canal (should be a list)
251+
rke2_cni: [canal]
249252

250253
# Validate system configuration against the selected benchmark
251254
# (Supported value is "cis-1.23" or eventually "cis-1.6" if you are running RKE2 prior 1.25)
@@ -304,6 +307,13 @@ rke2_agents_group_name: workers
304307
# rke2_kube_scheduler_arg:
305308
# - "bind-address=0.0.0.0"
306309

310+
# (Optional) Configure nginx via HelmChartConfig: https://docs.rke2.io/networking/networking_services#nginx-ingress-controller
311+
# rke2_ingress_nginx_values:
312+
# controller:
313+
# config:
314+
# use-forwarded-headers: "true"
315+
rke2_ingress_nginx_values: {}
316+
307317
# Cordon, drain the node which is being upgraded. Uncordon the node once the RKE2 upgraded
308318
rke2_drain_node_during_upgrade: false
309319

@@ -323,6 +333,17 @@ rke2_debug: false
323333

324334
# The value for the node-name configuration item
325335
rke2_node_name: "{{ inventory_hostname }}"
336+
337+
# the network to use for Pods.. Set to '10.42.0.0/16' by default.
338+
rke2_cluster_cidr:
339+
- 10.42.0.0/16
340+
341+
# the network to use for ClusterIP Services. Set to '10.43.0.0/16' by default.
342+
rke2_service_cidr:
343+
- 10.43.0.0/16
344+
345+
# Enable SELinux for rke2
346+
rke2_selinux: false
326347
```
327348
328349
## Inventory file example
@@ -332,14 +353,14 @@ The RKE2 Kubernetes master/server nodes must belong to `masters` group and worke
332353

333354
```ini
334355
[masters]
335-
master-01 ansible_host=192.168.123.1 rke2_type=server
336-
master-02 ansible_host=192.168.123.2 rke2_type=server
337-
master-03 ansible_host=192.168.123.3 rke2_type=server
356+
master-01 ansible_host=192.168.123.1
357+
master-02 ansible_host=192.168.123.2
358+
master-03 ansible_host=192.168.123.3
338359
339360
[workers]
340-
worker-01 ansible_host=192.168.123.11 rke2_type=agent
341-
worker-02 ansible_host=192.168.123.12 rke2_type=agent
342-
worker-03 ansible_host=192.168.123.13 rke2_type=agent
361+
worker-01 ansible_host=192.168.123.11
362+
worker-02 ansible_host=192.168.123.12
363+
worker-03 ansible_host=192.168.123.13
343364
344365
[k8s_cluster:children]
345366
masters

defaults/main.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# The node type - server or agent
3-
rke2_type: server
3+
rke2_type: "{{ 'server' if inventory_hostname in groups[rke2_servers_group_name] else 'agent' if inventory_hostname in groups[rke2_agents_group_name] }}"
44

55
# Deploy the control plane in HA mode
66
rke2_ha_mode: false
@@ -72,6 +72,9 @@ rke2_kubevip_metrics_port: 2112
7272
# Add additional SANs in k8s API TLS cert
7373
rke2_additional_sans: []
7474

75+
# Configure cluster domain
76+
# rke2_cluster_domain: cluster.example.net
77+
7578
# API Server destination port
7679
rke2_apiserver_dest_port: 6443
7780

@@ -203,7 +206,8 @@ rke2_etcd_snapshot_destination_dir: "{{ rke2_data_path }}/server/db/snapshots"
203206
# region: "" # optional - defaults to us-east-1
204207
# folder: "" # optional - defaults to top level of bucket
205208
# Override default containerd snapshotter
206-
rke2_snapshooter: overlayfs
209+
rke2_snapshotter: "{{ rke2_snapshooter }}"
210+
rke2_snapshooter: overlayfs # legacy variable that only exists to keep backward compatibility with previous configurations
207211

208212
# Deploy RKE2 with default CNI canal
209213
rke2_cni: canal
@@ -265,6 +269,13 @@ rke2_agents_group_name: workers
265269
# rke2_kube_scheduler_arg:
266270
# - "bind-address=0.0.0.0"
267271

272+
# (Optional) Configure nginx via HelmChartConfig: https://docs.rke2.io/networking/networking_services#nginx-ingress-controller
273+
# rke2_ingress_nginx_values:
274+
# controller:
275+
# config:
276+
# use-forwarded-headers: "true"
277+
rke2_ingress_nginx_values: {}
278+
268279
# Cordon, drain the node which is being upgraded. Uncordon the node once the RKE2 upgraded
269280
rke2_drain_node_during_upgrade: false
270281

@@ -284,3 +295,14 @@ rke2_debug: false
284295

285296
# The value for the node-name configuration item
286297
rke2_node_name: "{{ inventory_hostname }}"
298+
299+
# default pod network range for rke2
300+
rke2_cluster_cidr:
301+
- 10.42.0.0/16
302+
303+
# default service network range for rke2
304+
rke2_service_cidr:
305+
- 10.43.0.0/16
306+
307+
# Enable SELinux for rke2
308+
rke2_selinux: false

molecule/cluster/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
become: yes
55
vars:
66
rke2_version: v1.22.12+rke2r1
7-
rke2_snapshooter: native
7+
rke2_snapshotter: native
88
rke2_server_node_taints:
99
- 'CriticalAddonsOnly=true:NoExecute'
1010
roles:

molecule/cluster/prepare.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
hosts: node*
44
become: true
55
tasks:
6-
- name: Install packages
6+
- name: Install wget for Ubuntu
77
ansible.builtin.package:
88
update_cache: true
9-
name: "{{ item }}"
10-
loop:
11-
- wget
12-
- curl
9+
name:
10+
- wget
11+
when: ansible_distribution == "Ubuntu"
12+
13+
- name: Install iproute for RockyLinux
14+
ansible.builtin.package:
15+
update_cache: true
16+
name:
17+
- iproute
18+
when: ansible_distribution == "Rocky"

molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
become: yes
55
vars:
66
rke2_version: v1.27.1+rke2r1
7-
rke2_snapshooter: native
7+
rke2_snapshotter: native
88
roles:
99
- role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"

molecule/default/prepare.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
hosts: node*
44
become: true
55
tasks:
6-
- name: Install packages
6+
- name: Install wget for Ubuntu
77
ansible.builtin.package:
88
update_cache: true
99
name:
1010
- wget
11-
- curl
11+
when: ansible_distribution == "Ubuntu"
1212

13-
- name: Install special packages for RockyLinux
13+
- name: Install iproute for RockyLinux
1414
ansible.builtin.package:
1515
update_cache: true
1616
name:

molecule/ha_cluster/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
rke2_version: v1.22.12+rke2r1
77
rke2_ha_mode: true
88
rke2_api_ip: 192.168.123.100
9-
rke2_snapshooter: native
9+
rke2_snapshotter: native
1010
rke2_server_node_taints:
1111
- 'CriticalAddonsOnly=true:NoExecute'
1212
roles:

0 commit comments

Comments
 (0)