Skip to content

Commit f5c0af5

Browse files
Run monkey-patched proxy so that kubeadm can join
1 parent f4ca382 commit f5c0af5

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

roles/kubernetes/kubeadm/tasks/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@
7474
- not kubelet_conf.stat.exists or not cluster_info_discovery_kubeconfig.stat.exists
7575
- kubeadm_use_file_discovery
7676

77+
- name: nginx proxy | start with containerd
78+
command: >-
79+
ctr --namespace=k8s.io run
80+
--net-host
81+
-d
82+
--mount type=bind,src={{ nginx_config_dir }},dst=/etc/nginx,options=rbind:ro
83+
{{ nginx_image_repo }}:{{ nginx_image_tag }}
84+
nginx
85+
when:
86+
- not kubelet_conf.stat.exists
87+
- container_manager == 'containerd'
88+
7789
- name: Create kubeadm client config
7890
template:
7991
src: "kubeadm-client.conf.j2"
@@ -209,3 +221,18 @@
209221
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally
210222
- kube_network_plugin != "calico" or calico_datastore == "etcd"
211223
- kube_network_plugin != "cilium" or cilium_identity_allocation_mode != 'crd'
224+
225+
# Cleanup the nginx proxy that we created earlier on to bootstrap kubelet, so that it can start
226+
- name: nginx proxy | stop container
227+
command: ctr --namespace=k8s.io task delete -f nginx
228+
when:
229+
- not kubelet_conf.stat.exists
230+
- container_manager == 'containerd'
231+
ignore_errors: yes
232+
233+
- name: nginx proxy | delete container
234+
command: ctr --namespace=k8s.io container rm nginx
235+
when:
236+
- not kubelet_conf.stat.exists
237+
- container_manager == 'containerd'
238+
ignore_errors: yes

0 commit comments

Comments
 (0)