-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-cri-kube-el7.yaml
88 lines (73 loc) · 1.98 KB
/
docker-cri-kube-el7.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
---
- name: Install docker on all hosts
hosts: kube_master
become: yes
tasks:
- name: Install yum utils
yum:
name: yum-utils
state: present
- name: Install device-mapper-persistent-data
yum:
name: device-mapper-persistent-data
state: present
- name: Install lvm2
yum:
name: lvm2
state: present
- name: Install TC Package
yum:
name: iproute
state: present
- name: Add Docker repo
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
- name: Install cri-dockerd
yum:
name: https://github.com/Mirantis/cri-dockerd/releases/download/v0.2.1/cri-dockerd-0.2.1.20220525024524.cb92d7b-0.el7.x86_64.rpm
state: present
- name: Install Docker
package:
name: docker-ce
state: present
- name: Copy docker custom daeom file to servers
copy:
src: ./daemon.json
dest: /etc/docker/
- name: Start Docker service
service:
name: docker
state: restarted
enabled: yes
- name: Start cri-dockerd service
service:
name: cri-docker.service
state: restarted
enabled: yes
- name: Start cri-dockerd socket
service:
name: cri-docker.socket
state: restarted
enabled: yes
- name: Copy kubernetes repo file to servers
copy:
src: ./kubernetes.repo
dest: /etc/yum.repos.d/
- name: Copy k8s.conf file to servers
copy:
src: ./k8s.conf
dest: /etc/sysctl.d/
- name: Installing kubeadm, kubelet and kubectl
package:
name:
- kubelet-1.23.7
- kubeadm-1.23.7
- kubectl-1.23.7
state: present
disable_excludes: kubernetes
- name: Restart & enable kubelet service
service:
name: kubelet
state: restarted
enabled: yes