[docker] use cri-dockerd instead of dockershim for any kubernetes version deployed with docker as the container_manager

This commit is contained in:
Calin Cristian Andrei 2022-06-06 18:18:22 +03:00 committed by Kubernetes Prow Robot
parent ec01b40e85
commit fad296616c
9 changed files with 5 additions and 35 deletions

View file

@ -8,13 +8,7 @@ Using the docker container manager:
container_manager: docker container_manager: docker
``` ```
Using `cri-dockerd` instead of `dockershim`: *Note:* `cri-dockerd` has replaced `dockershim` across supported kubernetes version in kubespray 2.20.
```yaml
cri_dockerd_enabled: false
```
*Note:* The `cri_dockerd_enabled: true` setting will become the default in a future kubespray release once kubespray 1.24+ is supported and `dockershim` is removed. At that point, changing this option will be deprecated and silently ignored.
Enabling the `overlay2` graph driver: Enabling the `overlay2` graph driver:

View file

@ -57,6 +57,3 @@ docker_rpm_keepcache: 1
## A string of extra options to pass to the docker daemon. ## A string of extra options to pass to the docker daemon.
## This string should be exactly as you wish it to appear. ## This string should be exactly as you wish it to appear.
# docker_options: "" # docker_options: ""
## Use CRI-DockerD instead of dockershim
# cri_dockerd_enabled: false

View file

@ -4,7 +4,6 @@
become: true become: true
vars: vars:
container_manager: docker container_manager: docker
cri_dockerd_enabled: true
roles: roles:
- role: kubespray-defaults - role: kubespray-defaults
- role: container-engine/cri-dockerd - role: container-engine/cri-dockerd

View file

@ -50,16 +50,8 @@ dependencies:
- container-engine - container-engine
- containerd - containerd
- role: container-engine/docker
when:
- container_manager == 'docker'
tags:
- container-engine
- docker
- role: container-engine/cri-dockerd - role: container-engine/cri-dockerd
when: when:
- cri_dockerd_enabled
- container_manager == 'docker' - container_manager == 'docker'
tags: tags:
- container-engine - container-engine

View file

@ -1001,7 +1001,7 @@ downloads:
crictl: crictl:
file: true file: true
enabled: "{{ container_manager in ['crio', 'cri', 'containerd'] or cri_dockerd_enabled }}" enabled: true
version: "{{ crictl_version }}" version: "{{ crictl_version }}"
dest: "{{ local_release_dir }}/crictl-{{ crictl_version }}-linux-{{ image_arch }}.tar.gz" dest: "{{ local_release_dir }}/crictl-{{ crictl_version }}-linux-{{ image_arch }}.tar.gz"
sha256: "{{ crictl_binary_checksum }}" sha256: "{{ crictl_binary_checksum }}"
@ -1014,7 +1014,7 @@ downloads:
cri_dockerd: cri_dockerd:
file: true file: true
enabled: "{{ cri_dockerd_enabled }}" enabled: "{{ container_manager == 'docker' }}"
version: "{{ cri_dockerd_version }}" version: "{{ cri_dockerd_version }}"
dest: "{{ local_release_dir }}/cri-dockerd-{{ cri_dockerd_version }}.{{ image_arch }}.tar.gz" dest: "{{ local_release_dir }}/cri-dockerd-{{ cri_dockerd_version }}.{{ image_arch }}.tar.gz"
sha256: "{{ cri_dockerd_archive_checksum }}" sha256: "{{ cri_dockerd_archive_checksum }}"

View file

@ -12,9 +12,6 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
--config={{ kube_config_dir }}/kubelet-config.yaml \ --config={{ kube_config_dir }}/kubelet-config.yaml \
--kubeconfig={{ kube_config_dir }}/kubelet.conf \ --kubeconfig={{ kube_config_dir }}/kubelet.conf \
{# end kubeadm specific settings #} {# end kubeadm specific settings #}
{% if container_manager == 'docker' and not cri_dockerd_enabled %}
--pod-infra-container-image={{ pod_infra_image_repo }}:{{ pod_infra_image_tag }} \
{% else %}
--container-runtime=remote \ --container-runtime=remote \
--container-runtime-endpoint=unix://{{ cri_socket }} \ --container-runtime-endpoint=unix://{{ cri_socket }} \
{% endif %} {% endif %}
@ -35,9 +32,7 @@ KUBELET_ARGS="{{ kubelet_args_base }} {% if node_taints|default([]) %}--register
{% if kubelet_flexvolumes_plugins_dir is defined %} {% if kubelet_flexvolumes_plugins_dir is defined %}
KUBELET_VOLUME_PLUGIN="--volume-plugin-dir={{ kubelet_flexvolumes_plugins_dir }}" KUBELET_VOLUME_PLUGIN="--volume-plugin-dir={{ kubelet_flexvolumes_plugins_dir }}"
{% endif %} {% endif %}
{% if kube_network_plugin is defined and kube_network_plugin in ["calico", "canal", "cni", "flannel", "weave", "cilium", "kube-ovn", "kube-router", "macvlan"] %} {% if kube_network_plugin is defined and kube_network_plugin == "cloud" %}
KUBELET_NETWORK_PLUGIN="--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
{% elif kube_network_plugin is defined and kube_network_plugin == "cloud" %}
KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet" KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet"
{% endif %} {% endif %}
{% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce", "external"] %} {% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce", "external"] %}

View file

@ -267,9 +267,6 @@ deploy_container_engine: "{{ inventory_hostname in groups['k8s_cluster'] or etcd
# Container for runtime # Container for runtime
container_manager: containerd container_manager: containerd
# Enable CRI Docker interface
cri_dockerd_enabled: false
# Enable Kata Containers as additional container runtime # Enable Kata Containers as additional container runtime
# When enabled, it requires `container_manager` different than Docker # When enabled, it requires `container_manager` different than Docker
kata_containers_enabled: false kata_containers_enabled: false
@ -295,10 +292,8 @@ cri_socket: >-
/var/run/crio/crio.sock /var/run/crio/crio.sock
{%- elif container_manager == 'containerd' -%} {%- elif container_manager == 'containerd' -%}
/var/run/containerd/containerd.sock /var/run/containerd/containerd.sock
{%- elif cri_dockerd_enabled -%} {%- elif container_manager == 'docker' -%}
/var/run/cri-dockerd.sock /var/run/cri-dockerd.sock
{%- else -%}
/var/run/dockershim.sock
{%- endif -%} {%- endif -%}
## Uncomment this if you want to force overlay/overlay2 as docker storage driver ## Uncomment this if you want to force overlay/overlay2 as docker storage driver

View file

@ -8,4 +8,3 @@ vm_memory: 3072Mi
container_manager: docker container_manager: docker
etcd_deployment_type: docker etcd_deployment_type: docker
resolvconf_mode: docker_dns resolvconf_mode: docker_dns
cri_dockerd_enabled: true

View file

@ -15,4 +15,3 @@ enable_nodelocaldns: False
container_manager: docker container_manager: docker
etcd_deployment_type: docker etcd_deployment_type: docker
resolvconf_mode: docker_dns resolvconf_mode: docker_dns
cri_dockerd_enabled: true