@@ -57,17 +57,15 @@ write_files:
5757
5858
5959
60- yum install -y ebtables \
60+ yum install -y docker-1.13.1 \
61+ ebtables \
6162 ethtool \
6263 nfs-utils \
6364 bash-completion \
6465 sudo \
6566 socat \
6667 wget \
6768 curl \
68- libtool-ltdl \
69- libseccomp \
70- libcgroup \
7169 ipvsadm
7270
7371 #setup some common directories
@@ -77,16 +75,6 @@ write_files:
7775 mkdir -p /etc/cni/net.d
7876 mkdir -p /opt/cni/bin
7977
80- # docker
81- if [ ! -f /opt/bin/docker ]; then
82- # TODO: Support newer versions. Make sure to validate if the newer containerd version has configuration changes
83- # Newer versions of docker use containterd with a config file - containerd from 17.03 does not support that
84- # we maybe need to manage both ways(flags & config) or wait until we deprecate Kubernetes 1.11
85- curl -L http://download.docker.com/linux/static/stable/x86_64/docker-17.03.2-ce.tgz | tar -xvzC /opt/ -f -
86- mv /opt/docker/* /opt/bin/
87- rm -rf /opt/docker
88- fi
89-
9078 # cni
9179 if [ ! -f /opt/cni/bin/loopback ]; then
9280 curl -L https://github.com/containernetworking/plugins/releases/download/v0.6.0/cni-plugins-amd64-v0.6.0.tgz | tar -xvzC /opt/cni/bin -f -
@@ -101,15 +89,10 @@ write_files:
10189 curl -Lfo /opt/bin/health-monitor.sh https://raw.githubusercontent.com/kubermatic/machine-controller/8b5b66e4910a6228dfaecccaa0a3b05ec4902f8e/pkg/userdata/scripts/health-monitor.sh
10290 chmod +x /opt/bin/health-monitor.sh
10391 fi
104-
105-
106- # Make sure systemd is aware of the new units in /etc/systemd/system
107- systemctl daemon-reload
10892 systemctl enable --now docker
10993 systemctl enable --now kubelet
11094 systemctl enable --now --no-block kubelet-healthcheck.service
11195 systemctl enable --now --no-block docker-healthcheck.service
112-
11396
11497- path: "/opt/bin/supervise.sh"
11598 permissions: "0755"
@@ -130,11 +113,12 @@ write_files:
130113 Documentation=https://kubernetes.io/docs/home/
131114
132115 [Service]
133- Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
134116 Restart=always
135117 StartLimitInterval=0
136118 RestartSec=10
137119
120+ Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
121+
138122 ExecStart=/opt/bin/kubelet $KUBELET_EXTRA_ARGS \
139123 --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf \
140124 --kubeconfig=/etc/kubernetes/kubelet.conf \
@@ -162,6 +146,11 @@ write_files:
162146 [Install]
163147 WantedBy=multi-user.target
164148
149+ - path: "/etc/systemd/system/kubelet.service.d/extras.conf"
150+ content: |
151+ [Service]
152+ Environment="KUBELET_EXTRA_ARGS=--cgroup-driver=systemd"
153+
165154- path: "/etc/kubernetes/cloud-config"
166155 content: |
167156 {aws-config:true}
@@ -241,7 +230,6 @@ write_files:
241230 After=kubelet.service
242231
243232 [Service]
244- Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
245233 ExecStart=/opt/bin/health-monitor.sh kubelet
246234
247235 [Install]
@@ -256,50 +244,11 @@ write_files:
256244 After=docker.service
257245
258246 [Service]
259- Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
260247 ExecStart=/opt/bin/health-monitor.sh container-runtime
261248
262249 [Install]
263250 WantedBy=multi-user.target
264251
265252
266- - path: /etc/systemd/system/docker.service
267- permissions: "0644"
268- content: |
269- [Unit]
270- Description=Docker Application Container Engine
271- Documentation=https://docs.docker.com
272- After=network-online.target
273- Wants=network-online.target
274-
275- [Service]
276- Environment="PATH=/opt/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/"
277- Type=notify
278- # the default is not to use systemd for cgroups because the delegate issues still
279- # exists and systemd currently does not support the cgroup feature set required
280- # for containers run by docker
281- ExecStart=/opt/bin/dockerd
282- ExecReload=/bin/kill -s HUP $MAINPID
283- LimitNOFILE=1048576
284- # Having non-zero Limit*s causes performance problems due to accounting overhead
285- # in the kernel. We recommend using cgroups to do container-local accounting.
286- LimitNPROC=infinity
287- LimitCORE=infinity
288- # Uncomment TasksMax if your systemd version supports it.
289- # Only systemd 226 and above support this version.
290-
291- TimeoutStartSec=0
292- # set delegate yes so that systemd does not reset the cgroups of docker containers
293- Delegate=yes
294- # kill only the docker process, not all processes in the cgroup
295- KillMode=process
296- # restart the docker process if it exits prematurely
297- Restart=on-failure
298- StartLimitBurst=3
299- StartLimitInterval=60s
300-
301- [Install]
302- WantedBy=multi-user.target
303-
304253runcmd:
305254- systemctl enable --now setup.service
0 commit comments