Skip to content

Commit 333807b

Browse files
committed
Add test case
1 parent 398b9a5 commit 333807b

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

.gitlab-ci/packet.yml

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ packet_ubuntu20-crio:
8080
packet_ubuntu22-calico-all-in-one:
8181
extends: .packet_pr
8282

83+
packet_debian12-kubelet_root:
84+
extends: .packet_pr
85+
8386
packet_ubuntu22-calico-all-in-one-upgrade:
8487
extends: .packet_pr
8588
variables:

roles/kubernetes/preinstall/tasks/0200-kubeletroot.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# mount bind the kubelet root to the default location.
23
# many csi and software in the ecosystem have this location hardcoded
34

@@ -16,10 +17,16 @@
1617
mode: '0750'
1718
when:
1819
- kubelet_root_dir != '/var/lib/kubelet'
19-
20+
2021
- name: "Synchronize old /var/lib/kubelet to new location before mounting"
21-
command: "rsync -avh --ignore-existing /var/lib/kubelet/ {{kubelet_root_dir}}"
22-
changed_when: false
22+
ansible.posix.synchronize:
23+
src: /var/lib/kubelet/
24+
dest: "{{kubelet_root_dir}}"
25+
archive: true
26+
rsync_opts:
27+
- "--ignore-existing"
28+
set_remote_user: false
29+
delegate_to: "{{inventory_hostname}}"
2330
when:
2431
- kubelet_root_dir != '/var/lib/kubelet'
2532

roles/kubernetes/preinstall/tasks/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@
139139
- not ignore_assert_errors
140140

141141

142-
- import_tasks: 0200_kubeletroot.yaml
142+
- name: Configure alternative kubelet root
143+
import_tasks: 0200-kubeletroot.yml
143144
tags:
144145
- bootstrap-os
145146
- kubelet-root
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Instance settings
3+
cloud_image: debian-12
4+
mode: default
5+
6+
# Kubespray settings
7+
8+
kubelet_root_dir: /data/kubelet

0 commit comments

Comments
 (0)