Add /var/lib/cni to kubelet
Necessary to persist this directory for host-local IPAM used by Canal Add pre-upgrade task to copy /var/lib/cni out of old kubelet.pull/1153/head
parent
80828a7c77
commit
b4d06ff8dd
|
@ -4,6 +4,9 @@
|
||||||
{%- if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] -%}true{%- else -%}false{%- endif -%}
|
{%- if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] -%}true{%- else -%}false{%- endif -%}
|
||||||
tags: facts
|
tags: facts
|
||||||
|
|
||||||
|
- include: pre_upgrade.yml
|
||||||
|
tags: kubelet
|
||||||
|
|
||||||
- include: install.yml
|
- include: install.yml
|
||||||
tags: kubelet
|
tags: kubelet
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- name: "Pre-upgrade | copy /var/lib/cni from kubelet"
|
||||||
|
command: docker cp kubelet:/var/lib/cni /var/lib/cni
|
||||||
|
args:
|
||||||
|
creates: "/var/lib/cni"
|
||||||
|
failed_when: false
|
|
@ -21,6 +21,7 @@
|
||||||
-v {{ docker_daemon_graph }}:/var/lib/docker:rw \
|
-v {{ docker_daemon_graph }}:/var/lib/docker:rw \
|
||||||
-v /var/log:/var/log:rw \
|
-v /var/log:/var/log:rw \
|
||||||
-v /var/lib/kubelet:/var/lib/kubelet:shared \
|
-v /var/lib/kubelet:/var/lib/kubelet:shared \
|
||||||
|
-v /var/lib/cni:/var/lib/cni:shared \
|
||||||
-v /var/run:/var/run:rw \
|
-v /var/run:/var/run:rw \
|
||||||
-v {{kube_config_dir}}:{{kube_config_dir}}:ro \
|
-v {{kube_config_dir}}:{{kube_config_dir}}:ro \
|
||||||
{{ hyperkube_image_repo }}:{{ hyperkube_image_tag}} \
|
{{ hyperkube_image_repo }}:{{ hyperkube_image_tag}} \
|
||||||
|
|
|
@ -34,8 +34,10 @@ ExecStart=/usr/bin/rkt run \
|
||||||
{% if kube_network_plugin in ["calico", "weave", "canal"] %}
|
{% if kube_network_plugin in ["calico", "weave", "canal"] %}
|
||||||
--volume etc-cni,kind=host,source=/etc/cni,readOnly=true \
|
--volume etc-cni,kind=host,source=/etc/cni,readOnly=true \
|
||||||
--volume opt-cni,kind=host,source=/opt/cni,readOnly=true \
|
--volume opt-cni,kind=host,source=/opt/cni,readOnly=true \
|
||||||
|
--volume var-lib-cni,kind=host,source=/var/lib/cni,readOnly=false \
|
||||||
--mount volume=etc-cni,target=/etc/cni \
|
--mount volume=etc-cni,target=/etc/cni \
|
||||||
--mount volume=opt-cni,target=/opt/cni \
|
--mount volume=opt-cni,target=/opt/cni \
|
||||||
|
--mount volume=var-lib-cni,target=/var/lib/cni \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
--mount volume=dns,target=/etc/resolv.conf \
|
--mount volume=dns,target=/etc/resolv.conf \
|
||||||
--mount volume=etc-kubernetes,target={{ kube_config_dir }} \
|
--mount volume=etc-kubernetes,target={{ kube_config_dir }} \
|
||||||
|
|
Loading…
Reference in New Issue