Skip to content

Commit e58ed8d

Browse files
committed
more cleanup for kubeadm
Signed-off-by: Antonio Murdaca <[email protected]>
1 parent b6116b2 commit e58ed8d

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

centos.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@
2727
- pkgconfig
2828
- json-glib-devel
2929
- skopeo-containers
30-
- NetworkManager
3130
- docker
32-
- name: Make testing directories to conform to testing standards
31+
- name: Make directories
3332
file:
3433
path: "{{ item }}"
3534
state: directory
3635
with_items:
3736
- /usr/local/go
37+
- /etc/systemd/system/kubelet.service.d/
38+
- /var/lib/etcd
3839
- name: install Golang upstream in CentOS
3940
shell: |
4041
curl -fsSL "https://golang.org/dl/go1.8.3.linux-amd64.tar.gz" \
@@ -46,11 +47,6 @@
4647
insertafter: 'EOF'
4748
regexp: 'export PATH=/usr/local/go/bin:$PATH'
4849
state: present
49-
- name: enable and start NetworkManager
50-
systemd:
51-
name: NetworkManager
52-
state: started
53-
enabled: yes
5450
- name: update all
5551
yum: name=* state=latest
5652
- name: clone runc
@@ -62,7 +58,6 @@
6258
repo: https://github.com/kubernetes-incubator/cri-o
6359
dest: /root/src/github.com/kubernetes-incubator/cri-o
6460
version: kube-1.6.x
65-
force: yes
6661
- name: clone CNI
6762
git:
6863
repo: https://github.com/containernetworking/plugins
@@ -89,8 +84,7 @@
8984
./build.sh && \
9085
mkdir -p /opt/cni/bin && \
9186
cp bin/* /opt/cni/bin/ && \
92-
mkdir -p /etc/cni/net.d && \
93-
cp /root/src/github.com/kubernetes-incubator/cri-o/contrib/cni/99-loopback.conf /etc/cni/net.d
87+
mkdir -p /etc/cni/net.d
9488
- name: run CRI-O with systemd cgroup manager
9589
replace:
9690
regexp: 'cgroupfs'
@@ -116,3 +110,28 @@
116110
state: started
117111
enabled: yes
118112
daemon_reload: yes
113+
- name: "Stop iptables :("
114+
service:
115+
name: iptables
116+
state: stopped
117+
ignore_errors: yes
118+
- name: "Disable iptables :("
119+
service:
120+
name: iptables
121+
enabled: no
122+
ignore_errors: yes"))"
123+
- name: modprobe br_netfilter
124+
command: "modprobe br_netfilter"
125+
- name: tune sysctl
126+
lineinfile:
127+
line: "/proc/sys/net/bridge/bridge-nf-call-iptables = 1"
128+
dest: /etc/sysctl.conf
129+
insertafter: 'EOF'
130+
regexp: '\/proc\/sys\/net\/bridge\/bridge-nf-call-iptables = 1'
131+
state: present
132+
- name: reload sysctl
133+
command: "sysctl -p"
134+
- name: systemd dropin for kubeadm
135+
shell: |
136+
sh -c 'echo "[Service]
137+
Environment=\"KUBELET_EXTRA_ARGS=--enable-cri=true --container-runtime=remote --runtime-request-timeout=15m --image-service-endpoint /var/run/crio.sock --container-runtime-endpoint /var/run/crio.sock\"" > /etc/systemd/system/kubelet.service.d/0-crio.conf'

0 commit comments

Comments
 (0)