kubernetes: Drop custom mounts image and use standard one

Apart from the /var/lib mount itself the custom package:

- Made host /etc/cni and /opt/cni rshared. This has been handled by init make /
  rshared since 3c326bebdf ("Make / rshared").
- Make /var/lib/kubeadm after mount. For now handle this with a dedicated start
  of day container instead.

Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
Ian Campbell 2017-07-14 14:22:40 +01:00
parent 2cfac0e8bb
commit 32506bd7f7
5 changed files with 13 additions and 47 deletions

View File

@ -1,6 +1,6 @@
all: build-container-images build-vm-images
BOX_PLANS = kubernetes.rb mounts.rb
BOX_PLANS = kubernetes.rb
build-container-images: $(BOX_PLANS)
for plan in $(BOX_PLANS) ; do \
@ -13,7 +13,6 @@ build-container-images: $(BOX_PLANS)
push-container-images: build-container-images cache-images
docker image push linuxkit/kubernetes:latest
docker image push linuxkit/kubernetes:latest-mounts
docker image push linuxkit/kubernetes:latest-image-cache-common
docker image push linuxkit/kubernetes:latest-image-cache-control-plane

View File

@ -22,19 +22,3 @@ end
def mount_bind src, dst
"mount --bind #{src} #{dst}"
end
def mount_bind_hostns_self mnt
"nsenter --mount=/proc/1/ns/mnt mount -- --bind #{mnt} #{mnt}"
end
def mount_make_hostns_rshared mnt
"nsenter --mount=/proc/1/ns/mnt mount -- --make-rshared #{mnt}"
end
def mount_persistent_disk mnt
"/mount.sh #{mnt}"
end
def mkdir_p dir
"mkdir -p #{dir}"
end

View File

@ -16,14 +16,13 @@ onboot:
- name: format
image: linuxkit/format:84a997e69051a1bf05b7c1926ab785bb07932954
- name: mounts
image: linuxkit/kubernetes:latest-mounts
capabilities:
- all
pid: host
rootfsPropagation: shared
image: linuxkit/mount:b24bd97ae43397b469dbaadd80f17f291c817bdf
command: ["/mount.sh", "/var/lib/"]
- name: var
image: library/alpine:3.6
command: ["mkdir", "/var/lib/kubeadm"]
binds:
- /dev:/dev
- /var:/var:rshared,rbind
- /var/lib:/var/lib
services:
- name: getty
image: linuxkit/getty:deb9332e786e72591bd9be200bcc9c7a534eb754

View File

@ -16,14 +16,13 @@ onboot:
- name: format
image: linuxkit/format:84a997e69051a1bf05b7c1926ab785bb07932954
- name: mounts
image: linuxkit/kubernetes:latest-mounts
capabilities:
- all
pid: host
rootfsPropagation: shared
image: linuxkit/mount:b24bd97ae43397b469dbaadd80f17f291c817bdf
command: ["/mount.sh", "/var/lib/"]
- name: var
image: library/alpine:3.6
command: ["mkdir", "/var/lib/kubeadm"]
binds:
- /dev:/dev
- /var:/var:rshared,rbind
- /var/lib:/var/lib
services:
- name: getty
image: linuxkit/getty:deb9332e786e72591bd9be200bcc9c7a534eb754

View File

@ -1,15 +0,0 @@
import 'common.rb'
from "linuxkit/mount:ac8939c4102f97c084d9ddfd445c1908fce6d768"
script = [
mount_bind_hostns_self("/etc/cni"), mount_make_hostns_rshared("/etc/cni"),
mount_bind_hostns_self("/opt/cni"), mount_make_hostns_rshared("/opt/cni"),
mount_persistent_disk("/var/lib"),
mkdir_p("/var/lib/kubeadm"),
]
create_shell_wrapper script.join(' && '), '/usr/bin/kube-mounts.sh'
set_exec cmd: [ '/usr/bin/kube-mounts.sh' ]
tag "#{@image_name}:latest-mounts"