Fist push
This commit is contained in:
parent
59ffebad70
commit
f7cad27a20
8 changed files with 151 additions and 0 deletions
1
defaults/main.yml
Normal file
1
defaults/main.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
---
|
||||||
4
handlers/main.yml
Normal file
4
handlers/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- name: Restart containerd
|
||||||
|
service: name=containerd state=restarted
|
||||||
|
|
||||||
4
meta/main.yml
Normal file
4
meta/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#---
|
||||||
|
#dependencies:
|
||||||
|
# - { role: yumrepo }
|
||||||
|
# - { role: yum }
|
||||||
59
tasks/main.yml
Normal file
59
tasks/main.yml
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
---
|
||||||
|
- name: Include vars for {{ ansible_os_family }}
|
||||||
|
include_vars: "{{ ansible_os_family }}.yml"
|
||||||
|
|
||||||
|
- name: Remove all other's containerd version packages
|
||||||
|
package: name="{{ containerd_remove_packages_name }}" state=absent update_cache=yes
|
||||||
|
|
||||||
|
- name: Install containerd
|
||||||
|
package: name="{{ containerd_package_name }}" state=latest update_cache=yes
|
||||||
|
notify: Restart containerd
|
||||||
|
|
||||||
|
- name: Enable containerd on boot
|
||||||
|
service: name=containerd state=started enabled=yes
|
||||||
|
|
||||||
|
- sysctl:
|
||||||
|
name: "{{ item }}"
|
||||||
|
value: 1
|
||||||
|
sysctl_file: /etc/sysctl.d/99-kubernetes-cri.conf
|
||||||
|
reload: yes
|
||||||
|
with_items:
|
||||||
|
- "net.bridge.bridge-nf-call-iptables"
|
||||||
|
- "net.ipv4.ip_forward"
|
||||||
|
- "net.bridge.bridge-nf-call-ip6tables"
|
||||||
|
|
||||||
|
- name: Load kernel module
|
||||||
|
modprobe:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
with_items:
|
||||||
|
- br_netfilter
|
||||||
|
- overlay
|
||||||
|
|
||||||
|
- name: Configuring kernel module to be load on boot
|
||||||
|
template:
|
||||||
|
src: "etc/modules-load.d/{{ item }}.conf.j2"
|
||||||
|
dest: "/etc/modules-load.d/{{ item }}.conf"
|
||||||
|
group: root
|
||||||
|
owner: root
|
||||||
|
mode: 0644
|
||||||
|
with_items:
|
||||||
|
- "br_netfilter"
|
||||||
|
- "overlay"
|
||||||
|
|
||||||
|
- name: Ensuring /etc/containerd folder exists
|
||||||
|
file:
|
||||||
|
path: "/etc/containerd"
|
||||||
|
state: "directory"
|
||||||
|
group: root
|
||||||
|
owner: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Configuring containerd
|
||||||
|
template:
|
||||||
|
src: "etc/containerd/config.toml.j2"
|
||||||
|
dest: "/etc/containerd/config.toml"
|
||||||
|
group: root
|
||||||
|
owner: root
|
||||||
|
mode: 0644
|
||||||
|
notify: Restart containerd
|
||||||
76
templates/etc/containerd/config.toml.j2
Normal file
76
templates/etc/containerd/config.toml.j2
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
root = "/var/lib/containerd"
|
||||||
|
state = "/run/containerd"
|
||||||
|
oom_score = 0
|
||||||
|
|
||||||
|
[grpc]
|
||||||
|
address = "/run/containerd/containerd.sock"
|
||||||
|
uid = 0
|
||||||
|
gid = 0
|
||||||
|
max_recv_message_size = 16777216
|
||||||
|
max_send_message_size = 16777216
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
address = ""
|
||||||
|
uid = 0
|
||||||
|
gid = 0
|
||||||
|
level = ""
|
||||||
|
|
||||||
|
[metrics]
|
||||||
|
address = ""
|
||||||
|
grpc_histogram = false
|
||||||
|
|
||||||
|
[cgroup]
|
||||||
|
path = ""
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
[plugins.cgroups]
|
||||||
|
no_prometheus = false
|
||||||
|
[plugins.cri]
|
||||||
|
stream_server_address = "127.0.0.1"
|
||||||
|
stream_server_port = "0"
|
||||||
|
enable_selinux = false
|
||||||
|
sandbox_image = "k8s.gcr.io/pause:3.1"
|
||||||
|
stats_collect_period = 10
|
||||||
|
systemd_cgroup = true
|
||||||
|
enable_tls_streaming = false
|
||||||
|
max_container_log_line_size = 16384
|
||||||
|
[plugins.cri.containerd]
|
||||||
|
snapshotter = "overlayfs"
|
||||||
|
no_pivot = false
|
||||||
|
[plugins.cri.containerd.default_runtime]
|
||||||
|
runtime_type = "io.containerd.runtime.v1.linux"
|
||||||
|
runtime_engine = ""
|
||||||
|
runtime_root = ""
|
||||||
|
[plugins.cri.containerd.untrusted_workload_runtime]
|
||||||
|
runtime_type = ""
|
||||||
|
runtime_engine = ""
|
||||||
|
runtime_root = ""
|
||||||
|
[plugins.cri.cni]
|
||||||
|
bin_dir = "/opt/cni/bin"
|
||||||
|
conf_dir = "/etc/cni/net.d"
|
||||||
|
conf_template = ""
|
||||||
|
[plugins.cri.registry]
|
||||||
|
[plugins.cri.registry.mirrors]
|
||||||
|
[plugins.cri.registry.mirrors."docker.io"]
|
||||||
|
endpoint = ["https://registry-1.docker.io"]
|
||||||
|
[plugins.cri.x509_key_pair_streaming]
|
||||||
|
tls_cert_file = ""
|
||||||
|
tls_key_file = ""
|
||||||
|
[plugins.diff-service]
|
||||||
|
default = ["walking"]
|
||||||
|
[plugins.linux]
|
||||||
|
shim = "containerd-shim"
|
||||||
|
runtime = "runc"
|
||||||
|
runtime_root = ""
|
||||||
|
no_shim = false
|
||||||
|
shim_debug = false
|
||||||
|
[plugins.opt]
|
||||||
|
path = "/opt/containerd"
|
||||||
|
[plugins.restart]
|
||||||
|
interval = "10s"
|
||||||
|
[plugins.scheduler]
|
||||||
|
pause_threshold = 0.02
|
||||||
|
deletion_threshold = 0
|
||||||
|
mutation_threshold = 100
|
||||||
|
schedule_delay = "0s"
|
||||||
|
startup_delay = "100ms"
|
||||||
1
templates/etc/modules-load.d/br_netfilter.conf.j2
Normal file
1
templates/etc/modules-load.d/br_netfilter.conf.j2
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
br_netfilter
|
||||||
1
templates/etc/modules-load.d/overlay.conf.j2
Normal file
1
templates/etc/modules-load.d/overlay.conf.j2
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
overlay
|
||||||
5
vars/RedHat.yml
Normal file
5
vars/RedHat.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
containerd_package_name:
|
||||||
|
- containerd
|
||||||
|
containerd_remove_packages_name:
|
||||||
|
- containers.io
|
||||||
Loading…
Add table
Add a link
Reference in a new issue