Skip to content

Commit d670384

Browse files
Adrià Garriga-Alonsocollijk
authored andcommitted
Run monkey-patched proxy so that kubeadm can join
1 parent 5d659ff commit d670384

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

roles/kubernetes/kubeadm/tasks/main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@
6969
- not kubelet_conf.stat.exists
7070
- kubeadm_use_file_discovery
7171

72+
- name: nginx proxy | start with containerd
73+
command: >-
74+
ctr --namespace=k8s.io run
75+
--net-host
76+
--snapshotter=zfs
77+
-d
78+
--mount type=bind,src={{ nginx_config_dir }},dst=/etc/nginx,options=rbind:ro
79+
{{ nginx_image_repo }}:{{ nginx_image_tag }}
80+
nginx
81+
when:
82+
- not kubelet_conf.stat.exists
83+
- container_manager == 'containerd'
84+
7285
- name: Create kubeadm client config
7386
template:
7487
src: "kubeadm-client.conf.j2"
@@ -203,3 +216,18 @@
203216
- inventory_hostname not in groups['kube_control_plane']
204217
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
205218
- kube_network_plugin != "calico" or calico_datastore == "etcd"
219+
220+
# Cleanup the nginx proxy that we created earlier on to bootstrap kubelet, so that it can start
221+
- name: nginx proxy | stop container
222+
command: ctr --namespace=k8s.io task delete -f nginx
223+
when:
224+
- not kubelet_conf.stat.exists
225+
- container_manager == 'containerd'
226+
ignore_errors: yes
227+
228+
- name: nginx proxy | delete container
229+
command: ctr --namespace=k8s.io container rm nginx
230+
when:
231+
- not kubelet_conf.stat.exists
232+
- container_manager == 'containerd'
233+
ignore_errors: yes

0 commit comments

Comments
 (0)