forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
671 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Kata Containers | ||
|
||
[Kata Containers](https://katacontainers.io) is a secure container runtime with lightweight virtual machines that supports multiple hypervisor solutions. | ||
|
||
## Hypervisors | ||
|
||
_Qemu_ is the only hypervisor supported by Kubespray. | ||
|
||
## Installation | ||
|
||
To use Kata Containers, set the following variables: | ||
|
||
**k8s-cluster.yml**: | ||
|
||
```yaml | ||
container_manager: containerd | ||
kata_containers_enabled: true | ||
``` | ||
**etcd.yml**: | ||
```yaml | ||
etcd_deployment_type: host | ||
``` | ||
## Configuration | ||
### Recommended : Pod Overhead | ||
[Pod Overhead](https://kubernetes.io/docs/concepts/configuration/pod-overhead/) is a feature for accounting for the resources consumed by the Runtime Class used by the Pod. | ||
When this feature is enabled, Kubernetes will count the fixed amount of CPU and memory set in the configuration as used by the virtual machine and not by the containers running in the Pod. | ||
Pod Overhead is mandatory if you run Pods with Kata Containers that use [resources limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits). | ||
**Set cgroup driver**: | ||
To enable Pod Overhead feature you have to configure Kubelet with the appropiate cgroup driver, using the following configuration: | ||
```yaml | ||
kubelet_cgroup_driver: cgroupfs | ||
``` | ||
**Qemu hypervisor configuration**: | ||
The configuration for the Qemu hypervisor uses the following values: | ||
```yaml | ||
kata_containers_qemu_overhead: true | ||
kata_containers_qemu_overhead_fixed_cpu: 10m | ||
kata_containers_qemu_overhead_fixed_memory: 290Mi | ||
``` | ||
### Optional : Select Kata Containers version | ||
Optionally you can select the Kata Containers release version to be installed. The available releases are published in [GitHub](https://github.com/kata-containers/runtime/releases). | ||
```yaml | ||
kata_containers_version: 1.11.1 | ||
``` | ||
### Optional : Debug | ||
Debug is disabled by default for all the components of Kata Containers. You can change this behaviour with the following configuration: | ||
```yaml | ||
kata_containers_qemu_debug: 'false' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
|
||
kata_containers_version: 1.11.1 | ||
kata_containers_release_url: https://github.com/kata-containers/runtime/releases/download/{{ kata_containers_version }}/kata-static-{{ kata_containers_version }}-{{ ansible_architecture }}.tar.xz | ||
kata_containers_dir: /opt/kata | ||
kata_containers_config_dir: /etc/kata-containers | ||
kata_containers_containerd_bin_dir: /usr/local/bin | ||
|
||
kata_containers_qemu_default_memory: "{{ ansible_memtotal_mb }}" | ||
kata_containers_qemu_debug: 'false' | ||
kata_containers_qemu_sandbox_cgroup_only: 'true' | ||
kata_containers_qemu_enable_mem_prealloc: 'false' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
|
||
- name: Download artifacts | ||
unarchive: | ||
src: "{{ kata_containers_release_url }}" | ||
dest: / | ||
remote_src: true | ||
|
||
- name: Create config directory | ||
file: | ||
path: "{{ kata_containers_config_dir }}" | ||
state: directory | ||
|
||
- name: Set configuration | ||
template: | ||
src: "{{ item }}.j2" | ||
dest: "{{ kata_containers_config_dir }}/{{ item }}" | ||
with_items: | ||
- configuration-qemu.toml | ||
|
||
- name: Set containerd bin | ||
vars: | ||
shim: "{{ item }}" | ||
template: | ||
dest: "{{ kata_containers_containerd_bin_dir }}/containerd-shim-kata-{{ item }}-v2" | ||
src: containerd-shim-kata-v2.j2 | ||
mode: 0755 | ||
with_items: | ||
- qemu |
Oops, something went wrong.