-
Notifications
You must be signed in to change notification settings - Fork 1
/
01-k8s_crio_install.yaml
159 lines (133 loc) · 3.42 KB
/
01-k8s_crio_install.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
- hosts: master
become: true
remote_user: root
vars:
crio_ver: master # release-1.18 not final, use master branch for now
crictl_ver: v1.17.0
cni_plugins_ver: v0.8.5
conmon_version: master # move to v2.0.14 ?
tasks:
- name: Enable EPEL repo
dnf:
name: epel-release
state: present
- name: Enable PowerTools repo
shell: dnf config-manager --set-enabled PowerTools
- name: Update all packages
dnf:
name: "*"
state: latest
- name: Install build deps
dnf:
name:
- pkgconf-pkg-config
- containers-common
- device-mapper-devel
- git
- glib2-devel
- glibc-devel
- glibc-static
- go
- gpgme-devel
- libassuan-devel
- libgpg-error-devel
- libseccomp-devel
- libselinux-devel
- make
- runc
state: present
- name: Clone CRI-O repo
git:
repo: https://github.com/cri-o/cri-o.git
dest: /tmp/cri-o
version: "{{ crio_ver }}"
- name: Make CRIO-O
make:
chdir: /tmp/cri-o
- name: Make install CRI-O
make:
chdir: /tmp/cri-o
target: install
- name: Clone conmon repo
git:
repo: https://github.com/containers/conmon
dest: /tmp/conmon
version: "{{ conmon_version }}"
- name: Make conmon
make:
chdir: /tmp/conmon
- name: Make install conmon
make:
chdir: /tmp/conmon
target: install
- name: Clone CNI-plugins
git:
repo: https://github.com/containernetworking/plugins
dest: /tmp/cni-plugins
version: "{{ cni_plugins_ver }}"
- name: Build CNI-plugins
shell: |
cd /tmp/cni-plugins && ./build_linux.sh
- name: Create CNI bin directory
file:
path: /opt/cni/bin/
state: directory
mode: '0755'
- name: Copy CNI-plugins
copy:
remote_src: yes
src: /tmp/cni-plugins/bin/
dest: /opt/cni/bin/
- name: Create CNI conf directory
file:
path: /etc/cni/net.d/
state: directory
mode: '0755'
- name: Find .conf files
find:
paths: /tmp/cri-o/contrib/cni/
recurse: no
patterns: "*.conf"
register: cni_configs
- name: Copy CNI-configuration
copy:
remote_src: yes
src: "{{ item.path }}"
dest: /etc/cni/net.d/
with_items: "{{ cni_configs.files }}"
- name: Make CRI-O "first run" config
make:
chdir: /tmp/cri-o
target: install.config
- name: Basic registries config
copy:
dest: /etc/containers/registries.conf
content: |
[registries.search]
registries = ['registry.access.redhat.com', 'registry.fedoraproject.org', 'quay.io', 'docker.io']
[registries.insecure]
registries = []
[registries.block]
registries = []
- name: Use systemd cgroups
copy:
dest: /etc/crio/crio.conf.d/01-cgroup-manager.conf
content: |
[crio.runtime]
cgroup_manager = "systemd"
- name: Install systemd service
make:
chdir: /tmp/cri-o
target: install.systemd
- name: Enable and start CRI-O with stystemd
systemd:
daemon_reload: yes
state: started
enabled: yes
name: crio
- name: Install cri-tools (crictl)
unarchive:
src: "https://github.com/kubernetes-sigs/cri-tools/releases/download/{{ crictl_ver }}/crictl-{{ crictl_ver }}-linux-amd64.tar.gz"
dest: /usr/local/bin/
remote_src: yes