From bf4f6ee91c42d3eb56f8f4e482c56d0cf42524b9 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 20 Mar 2019 20:50:20 -0700 Subject: [PATCH 1/2] Clarify why disabling the Swap preflight is good for certain users --- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 6b5ddc90fc84..5c09604c03a6 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -57,8 +57,7 @@ var SkipPreflights = []string{ "FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml", "FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml", "FileAvailable--etc-kubernetes-manifests-etcd.yaml", - // We use --ignore-preflight-errors=Swap since minikube.iso allocates a swap partition. - // (it should probably stop doing this, though...) + // So that "none" driver users don't have to reconfigure their machine "Swap", // We use --ignore-preflight-errors=CRI since /var/run/dockershim.sock is not present. // (because we start kubelet with an invalid config) From 089e1c9cc2792bc801f526bf1d8980c8a5aa68c3 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 20 Mar 2019 20:50:49 -0700 Subject: [PATCH 2/2] Remove where a swap partition is created and activated --- .../package/automount/minikube-automount | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/deploy/iso/minikube-iso/package/automount/minikube-automount b/deploy/iso/minikube-iso/package/automount/minikube-automount index 9e0fb740e3a2..1c0baec3e5de 100755 --- a/deploy/iso/minikube-iso/package/automount/minikube-automount +++ b/deploy/iso/minikube-iso/package/automount/minikube-automount @@ -26,25 +26,8 @@ if [ ! -n "$BOOT2DOCKER_DATA" ]; then dd if=$UNPARTITIONED_HD of=/userdata.tar bs=1 count=4096 2>/dev/null # Create the partition, format it and then mount it echo "NEW boot2docker managed disk image ($UNPARTITIONED_HD): formatting it for use" - - # Add a swap partition (so Docker doesn't complain about it missing) - (echo n; echo p; echo 2; echo ; echo +1000M ; echo w) | fdisk $UNPARTITIONED_HD - # Let kernel re-read partition table - partprobe - (echo t; echo 82; echo w) | fdisk $UNPARTITIONED_HD # Let kernel re-read partition table partprobe - # wait for the partition to actually exist, timeout after about 5 seconds - timer=0 - while [ "$timer" -lt 10 ]; do - if [ -b "${UNPARTITIONED_HD}2" ]; then - mkswap "${UNPARTITIONED_HD}2" && break - fi - echo "Waiting for ${UNPARTITIONED_HD}2 to exist." - timer=$((timer + 1)) - sleep 0.5 - done - # Add the data partition (echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $UNPARTITIONED_HD # Let kernel re-read partition table @@ -74,12 +57,6 @@ if [ ! -n "$BOOT2DOCKER_DATA" ]; then if [ $NON_NUL == 0 ]; then # Create the partition, format it and then mount it echo "NEW VMware boot2docker managed disk image ($UNPARTITIONED_HD): formatting it for use" - - # Add a swap partition (so Docker doesn't complain about it missing) - (echo n; echo p; echo 2; echo ; echo +1000M ; echo w) | fdisk $UNPARTITIONED_HD - (echo t; echo 82) | fdisk $UNPARTITIONED_HD - mkswap "${UNPARTITIONED_HD}2" - # Add the data partition (echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk $UNPARTITIONED_HD BOOT2DOCKER_DATA=`echo "${UNPARTITIONED_HD}1"` mkfs.ext4 -i 2048 -L $LABEL $BOOT2DOCKER_DATA @@ -194,7 +171,6 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then mkdir -p /var/run/minikube echo "PERSISTENT_DIR=\"/mnt/$PARTNAME\"" > /var/run/minikube/env fi -swapon "${UNPARTITIONED_HD}2" # /etc dirs are initialised from /usr/local, to allow the user/admin to customise mkdir -p /var/lib/boot2docker/etc/