Browse Source

Add support for Docker plugins (#4934)

* Add support for Docker plugins

* support multiple Docker plugins using looped include

* fix yamllint error
pull/4957/head
rptaylor 5 years ago
committed by Kubernetes Prow Robot
parent
commit
324bc41097
4 changed files with 19 additions and 0 deletions
  1. 1
      docs/vars.md
  2. 8
      roles/container-engine/docker/tasks/docker_plugin.yml
  3. 6
      roles/container-engine/docker/tasks/main.yml
  4. 4
      roles/kubespray-defaults/defaults/main.yaml

1
docs/vars.md

@ -98,6 +98,7 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m
* *docker_options* - Commonly used to set
``--insecure-registry=myregistry.mydomain:5000``
* *docker_plugins* - This list can be used to define [Docker plugins](https://docs.docker.com/engine/extend/) to install.
* *http_proxy/https_proxy/no_proxy* - Proxy variables for deploying behind a
proxy. Note that no_proxy defaults to all internal cluster IPs and hostnames
that correspond to each node.

8
roles/container-engine/docker/tasks/docker_plugin.yml

@ -0,0 +1,8 @@
---
- name: Install Docker plugin
command: docker plugin install --grant-all-permissions {{ docker_plugin | quote }}
when: docker_plugin is defined
register: docker_plugin_status
failed_when:
- docker_plugin_status.failed
- '"already exists" not in docker_plugin_status.stderr'

6
roles/container-engine/docker/tasks/main.yml

@ -235,6 +235,12 @@
resolvconf_mode == 'docker_dns' and
installed_docker_version.stdout is version('1.12', '<')
# Install each plugin using a looped include to make error handling in the included task simpler.
- include_tasks: docker_plugin.yml
loop: "{{ docker_plugins }}"
loop_control:
loop_var: docker_plugin
- name: Set docker systemd config
import_tasks: systemd.yml

4
roles/kubespray-defaults/defaults/main.yaml

@ -256,6 +256,10 @@ docker_options: >-
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current --signature-verification=false
{%- endif -%}
## A list of plugins to install using 'docker plugin install --grant-all-permissions'
## Empty by default so no plugins will be installed.
docker_plugins: []
# Experimental kubeadm etcd deployment mode. Available only for new deployment
etcd_kubeadm_enabled: false

Loading…
Cancel
Save