add kubespray to the XTesting as it provides newer version of kubenetes and can be...
[it/test.git] / XTesting / kubespray / docs / cri-o.md
1 # CRI-O
2
3 [CRI-O] is a lightweight container runtime for Kubernetes.
4 Kubespray supports basic functionality for using CRI-O as the default container runtime in a cluster.
5
6 * Kubernetes supports CRI-O on v1.11.1 or later.
7 * etcd: configure either kubeadm managed etcd or host deployment
8
9 _To use the CRI-O container runtime set the following variables:_
10
11 ## all/all.yml
12
13 ```yaml
14 download_container: false
15 skip_downloads: false
16 etcd_deployment_type: host # optionally kubeadm
17 ```
18
19 ## k8s_cluster/k8s_cluster.yml
20
21 ```yaml
22 container_manager: crio
23 ```
24
25 ## all/crio.yml
26
27 Enable docker hub registry mirrors
28
29 ```yaml
30 crio_registries:
31   - prefix: docker.io
32     insecure: false
33     blocked: false
34     location: registry-1.docker.io
35     unqualified: false
36     mirrors:
37       - location: 192.168.100.100:5000
38         insecure: true
39       - location: mirror.gcr.io
40         insecure: false
41 ```
42
43 ## Note about pids_limit
44
45 For heavily mult-threaded workloads like databases, the default of 1024 for pids-limit is too low.
46 This parameter controls not just the number of processes but also the amount of threads
47 (since a thread is technically a process with shared memory). See [cri-o#1921]
48
49 In order to increase the default `pids_limit` for cri-o based deployments you need to set the `crio_pids_limit`
50 for your `k8s_cluster` ansible group or per node depending on the use case.
51
52 ```yaml
53 crio_pids_limit: 4096
54 ```
55
56 [CRI-O]: https://cri-o.io/
57 [cri-o#1921]: https://github.com/cri-o/cri-o/issues/1921
58
59 ## Note about user namespaces
60
61 CRI-O has support for user namespaces. This feature is optional and can be enabled by setting the following two variables.
62
63 ```yaml
64 crio_runtimes:
65   - name: runc
66     path: /usr/bin/runc
67     type: oci
68     root: /run/runc
69     allowed_annotations:
70     - "io.kubernetes.cri-o.userns-mode"
71
72 crio_remap_enable: true
73 ```
74
75 The `allowed_annotations` configures `crio.conf` accordingly.
76
77 The `crio_remap_enable` configures the `/etc/subuid` and `/etc/subgid` files to add an entry for the **containers** user.
78 By default, 16M uids and gids are reserved for user namespaces (256 pods * 65536 uids/gids) at the end of the uid/gid space.