Skip to content

Commit

Permalink
Add privileged_without_host_devices support (#7343)
Browse files Browse the repository at this point in the history
When privileged is enabled for a container, all the `/dev/*` block
devices from the host are mounted into the guest. The
`privileged_without_host_devices` flag prevents host devices from
being passed to privileged containers.

More information:
* containerd/cri#1225
* cri-o/cri-o@1d0f681

(cherry picked from commit dc5df57)
  • Loading branch information
electrocucaracha authored and k8s-ci-robot committed Mar 15, 2021
1 parent 704a054 commit 01e527a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/container-engine/containerd/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ containerd_default_runtime:
# type: io.containerd.kata.v2
# engine: ""
# root: ""
# privileged_without_host_devices: true
containerd_runtimes: []

containerd_untrusted_runtime_type: ''
Expand Down
2 changes: 2 additions & 0 deletions roles/container-engine/containerd/templates/config.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ disabled_plugins = ["restart"]
runtime_type = "{{ containerd_default_runtime.type }}"
runtime_engine = "{{ containerd_default_runtime.engine }}"
runtime_root = "{{ containerd_default_runtime.root }}"
privileged_without_host_devices = {{ containerd_default_runtime.privileged_without_host_devices|default(false)|lower }}

{% if kata_containers_enabled %}
[plugins.cri.containerd.runtimes.kata-qemu]
Expand All @@ -55,6 +56,7 @@ disabled_plugins = ["restart"]
runtime_type = "{{ runtime.type }}"
runtime_engine = "{{ runtime.engine }}"
runtime_root = "{{ runtime.root }}"
privileged_without_host_devices = {{ runtime.privileged_without_host_devices|default(false)|lower }}
{% endfor %}

[plugins.cri.containerd.untrusted_workload_runtime]
Expand Down
1 change: 1 addition & 0 deletions roles/container-engine/cri-o/templates/crio.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ pinns_path = ""
runtime_path = "{{ runtime.path }}"
runtime_type = "{{ runtime.type }}"
runtime_root = "{{ runtime.root }}"
privileged_without_host_devices = {{ runtime.privileged_without_host_devices|default(false)|lower }}
{% endfor %}

# Kata Containers with the Firecracker VMM
Expand Down

0 comments on commit 01e527a

Please sign in to comment.