Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal minikube-automount to the kic image #8780

Merged
merged 4 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ storage-provisioner-image: out/storage-provisioner-$(GOARCH) ## Build storage-pr
.PHONY: kic-base-image
kic-base-image: ## builds the base image used for kic.
docker rmi -f $(REGISTRY)/kicbase:$(KIC_VERSION)-snapshot || true
docker build -f ./hack/images/kicbase.Dockerfile -t $(REGISTRY)/kicbase:$(KIC_VERSION)-snapshot --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) --cache-from $(REGISTRY)/kicbase:$(KIC_VERSION) --target base .
docker build -f ./hack/images/kicbase.Dockerfile -t $(REGISTRY)/kicbase:$(KIC_VERSION)-snapshot --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) --cache-from $(REGISTRY)/kicbase:$(KIC_VERSION) --target base ./hack/images

.PHONY: upload-preloaded-images-tar
upload-preloaded-images-tar: out/minikube # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
Expand Down
19 changes: 19 additions & 0 deletions hack/images/automount/minikube-automount
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -x

echo "automount ...";

if [ -d /var ]; then
mkdir -p /var/data
mkdir /data
mount --bind /var/data /data

mkdir -p /var/hostpath_pv
mkdir /tmp/hostpath_pv
mount --bind /var/hostpath_pv /tmp/hostpath_pv

mkdir -p /var/hostpath-provisioner
mkdir /tmp/hostpath-provisioner
mount --bind /var/hostpath-provisioner /tmp/hostpath-provisioner
fi
13 changes: 13 additions & 0 deletions hack/images/automount/minikube-automount.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=minikube automount
Requires=local-fs.target
Before=docker.service
After=local-fs.target

[Service]
ExecStart=/usr/sbin/minikube-automount
Type=oneshot
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
7 changes: 6 additions & 1 deletion hack/images/kicbase.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sudo=1.8.27-1ubuntu4.1 \
docker.io=19.03.2-0ubuntu1 \
openssh-server=1:8.0p1-6build1 \
dnsutils=1:9.11.5.P4+dfsg-5.1ubuntu2.1 \
dnsutils=1:9.11.5.P4+dfsg-5.1ubuntu2.2 \
# libglib2.0-0 is required for conmon, which is required for podman
libglib2.0-0=2.62.1-1 \
&& rm /etc/crictl.yaml
Expand All @@ -28,6 +28,11 @@ RUN apt-get install -y --no-install-recommends podman
# install varlink
RUN apt-get install -y --no-install-recommends varlink

# automount service
COPY automount/minikube-automount /usr/sbin/minikube-automount
COPY automount/minikube-automount.service /usr/lib/systemd/system/minikube-automount.service
RUN ln -fs /usr/lib/systemd/system/minikube-automount.service \
/etc/systemd/system/multi-user.target.wants/minikube-automount.service

# disable non-docker runtimes by default
RUN systemctl disable containerd && systemctl disable crio && rm /etc/crictl.yaml
Expand Down