Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for docker-storage-setup on overlay #6524

Merged
merged 1 commit into from
Dec 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions playbooks/container-runtime/private/setup_storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- hosts: "{{ l_containerized_host_groups }}"
vars:
l_chg_temp: "{{ openshift_containerized_host_groups | default([]) }}"
l_containerized_host_groups: "{{ (['oo_nodes_to_config'] | union(l_chg_temp)) | join(':') }}"
# role: container_runtime is necessary here to bring role default variables
# into the play scope.
roles:
- role: container_runtime
tasks:
- include_role:
name: container_runtime
tasks_from: docker_storage_setup_overlay.yml
when:
- container_runtime_docker_storage_type|default('') == "overlay2"
- openshift_docker_is_node_or_master | bool
6 changes: 6 additions & 0 deletions playbooks/container-runtime/setup_storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- import_playbook: ../init/main.yml
vars:
skip_verison: True

- import_playbook: private/setup_storage.yml
2 changes: 2 additions & 0 deletions playbooks/prerequisites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
roles:
- role: os_firewall

- import_playbook: container-runtime/private/setup_storage.yml

- import_playbook: container-runtime/private/config.yml
14 changes: 14 additions & 0 deletions roles/container_runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ openshift_docker_is_node_or_master: "{{ True if inventory_hostname in (groups['o

docker_alt_storage_path: /var/lib/containers/docker
docker_default_storage_path: /var/lib/docker
docker_storage_path: "{{ docker_default_storage_path }}"
docker_storage_size: 40G
docker_storage_setup_options:
vg: docker_vg
data_size: 99%VG
storage_driver: overlay2
root_lv_name: docker-root-lv
root_lv_size: 100%FREE
root_lv_mount_path: "{{ docker_storage_path }}"
docker_storage_extra_options:
- "--storage-opt overlay2.override_kernel_check=true"
- "--storage-opt overlay2.size={{ docker_storage_size }}"
- "--graph={{ docker_storage_path}}"


# Set local versions of facts that must be in json format for container-daemon.json
# NOTE: When jinja2.9+ is used the container-daemon.json file can move to using tojson
Expand Down
10 changes: 10 additions & 0 deletions roles/container_runtime/tasks/docker_storage_setup_overlay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Setup the docker-storage for overlay
template:
src: docker_storage_setup.j2
dest: /etc/sysconfig/docker-storage-setup
owner: root
group: root
mode: 0664
when:
- container_runtime_docker_storage_type == 'overlay2'
12 changes: 12 additions & 0 deletions roles/container_runtime/templates/docker_storage_setup.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Edit this file to override any configuration options specified in
# /usr/lib/docker-storage-setup/docker-storage-setup.
#
# For more details refer to "man docker-storage-setup"
DEVS={{ container_runtime_docker_storage_setup_device }}
VG={{ docker_storage_setup_options.vg }}
DATA_SIZE={{ docker_storage_setup_options.data_size }}
STORAGE_DRIVER="{{ docker_storage_setup_options.storage_driver }}"
CONTAINER_ROOT_LV_NAME="{{ docker_storage_setup_options.root_lv_name }}"
CONTAINER_ROOT_LV_SIZE="{{ docker_storage_setup_options.root_lv_size }}"
CONTAINER_ROOT_LV_MOUNT_PATH="{{ docker_storage_setup_options.root_lv_mount_path }}"
EXTRA_STORAGE_OPTIONS="{{ docker_storage_extra_options | join(' ') }}"