Skip to content

Commit

Permalink
Update kubelet based openshift/node
Browse files Browse the repository at this point in the history
Mount /sys/ as in node to avoid kubelet log:
Failed to get system container stats for
"/systemd/system.slice": failed to get cgroup stats
for "/systemd/system.slice": failed to get container
info for "/systemd/system.slice": unknown container
"/systemd/system.slice".

Mount /etc/pki to use the ca from the host.

Mount /var/run/secrets needed for f27 which doesn't have
kube installed and it is required by kubelet to manage
kubernetes secrets.

Mount tmp as tmpfs.

Mount cni dirs.
  • Loading branch information
strigazi committed Feb 8, 2018
1 parent bba75ca commit da74c71
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
2 changes: 1 addition & 1 deletion kubernetes-kubelet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
62 changes: 43 additions & 19 deletions kubernetes-kubelet/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
]
},
{
Expand All @@ -319,8 +334,8 @@
},
{
"type": "bind",
"source": "/var/run/",
"destination": "/var/run/",
"source": "/var/run/secrets",
"destination": "/var/run/secrets",
"options": [
"rbind",
"rw",
Expand Down Expand Up @@ -367,6 +382,15 @@
"rw",
"mode=755"
]
},
{
"destination": "/tmp",
"type": "tmpfs",
"source": "tmpfs",
"options": [
"mode=755",
"size=65536k"
]
}
],
"linux": {
Expand Down
3 changes: 3 additions & 0 deletions kubernetes-kubelet/tmpfiles.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
d /etc/cni/net.d - - - - -
d /var/lib/cni - - - - -
d /var/run/secrets - - - - -

0 comments on commit da74c71

Please sign in to comment.