mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 01:28:11 -03:30
Add support for CRI-O user namespaces (#8268)
* add support for cri-o user namespaces * comply with yamllint rules
This commit is contained in:
@@ -97,3 +97,12 @@ skopeo_packages:
|
||||
# Configure the cri-o pids limit, increase this for heavily multi-threaded workloads
|
||||
# see https://github.com/cri-o/cri-o/issues/1921
|
||||
crio_pids_limit: 1024
|
||||
|
||||
# Reserve 16M uids and gids for user namespaces (256 pods * 65536 uids/gids)
|
||||
# at the end of the uid/gid space
|
||||
crio_remap_enable: false
|
||||
crio_remap_user: containers
|
||||
crio_subuid_start: 2130706432
|
||||
crio_subuid_length: 16777216
|
||||
crio_subgid_start: 2130706432
|
||||
crio_subgid_length: 16777216
|
||||
|
||||
@@ -182,6 +182,20 @@
|
||||
notify: restart crio
|
||||
when: http_proxy is defined or https_proxy is defined
|
||||
|
||||
- name: Configure the uid/gid space for user namespaces
|
||||
lineinfile:
|
||||
path: '{{ item.path }}'
|
||||
line: '{{ item.entry }}'
|
||||
regex: '^\s*{{ crio_remap_user }}:'
|
||||
state: '{{ "present" if crio_remap_enable | bool else "absent" }}'
|
||||
loop:
|
||||
- path: /etc/subuid
|
||||
entry: '{{ crio_remap_user }}:{{ crio_subuid_start }}:{{ crio_subuid_length }}'
|
||||
- path: /etc/subgid
|
||||
entry: '{{ crio_remap_user }}:{{ crio_subgid_start }}:{{ crio_subgid_length }}'
|
||||
loop_control:
|
||||
label: '{{ item.path }}'
|
||||
|
||||
- name: Ensure crio service is started and enabled
|
||||
service:
|
||||
name: crio
|
||||
|
||||
@@ -294,6 +294,7 @@ runtime_path = "{{ runtime.path }}"
|
||||
runtime_type = "{{ runtime.type }}"
|
||||
runtime_root = "{{ runtime.root }}"
|
||||
privileged_without_host_devices = {{ runtime.privileged_without_host_devices|default(false)|lower }}
|
||||
allowed_annotations = {{ runtime.allowed_annotations|default([])|to_json }}
|
||||
{% endfor %}
|
||||
|
||||
# Kata Containers with the Firecracker VMM
|
||||
|
||||
Reference in New Issue
Block a user