diff --git a/kubernetes-kubelet/Dockerfile b/kubernetes-kubelet/Dockerfile index 40b7a16..f522a87 100644 --- a/kubernetes-kubelet/Dockerfile +++ b/kubernetes-kubelet/Dockerfile @@ -18,7 +18,7 @@ LABEL RUN /usr/bin/docker run -d --privileged --net=host --pid=host -v /:/rootfs COPY launch.sh /usr/bin/kubelet-docker.sh -COPY service.template config.json.template /exports/ +COPY tmpfiles.template service.template config.json.template /exports/ RUN mkdir -p /exports/hostfs/etc/kubernetes && cp /etc/kubernetes/{config,kubelet} /exports/hostfs/etc/kubernetes diff --git a/kubernetes-kubelet/config.json.template b/kubernetes-kubelet/config.json.template index 590dae8..6be53c1 100644 --- a/kubernetes-kubelet/config.json.template +++ b/kubernetes-kubelet/config.json.template @@ -266,26 +266,24 @@ ] }, { + "type": "rbind", + "source": "/sys", "destination": "/sys", - "type": "sysfs", - "source": "sysfs", "options": [ - "nosuid", - "noexec", - "nodev" + "rbind", + "rw" ] }, { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] + "type": "bind", + "source": "/etc/cni/net.d", + "destination": "/etc/cni/net.d", + "options": [ + "bind", + "slave", + "rw", + "mode=777" + ] }, { "type": "bind", @@ -297,14 +295,31 @@ "rprivate" ] }, + { + "type": "bind", + "source": "/etc/localtime", + "destination": "/etc/localtime", + "options": [ + "rbind", + "ro" + ] + }, + { + "type": "bind", + "source": "/etc/pki", + "destination": "/etc/pki", + "options": [ + "bind", + "ro" + ] + }, { "destination": "/etc/resolv.conf", "type": "bind", "source": "/etc/resolv.conf", "options": [ "ro", - "rbind", - "rprivate" + "bind" ] }, { @@ -319,8 +334,8 @@ }, { "type": "bind", - "source": "/var/run/", - "destination": "/var/run/", + "source": "/var/run/secrets", + "destination": "/var/run/secrets", "options": [ "rbind", "rw", @@ -367,6 +382,15 @@ "rw", "mode=755" ] + }, + { + "destination": "/tmp", + "type": "tmpfs", + "source": "tmpfs", + "options": [ + "mode=755", + "size=65536k" + ] } ], "linux": { diff --git a/kubernetes-kubelet/tmpfiles.template b/kubernetes-kubelet/tmpfiles.template new file mode 100644 index 0000000..f08634a --- /dev/null +++ b/kubernetes-kubelet/tmpfiles.template @@ -0,0 +1,3 @@ +d /etc/cni/net.d - - - - - +d /var/lib/cni - - - - - +d /var/run/secrets - - - - -