File tree 7 files changed +54
-5
lines changed
7 files changed +54
-5
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,15 @@ rke2_wait_for_all_pods_to_be_ready: false
325
325
# Enable debug mode (rke2-service)
326
326
rke2_debug : false
327
327
328
+ # (Optional) Customize kubelet config using KubeletConfiguration - https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
329
+ # rke2_kubelet_config:
330
+ # imageGCHighThresholdPercent: 80
331
+ # imageGCLowThresholdPercent: 70
332
+ # Note that you also need to add the following to kubelet args:
333
+ # rke2_kubelet_arg:
334
+ # - "--config=/etc/rancher/rke2/kubelet-config.yaml"
335
+ rke2_kubelet_config : {}
336
+
328
337
# (Optional) Customize default kubelet arguments
329
338
# rke2_kubelet_arg:
330
339
# - "--system-reserved=cpu=100m,memory=100Mi"
@@ -346,6 +355,7 @@ rke2_service_cidr:
346
355
347
356
# Enable SELinux for rke2
348
357
rke2_selinux : false
358
+
349
359
` ` `
350
360
351
361
## Inventory file example
Original file line number Diff line number Diff line change @@ -287,6 +287,15 @@ rke2_wait_for_all_pods_to_be_ready: false
287
287
# Enable debug mode (rke2-service)
288
288
rke2_debug : false
289
289
290
+ # (Optional) Customize kubelet config using KubeletConfiguration - https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
291
+ # rke2_kubelet_config:
292
+ # imageGCHighThresholdPercent: 80
293
+ # imageGCLowThresholdPercent: 70
294
+ # Note that you also need to add the following to kubelet args:
295
+ # rke2_kubelet_arg:
296
+ # - "--config=/etc/rancher/rke2/kubelet-config.yaml"
297
+ rke2_kubelet_config : {}
298
+
290
299
# (Optional) Customize default kubelet arguments
291
300
# rke2_kubelet_arg:
292
301
# - "--system-reserved=cpu=100m,memory=100Mi"
Original file line number Diff line number Diff line change 21
21
mode : 0600
22
22
notify : " Config file changed"
23
23
24
+ - name : Copy kubelet config
25
+ ansible.builtin.template :
26
+ src : templates/kubelet-config.yaml.j2
27
+ dest : /etc/rancher/rke2/kubelet-config.yaml
28
+ owner : root
29
+ group : root
30
+ mode : 0600
31
+ when : rke2_kubelet_config | length > 0
32
+ notify : " Config file changed"
33
+
24
34
- name : Copy Containerd Registry Configuration file
25
35
ansible.builtin.template :
26
36
src : " {{ rke2_custom_registry_path }}"
Original file line number Diff line number Diff line change 1
1
---
2
-
3
2
- name : Install Keepalived when HA mode is enabled
4
3
ansible.builtin.include_tasks : keepalived.yml
5
4
when :
31
30
- rke2_ha_mode_kubevip | bool
32
31
- not rke2_ha_mode_keepalived | bool
33
32
34
-
35
33
- name : Copy kube-vip manifests to the masternode
36
34
ansible.builtin.include_tasks : kubevip.yml
37
35
when :
Original file line number Diff line number Diff line change 1
1
---
2
-
3
2
- name : Create the RKE2 config dir
4
3
ansible.builtin.file :
5
4
state : directory
27
26
mode : 0600
28
27
notify : " Config file changed"
29
28
29
+ - name : Copy kubelet config
30
+ ansible.builtin.template :
31
+ src : templates/kubelet-config.yaml.j2
32
+ dest : /etc/rancher/rke2/kubelet-config.yaml
33
+ owner : root
34
+ group : root
35
+ mode : 0600
36
+ when : rke2_kubelet_config | length > 0
37
+ notify : " Config file changed"
38
+
30
39
- name : Copy Containerd Registry Configuration file
31
40
ansible.builtin.template :
32
41
src : " {{ rke2_custom_registry_path }}"
85
94
executable : /bin/bash
86
95
changed_when : false
87
96
register : all_ready_nodes
88
- until :
89
- " groups[rke2_cluster_group_name] | length == all_ready_nodes.stdout | int"
97
+ until : " groups[rke2_cluster_group_name] | length == all_ready_nodes.stdout | int"
90
98
retries : 100
91
99
delay : 15
92
100
when :
Original file line number Diff line number Diff line change 17
17
mode : 0600
18
18
notify : " Config file changed"
19
19
20
+ - name : Copy kubelet config
21
+ ansible.builtin.template :
22
+ src : templates/kubelet-config.yaml.j2
23
+ dest : /etc/rancher/rke2/kubelet-config.yaml
24
+ owner : root
25
+ group : root
26
+ mode : 0600
27
+ when : rke2_kubelet_config | length > 0
28
+ notify : " Config file changed"
29
+
20
30
- name : Copy Containerd Registry Configuration file
21
31
ansible.builtin.template :
22
32
src : " {{ rke2_custom_registry_path }}"
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion: kubelet.config.k8s.io/v1beta1
3
+ kind: KubeletConfiguration
4
+ {{ rke2_kubelet_config | to_nice_yaml(indent=2) }}
You can’t perform that action at this time.
0 commit comments