Merge remote-tracking branch 'origin/master' into image-name
commit
a143711b6a
21
Makefile
21
Makefile
|
@ -78,6 +78,7 @@ MINIKUBE_MARKDOWN_FILES := README.md docs CONTRIBUTING.md CHANGELOG.md
|
|||
MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
|
||||
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
|
||||
SOURCE_DIRS = cmd pkg test
|
||||
SOURCE_PACKAGES = ./cmd/... ./pkg/... ./test/...
|
||||
|
||||
# $(call DOCKER, image, command)
|
||||
define DOCKER
|
||||
|
@ -175,7 +176,7 @@ test-iso:
|
|||
|
||||
.PHONY: test-pkg
|
||||
test-pkg/%:
|
||||
go test -v -test.timeout=30m $(REPOPATH)/$* --tags="$(MINIKUBE_BUILD_TAGS)"
|
||||
go test -v -test.timeout=60m $(REPOPATH)/$* --tags="$(MINIKUBE_BUILD_TAGS)"
|
||||
|
||||
.PHONY: depend
|
||||
depend: out/minikube.d out/test.d out/docker-machine-driver-hyperkit.d out/storage-provisioner.d out/docker-machine-driver-kvm2.d
|
||||
|
@ -188,15 +189,15 @@ drivers: out/docker-machine-driver-hyperkit out/docker-machine-driver-kvm2
|
|||
|
||||
.PHONY: integration
|
||||
integration: out/minikube
|
||||
go test -v -test.timeout=30m $(REPOPATH)/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" $(TEST_ARGS)
|
||||
go test -v -test.timeout=60m $(REPOPATH)/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" $(TEST_ARGS)
|
||||
|
||||
.PHONY: integration-none-driver
|
||||
integration-none-driver: e2e-linux-amd64 out/minikube-linux-amd64
|
||||
sudo -E out/e2e-linux-amd64 -testdata-dir "test/integration/testdata" -minikube-start-args="--vm-driver=none" -test.v -test.timeout=30m -binary=out/minikube-linux-amd64 $(TEST_ARGS)
|
||||
sudo -E out/e2e-linux-amd64 -testdata-dir "test/integration/testdata" -minikube-start-args="--vm-driver=none" -test.v -test.timeout=60m -binary=out/minikube-linux-amd64 $(TEST_ARGS)
|
||||
|
||||
.PHONY: integration-versioned
|
||||
integration-versioned: out/minikube
|
||||
go test -v -test.timeout=30m $(REPOPATH)/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS) versioned" $(TEST_ARGS)
|
||||
go test -v -test.timeout=60m $(REPOPATH)/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS) versioned" $(TEST_ARGS)
|
||||
|
||||
.PHONY: test
|
||||
out/test.d: pkg/minikube/assets/assets.go
|
||||
|
@ -218,7 +219,8 @@ e2e-cross: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe
|
|||
|
||||
.PHONY: checksum
|
||||
checksum:
|
||||
for f in out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe out/minikube.iso; do \
|
||||
for f in out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe out/minikube.iso \
|
||||
out/docker-machine-driver-kvm2 out/docker-machine-driver-hyperkit; do \
|
||||
if [ -f "$${f}" ]; then \
|
||||
openssl sha256 "$${f}" | awk '{print $$2}' > "$${f}.sha256" ; \
|
||||
fi ; \
|
||||
|
@ -236,9 +238,13 @@ gendocs: out/docs/minikube.md
|
|||
fmt:
|
||||
@gofmt -l -s -w $(SOURCE_DIRS)
|
||||
|
||||
.PHONY: vet
|
||||
vet:
|
||||
@go vet $(SOURCE_PACKAGES)
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@golint $(MINIKUBE_TEST_FILES)
|
||||
@golint -set_exit_status $(SOURCE_PACKAGES)
|
||||
|
||||
.PHONY: reportcard
|
||||
reportcard:
|
||||
|
@ -389,5 +395,6 @@ install-kvm: out/docker-machine-driver-kvm2
|
|||
cp out/docker-machine-driver-kvm2 $(GOBIN)/docker-machine-driver-kvm2
|
||||
|
||||
.PHONY: release-kvm-driver
|
||||
release-kvm-driver: kvm_in_docker install-kvm
|
||||
release-kvm-driver: kvm_in_docker checksum install-kvm
|
||||
gsutil cp $(GOBIN)/docker-machine-driver-kvm2 gs://minikube/drivers/kvm/$(VERSION)/
|
||||
gsutil cp $(GOBIN)/docker-machine-driver-kvm2.sha256 gs://minikube/drivers/kvm/$(VERSION)/
|
||||
|
|
|
@ -84,6 +84,7 @@ const (
|
|||
vpnkitSock = "hyperkit-vpnkit-sock"
|
||||
vsockPorts = "hyperkit-vsock-ports"
|
||||
gpu = "gpu"
|
||||
hidden = "hidden"
|
||||
embedCerts = "embed-certs"
|
||||
noVTXCheck = "no-vtx-check"
|
||||
)
|
||||
|
@ -143,6 +144,7 @@ func init() {
|
|||
startCmd.Flags().String(vpnkitSock, "", "Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock.")
|
||||
startCmd.Flags().StringSlice(vsockPorts, []string{}, "List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now).")
|
||||
startCmd.Flags().Bool(gpu, false, "Enable experimental NVIDIA GPU support in minikube (works only with kvm2 driver on Linux)")
|
||||
startCmd.Flags().Bool(hidden, false, "Hide the hypervisor signature from the guest in minikube (works only with kvm2 driver on Linux)")
|
||||
startCmd.Flags().Bool(noVTXCheck, false, "Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)")
|
||||
viper.BindPFlags(startCmd.Flags())
|
||||
RootCmd.AddCommand(startCmd)
|
||||
|
@ -238,6 +240,9 @@ func validateConfig() {
|
|||
if viper.GetBool(gpu) && viper.GetString(vmDriver) != "kvm2" {
|
||||
exit.Usage("Sorry, the --gpu feature is currently only supported with --vm-driver=kvm2")
|
||||
}
|
||||
if viper.GetBool(hidden) && viper.GetString(vmDriver) != "kvm2" {
|
||||
exit.Usage("Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2")
|
||||
}
|
||||
}
|
||||
|
||||
// beginCacheImages caches Docker images in the background
|
||||
|
@ -303,6 +308,7 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
|
|||
DisableDriverMounts: viper.GetBool(disableDriverMounts),
|
||||
UUID: viper.GetString(uuid),
|
||||
GPU: viper.GetBool(gpu),
|
||||
Hidden: viper.GetBool(hidden),
|
||||
NoVTXCheck: viper.GetBool(noVTXCheck),
|
||||
},
|
||||
KubernetesConfig: cfg.KubernetesConfig{
|
||||
|
@ -528,14 +534,14 @@ func bootstrapCluster(bs bootstrapper.Bootstrapper, r cruntime.Manager, runner b
|
|||
if preexisting {
|
||||
console.OutStyle("restarting", "Relaunching Kubernetes %s using %s ... ", kc.KubernetesVersion, bsName)
|
||||
if err := bs.RestartCluster(kc); err != nil {
|
||||
exit.WithProblems("Error restarting cluster", err, logs.FindProblems(r, bs, runner))
|
||||
exit.WithLogEntries("Error restarting cluster", err, logs.FindProblems(r, bs, runner))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
console.OutStyle("launch", "Launching Kubernetes %s using %s ... ", kc.KubernetesVersion, bsName)
|
||||
if err := bs.StartCluster(kc); err != nil {
|
||||
exit.WithProblems("Error starting cluster", err, logs.FindProblems(r, bs, runner))
|
||||
exit.WithLogEntries("Error starting cluster", err, logs.FindProblems(r, bs, runner))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -552,7 +558,7 @@ func validateCluster(bs bootstrapper.Bootstrapper, r cruntime.Manager, runner bo
|
|||
}
|
||||
err := pkgutil.RetryAfter(20, k8sStat, 3*time.Second)
|
||||
if err != nil {
|
||||
exit.WithProblems("kubelet checks failed", err, logs.FindProblems(r, bs, runner))
|
||||
exit.WithLogEntries("kubelet checks failed", err, logs.FindProblems(r, bs, runner))
|
||||
}
|
||||
aStat := func() (err error) {
|
||||
st, err := bs.GetAPIServerStatus(net.ParseIP(ip))
|
||||
|
@ -565,7 +571,7 @@ func validateCluster(bs bootstrapper.Bootstrapper, r cruntime.Manager, runner bo
|
|||
|
||||
err = pkgutil.RetryAfter(30, aStat, 10*time.Second)
|
||||
if err != nil {
|
||||
exit.WithProblems("apiserver checks failed", err, logs.FindProblems(r, bs, runner))
|
||||
exit.WithLogEntries("apiserver checks failed", err, logs.FindProblems(r, bs, runner))
|
||||
}
|
||||
console.OutLn("")
|
||||
}
|
||||
|
|
|
@ -50,9 +50,13 @@ if [ ! -f "${osrelease}" ] || systemctl is-failed -q "${machinename}" ; then
|
|||
sudo chown "${USER}:" "${machinepath}"
|
||||
|
||||
if [[ -n "${have_docker_image}" ]]; then
|
||||
riid=$(sudo --preserve-env rkt --insecure-options=image fetch "docker://${TOOLBOX_DOCKER_IMAGE}:${TOOLBOX_DOCKER_TAG}")
|
||||
sudo --preserve-env rkt image extract --overwrite --rootfs-only "${riid}" "${machinepath}"
|
||||
sudo --preserve-env rkt image rm "${riid}"
|
||||
piid=$(sudo --preserve-env podman pull "docker://${TOOLBOX_DOCKER_IMAGE}:${TOOLBOX_DOCKER_TAG}")
|
||||
pcid=$(sudo --preserve-env podman create "${piid}")
|
||||
mnt=$(sudo --preserve-env podman mount "${pcid}")
|
||||
sudo --preserve-env rsync -ax "${mnt}"/ "${machinepath}"/
|
||||
sudo --preserve-env podman unmount "${pcid}"
|
||||
sudo --preserve-env podman rm "${pcid}"
|
||||
sudo --preserve-env podman rmi "${piid}"
|
||||
else
|
||||
echo "Error: No toolbox filesystem specified." >&2
|
||||
exit 1
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
rkt -1 rkt -1 - /home/rkt /bin/bash rkt-admin,wheel,vboxsf -
|
||||
docker -1 docker -1 =tcuser /home/docker /bin/bash rkt,rkt-admin,wheel,vboxsf -
|
||||
docker -1 docker -1 =tcuser /home/docker /bin/bash wheel,vboxsf -
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
menu "System tools"
|
||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/rkt-bin/Config.in"
|
||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/rktlet-master/Config.in"
|
||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/runc-master/Config.in"
|
||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/podman/Config.in"
|
||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crio-bin/Config.in"
|
||||
|
|
|
@ -129,28 +129,6 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then
|
|||
mkdir /tmp/hostpath-provisioner
|
||||
mount --bind /mnt/$PARTNAME/hostpath-provisioner /tmp/hostpath-provisioner
|
||||
|
||||
rm -rf /var/lib/rkt
|
||||
if [ ! -d /mnt/$PARTNAME/var/lib/rkt ]; then
|
||||
mkdir -p /mnt/$PARTNAME/var/lib/rkt
|
||||
chown root:rkt /mnt/$PARTNAME/var/lib/rkt
|
||||
fi
|
||||
mkdir /var/lib/rkt
|
||||
mount --bind /mnt/$PARTNAME/var/lib/rkt /var/lib/rkt
|
||||
|
||||
if [ ! -d /mnt/$PARTNAME/var/lib/rkt-etc ]; then
|
||||
mkdir -p /mnt/$PARTNAME/var/lib/rkt-etc
|
||||
cp -rp /etc/rkt/* /mnt/$PARTNAME/var/lib/rkt-etc
|
||||
chown root:rkt-admin /mnt/$PARTNAME/var/lib/rkt-etc
|
||||
chmod ug+rw /mnt/$PARTNAME/var/lib/rkt-etc
|
||||
fi
|
||||
rm -rf /etc/rkt
|
||||
mkdir /etc/rkt
|
||||
mount --bind /mnt/$PARTNAME/var/lib/rkt-etc /etc/rkt
|
||||
|
||||
if [ ! -d /var/lib/rkt/pods ]; then
|
||||
systemd-tmpfiles --create rkt.conf
|
||||
fi
|
||||
|
||||
if [ -e "/userdata.tar" ]; then
|
||||
mv /userdata.tar /var/lib/boot2docker/
|
||||
fi
|
||||
|
@ -163,6 +141,10 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then
|
|||
mkdir /var/lib/minikube
|
||||
mount --bind /mnt/$PARTNAME/var/lib/minikube /var/lib/minikube
|
||||
|
||||
mkdir -p /mnt/$PARTNAME/var/lib/toolbox
|
||||
mkdir /var/lib/toolbox
|
||||
mount --bind /mnt/$PARTNAME/var/lib/toolbox /var/lib/toolbox
|
||||
|
||||
mkdir -p /mnt/$PARTNAME/var/lib/minishift
|
||||
mkdir /var/lib/minishift
|
||||
mount --bind /mnt/$PARTNAME/var/lib/minishift /var/lib/minishift
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[Unit]
|
||||
Description=minikube automount
|
||||
Requires=systemd-udev-settle.service
|
||||
Before=docker.service rkt-api.service rkt-metadata.service
|
||||
Before=docker.service
|
||||
After=systemd-udev-settle.service
|
||||
|
||||
[Service]
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
config BR2_PACKAGE_RKT_BIN
|
||||
bool "rkt-bin"
|
||||
default y
|
||||
depends on BR2_x86_64
|
|
@ -1,9 +0,0 @@
|
|||
sha256 7e7c122f92f1dd8e621580869903a367e6ba2dd80f3ab9bf40b089d972d0c827 rkt-v1.14.0.tar.gz
|
||||
sha256 dd514db743e9f8bdae9169bf416d6ed8a83e862e0621ce57a9d20a4f7bb1adbb rkt-v1.14.0.tar.gz.asc
|
||||
sha256 2c00e816a5b470f29483d9660bd62e80da8f14e2a0ba79c841e15e1a28fbf975 rkt-v1.23.0.tar.gz
|
||||
sha256 5aa2c2ac71f21bf3fc8a94b1bdd0b2c0f4060ad9054502b0a693f4632b093c2e rkt-v1.23.0.tar.gz.asc
|
||||
sha256 0ec396f1af7782e402d789e6e34e9257033efac5db71d740f9742f3469d02298 rkt-v1.24.0.tar.gz
|
||||
sha256 577a7a7e3512c0116b3642c710304d4f36a1f66c7e34ec8753dae168a29761e3 rkt-v1.24.0.tar.gz.asc
|
||||
sha256 f6a51fe1d11aaecef965cca729f260f9ea691f6576e8698b49a2daedfc48c427 rkt-v1.30.0.tar.gz
|
||||
sha256 874d8bcf9dd09599b2d090259485a49a6c1f4a74f55065dec8ac37e283c27592 rkt-v1.30.0.tar.gz.asc
|
||||
sha256 b7a769456e62d10a042a4fad79f1fe595d8c392490a6ff611c759c0669d99a97 app-signing-pubkey.gpg
|
|
@ -1,74 +0,0 @@
|
|||
################################################################################
|
||||
#
|
||||
# rkt
|
||||
#
|
||||
################################################################################
|
||||
|
||||
RKT_BIN_VERSION = 1.30.0
|
||||
RKT_BIN_SITE = https://github.com/coreos/rkt/releases/download/v$(RKT_BIN_VERSION)
|
||||
RKT_BIN_SOURCE = rkt-v$(RKT_BIN_VERSION).tar.gz
|
||||
|
||||
RKT_BIN_EXTRA_DOWNLOADS = \
|
||||
https://github.com/coreos/rkt/releases/download/v$(RKT_BIN_VERSION)/rkt-v$(RKT_BIN_VERSION).tar.gz.asc \
|
||||
https://coreos.com/dist/pubkeys/app-signing-pubkey.gpg
|
||||
|
||||
define RKT_BIN_USERS
|
||||
- -1 rkt-admin -1 - - - - -
|
||||
- -1 rkt -1 - - - - -
|
||||
endef
|
||||
|
||||
define RKT_BIN_BUILD_CMDS
|
||||
gpg2 --import $(BR2_DL_DIR)/rkt-bin/app-signing-pubkey.gpg
|
||||
|
||||
gpg2 \
|
||||
--trusted-key `gpg2 --with-colons --keyid-format long -k security@coreos.com | egrep ^pub | cut -d ':' -f5` \
|
||||
--verify-files $(BR2_DL_DIR)/rkt-bin/rkt-v$(RKT_BIN_VERSION).tar.gz.asc
|
||||
|
||||
mkdir -p $(TARGET_DIR)/var/lib/rkt
|
||||
endef
|
||||
|
||||
define RKT_BIN_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D -m 0755 \
|
||||
$(@D)/rkt \
|
||||
$(TARGET_DIR)/bin/rkt
|
||||
|
||||
mkdir -p $(TARGET_DIR)/etc/bash_completion.d
|
||||
|
||||
$(INSTALL) -D -m 644 \
|
||||
$(@D)/bash_completion/rkt.bash \
|
||||
$(TARGET_DIR)/etc/bash_completion.d/rkt
|
||||
|
||||
mkdir -p $(TARGET_DIR)/usr/lib/rkt/stage1-images
|
||||
|
||||
install -Dm644 \
|
||||
$(@D)/stage1-coreos.aci \
|
||||
$(TARGET_DIR)/usr/lib/rkt/stage1-images/stage1-coreos.aci
|
||||
endef
|
||||
|
||||
define RKT_BIN_INSTALL_INIT_SYSTEMD
|
||||
mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
|
||||
|
||||
$(INSTALL) -D -m 644 \
|
||||
$(@D)/init/systemd/tmpfiles.d/rkt.conf \
|
||||
$(TARGET_DIR)/usr/lib/tmpfiles.d/rkt.conf
|
||||
|
||||
$(call rkt-install-service,rkt-api.service)
|
||||
$(call rkt-install-service,rkt-gc.timer)
|
||||
$(call rkt-install-service,rkt-gc.service)
|
||||
$(call rkt-install-service,rkt-metadata.socket)
|
||||
$(call rkt-install-service,rkt-metadata.service)
|
||||
endef
|
||||
|
||||
define rkt-install-service
|
||||
$(INSTALL) -D -m 644 \
|
||||
$(@D)/init/systemd/$(1) \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/$(1)
|
||||
$(call link-service,$(1))
|
||||
endef
|
||||
|
||||
define link-service
|
||||
ln -fs /usr/lib/systemd/system/$(1) \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/$(1)
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
|
@ -1,16 +0,0 @@
|
|||
config BR2_PACKAGE_RKTLET_MASTER
|
||||
bool "rktlet-master"
|
||||
default y
|
||||
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
|
||||
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
The rkt implementation of the Kubernetes
|
||||
Container Runtime Interface.
|
||||
|
||||
https://github.com/kubernetes-incubator/rktlet
|
||||
|
||||
comment "rktlet needs a toolchain w/ threads"
|
||||
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \
|
||||
BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
|||
# Locally computed
|
||||
sha256 12254af0f8d9b1f653f20e943dbbda42b74f6eafe7331db74a32857e44efdc6f fd7fc6bf4a25f03c22e5f6e30f3d9f12c468afcb.tar.gz
|
|
@ -1,59 +0,0 @@
|
|||
################################################################################
|
||||
#
|
||||
# rktlet
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# HEAD as of 2018-05-28
|
||||
RKTLET_MASTER_COMMIT = fd7fc6bf4a25f03c22e5f6e30f3d9f12c468afcb
|
||||
RKTLET_MASTER_VERSION = v0.1.0-21-gfd7fc6b
|
||||
RKTLET_MASTER_SITE = https://github.com/kubernetes-incubator/rktlet/archive
|
||||
RKTLET_MASTER_SOURCE = $(RKTLET_MASTER_COMMIT).tar.gz
|
||||
RKTLET_MASTER_LICENSE = Apache-2.0
|
||||
RKTLET_MASTER_LICENSE_FILES = LICENSE
|
||||
|
||||
RKTLET_MASTER_DEPENDENCIES = host-go
|
||||
|
||||
RKTLET_MASTER_GOPATH = "$(@D)/Godeps/_workspace"
|
||||
RKTLET_MASTER_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
|
||||
CGO_ENABLED=1 \
|
||||
GOBIN="$(@D)/bin" \
|
||||
GOPATH="$(RKTLET_MASTER_GOPATH)" \
|
||||
PATH=$(BR_PATH)
|
||||
|
||||
RKTLET_MASTER_GLDFLAGS = \
|
||||
-buildmode=pie -X github.com/kubernetes-incubator/rktlet/version.Version=$(RKTLET_MASTER_VERSION)
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),y)
|
||||
RKTLET_MASTER_GLDFLAGS += -extldflags '-static'
|
||||
endif
|
||||
|
||||
RKTLET_MASTER_GOTAGS = cgo static_build
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
|
||||
RKTLET_MASTER_GOTAGS += seccomp
|
||||
RKTLET_MASTER_DEPENDENCIES += libseccomp host-pkgconf
|
||||
endif
|
||||
|
||||
define RKTLET_MASTER_CONFIGURE_CMDS
|
||||
mkdir -p $(RKTLET_MASTER_GOPATH)/src/github.com/kubernetes-incubator
|
||||
ln -s $(@D) $(RKTLET_MASTER_GOPATH)/src/github.com/kubernetes-incubator/rktlet
|
||||
endef
|
||||
|
||||
define RKTLET_MASTER_BUILD_CMDS
|
||||
cd $(@D) && $(RKTLET_MASTER_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
|
||||
build -v -o $(@D)/bin/rktlet \
|
||||
-tags "$(RKTLET_MASTER_GOTAGS)" -ldflags "$(RKTLET_MASTER_GLDFLAGS)" github.com/kubernetes-incubator/rktlet/cmd/server
|
||||
endef
|
||||
|
||||
define RKTLET_MASTER_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D -m 0755 $(@D)/bin/rktlet $(TARGET_DIR)/usr/bin/rktlet
|
||||
endef
|
||||
|
||||
define RKTLET_MASTER_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -Dm644 \
|
||||
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/rktlet-master/rktlet.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/rktlet.service
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
|
@ -1,12 +0,0 @@
|
|||
[Unit]
|
||||
Description=rktlet: The rkt implementation of a Kubernetes Container Runtime
|
||||
Documentation=https://github.com/kubernetes-incubator/rktlet/tree/master/docs
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/rktlet
|
||||
Restart=always
|
||||
StartLimitInterval=0
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Cluster Configuration
|
||||
|
||||
* **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube with rkt as the container runtime
|
||||
* **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube without Docker as the container runtime
|
||||
|
||||
* **Environment Variables** ([env_vars.md](env_vars.md)): The different environment variables that minikube understands
|
||||
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
# Alternative runtimes
|
||||
|
||||
## Using rkt container engine
|
||||
|
||||
To use [rkt](https://github.com/coreos/rkt) as the container runtime run:
|
||||
|
||||
```shell
|
||||
$ minikube start --container-runtime=rkt
|
||||
```
|
||||
|
||||
## Using CRI-O
|
||||
|
||||
To use [CRI-O](https://github.com/kubernetes-sigs/cri-o) as the container runtime, run:
|
||||
|
|
|
@ -57,7 +57,7 @@ $ ./out/minikube start
|
|||
|
||||
## Running Tests
|
||||
|
||||
#### Unit Tests
|
||||
### Unit Tests
|
||||
|
||||
Unit tests are run on Travis before code is merged. To run as part of a development cycle:
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ This includes the configuration for an alternative bootable ISO image meant to b
|
|||
It includes:
|
||||
|
||||
- systemd as the init system
|
||||
- rkt
|
||||
- docker
|
||||
- CRI-O
|
||||
|
||||
|
@ -40,7 +39,6 @@ The bootable ISO image will be available in `out/minikube.iso`.
|
|||
|
||||
```shell
|
||||
$ ./out/minikube start \
|
||||
--container-runtime=rkt \
|
||||
--iso-url=file://$GOPATH/src/k8s.io/minikube/out/minikube.iso
|
||||
```
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ We'll cover these in detail below:
|
|||
|
||||
* When run in `none` mode, minikube has no built-in resource limit mechanism, which means you could deploy pods which would consume all of the hosts resources.
|
||||
|
||||
* minikube and the Kubernetes services it starts may interfere with other running software on the system. For instance, minikube will start and stop container runtimes via systemd, such as docker, rkt, containerd, cri-o.
|
||||
* minikube and the Kubernetes services it starts may interfere with other running software on the system. For instance, minikube will start and stop container runtimes via systemd, such as docker, containerd, cri-o.
|
||||
|
||||
### Data loss
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ echo ">> Starting ${E2E_BIN} at $(date)"
|
|||
${SUDO_PREFIX}${E2E_BIN} \
|
||||
-minikube-start-args="--vm-driver=${VM_DRIVER} ${EXTRA_START_ARGS}" \
|
||||
-minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" \
|
||||
-test.v -test.timeout=50m -binary="${MINIKUBE_BIN}" && result=$? || result=$?
|
||||
-test.v -test.timeout=75m -binary="${MINIKUBE_BIN}" && result=$? || result=$?
|
||||
echo ">> ${E2E_BIN} exited with ${result} at $(date)"
|
||||
echo ""
|
||||
|
||||
|
|
|
@ -124,7 +124,9 @@ FILES_TO_UPLOAD=(
|
|||
"minikube_${DEB_VERSION}.deb"
|
||||
"minikube-${RPM_VERSION}.rpm"
|
||||
'docker-machine-driver-kvm2'
|
||||
'docker-machine-driver-kvm2.sha256'
|
||||
'docker-machine-driver-hyperkit'
|
||||
'docker-machine-driver-hyperkit.sha256'
|
||||
)
|
||||
|
||||
for UPLOAD in "${FILES_TO_UPLOAD[@]}"
|
||||
|
|
|
@ -36,9 +36,11 @@ const domainTmpl = `
|
|||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
{{if .Hidden}}
|
||||
<kvm>
|
||||
<hidden state='on'/>
|
||||
</kvm>
|
||||
{{end}}
|
||||
</features>
|
||||
<cpu mode='host-passthrough'/>
|
||||
<os>
|
||||
|
|
|
@ -74,6 +74,9 @@ type Driver struct {
|
|||
// Whether to passthrough GPU devices from the host to the VM.
|
||||
GPU bool
|
||||
|
||||
// Whether to hide the KVM hypervisor signature from the guest
|
||||
Hidden bool
|
||||
|
||||
// XML that needs to be added to passthrough GPU devices.
|
||||
DevicesXML string
|
||||
}
|
||||
|
|
|
@ -200,11 +200,13 @@ func (m *BinDataAsset) loadData(isTemplate bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// IsTemplate returns if the asset is a template
|
||||
func (m *BinDataAsset) IsTemplate() bool {
|
||||
return m.template != nil
|
||||
}
|
||||
|
||||
func (m *BinDataAsset) Evaluate(data interface{}) (*MemoryAsset, error){
|
||||
// Evaluate evaluates the template to a new asset
|
||||
func (m *BinDataAsset) Evaluate(data interface{}) (*MemoryAsset, error) {
|
||||
if !m.IsTemplate() {
|
||||
return nil, errors.Errorf("the asset %s is not a template", m.AssetName)
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@ var PodsByLayer = []pod{
|
|||
{"etcd", "component", "etcd"},
|
||||
{"scheduler", "component", "kube-scheduler"},
|
||||
{"controller", "component", "kube-controller-manager"},
|
||||
{"addon-manager", "component", "kube-addon-manager"},
|
||||
{"dns", "k8s-app", "kube-dns"},
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ func ParseKubernetesVersion(version string) (semver.Version, error) {
|
|||
// Strip leading 'v' prefix from version for semver parsing
|
||||
v, err := semver.Make(version[1:])
|
||||
if err != nil {
|
||||
return semver.Version{}, errors.Wrap(err, "parsing kubernetes version")
|
||||
return semver.Version{}, errors.Wrap(err, "invalid version, must begin with 'v'")
|
||||
}
|
||||
|
||||
return v, nil
|
||||
|
|
|
@ -28,7 +28,7 @@ type mockMountHost struct {
|
|||
T *testing.T
|
||||
}
|
||||
|
||||
func NewMockMountHost(t *testing.T) *mockMountHost {
|
||||
func newMockMountHost(t *testing.T) *mockMountHost {
|
||||
return &mockMountHost{
|
||||
T: t,
|
||||
cmds: []string{},
|
||||
|
@ -86,7 +86,7 @@ func TestMount(t *testing.T) {
|
|||
}
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
h := NewMockMountHost(t)
|
||||
h := newMockMountHost(t)
|
||||
err := Mount(h, tc.source, tc.target, tc.cfg)
|
||||
if err != nil {
|
||||
t.Fatalf("Mount(%s, %s, %+v): %v", tc.source, tc.target, tc.cfg, err)
|
||||
|
@ -99,7 +99,7 @@ func TestMount(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestUnmount(t *testing.T) {
|
||||
h := NewMockMountHost(t)
|
||||
h := newMockMountHost(t)
|
||||
err := Unmount(h, "/mnt")
|
||||
if err != nil {
|
||||
t.Fatalf("Unmount(/mnt): %v", err)
|
||||
|
|
|
@ -52,6 +52,7 @@ type MachineConfig struct {
|
|||
NFSSharesRoot string
|
||||
UUID string // Only used by hyperkit to restore the mac address
|
||||
GPU bool // Only used by kvm2
|
||||
Hidden bool // Only used by kvm2
|
||||
NoVTXCheck bool // Only used by virtualbox
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,9 @@ var styles = map[string]style{
|
|||
"log-entry": {Prefix: " "}, // Indent
|
||||
"crushed": {Prefix: "💔 "},
|
||||
"url": {Prefix: "👉 "},
|
||||
"documentation": {Prefix: "🗎 "},
|
||||
"issues": {Prefix: "📚 "},
|
||||
"issue": {Prefix: " ▪ "}, // Indented bullet
|
||||
|
||||
// Specialized purpose styles
|
||||
"iso-download": {Prefix: "💿 ", LowPrefix: "@ "},
|
||||
|
@ -82,7 +85,6 @@ var styles = map[string]style{
|
|||
"celebrate": {Prefix: "🎉 "},
|
||||
"container-runtime": {Prefix: "🎁 "},
|
||||
"Docker": {Prefix: "🐳 "},
|
||||
"rkt": {Prefix: "🚀 "},
|
||||
"CRI-O": {Prefix: "🎁 "}, // This should be a snow-flake, but the emoji has a strange width on macOS
|
||||
"containerd": {Prefix: "📦 "},
|
||||
"permissions": {Prefix: "🔑 "},
|
||||
|
|
|
@ -126,7 +126,7 @@ const (
|
|||
// DefaultStatusFormat is the default format of a host
|
||||
DefaultStatusFormat = `host: {{.Host}}
|
||||
kubelet: {{.Kubelet}}
|
||||
apiserver: {{.ApiServer}}
|
||||
apiserver: {{.APIServer}}
|
||||
kubectl: {{.Kubeconfig}}
|
||||
`
|
||||
// DefaultAddonListFormat is the default format of addon list
|
||||
|
@ -238,14 +238,14 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
|
|||
minikubeRepository += "/"
|
||||
}
|
||||
|
||||
ge_v1_14 := semver.MustParseRange(">=1.14.0")
|
||||
v1_14plus := semver.MustParseRange(">=1.14.0")
|
||||
v1_13 := semver.MustParseRange(">=1.13.0 <1.14.0")
|
||||
v1_12 := semver.MustParseRange(">=1.12.0 <1.13.0")
|
||||
v1_11 := semver.MustParseRange(">=1.11.0 <1.12.0")
|
||||
v1_10 := semver.MustParseRange(">=1.10.0 <1.11.0")
|
||||
v1_9 := semver.MustParseRange(">=1.9.0 <1.10.0")
|
||||
v1_8 := semver.MustParseRange(">=1.8.0 <1.9.0")
|
||||
ge_v1_12 := semver.MustParseRange(">=1.12.0")
|
||||
v1_12plus := semver.MustParseRange(">=1.12.0")
|
||||
|
||||
kubernetesVersion, err := semver.Make(strings.TrimPrefix(kubernetesVersionStr, minikubeVersion.VersionPrefix))
|
||||
if err != nil {
|
||||
|
@ -253,7 +253,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
|
|||
}
|
||||
|
||||
var images []string
|
||||
if ge_v1_12(kubernetesVersion) {
|
||||
if v1_12plus(kubernetesVersion) {
|
||||
images = append(images, []string{
|
||||
imageRepository + "kube-proxy:" + kubernetesVersionStr,
|
||||
imageRepository + "kube-scheduler:" + kubernetesVersionStr,
|
||||
|
@ -270,7 +270,7 @@ func GetKubeadmCachedImages(imageRepository string, kubernetesVersionStr string)
|
|||
}
|
||||
|
||||
var podInfraContainerImage string
|
||||
if ge_v1_14(kubernetesVersion) {
|
||||
if v1_14plus(kubernetesVersion) {
|
||||
podInfraContainerImage = imageRepository + "pause:3.1"
|
||||
images = append(images, []string{
|
||||
podInfraContainerImage,
|
||||
|
|
|
@ -80,8 +80,6 @@ func New(c Config) (Manager, error) {
|
|||
switch c.Type {
|
||||
case "", "docker":
|
||||
return &Docker{Socket: c.Socket, Runner: c.Runner}, nil
|
||||
case "rkt":
|
||||
return &Rkt{Socket: c.Socket, Runner: c.Runner}, nil
|
||||
case "crio", "cri-o":
|
||||
return &CRIO{Socket: c.Socket, Runner: c.Runner}, nil
|
||||
case "containerd":
|
||||
|
@ -94,7 +92,7 @@ func New(c Config) (Manager, error) {
|
|||
// disableOthers disables all other runtimes except for me.
|
||||
func disableOthers(me Manager, cr CommandRunner) error {
|
||||
// valid values returned by manager.Name()
|
||||
runtimes := []string{"containerd", "crio", "rkt", "docker"}
|
||||
runtimes := []string{"containerd", "crio", "docker"}
|
||||
for _, name := range runtimes {
|
||||
r, err := New(Config{Type: name, Runner: cr})
|
||||
if err != nil {
|
||||
|
|
|
@ -33,7 +33,6 @@ func TestName(t *testing.T) {
|
|||
}{
|
||||
{"", "Docker"},
|
||||
{"docker", "Docker"},
|
||||
{"rkt", "rkt"},
|
||||
{"crio", "CRI-O"},
|
||||
{"cri-o", "CRI-O"},
|
||||
{"containerd", "containerd"},
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
/*
|
||||
Copyright 2019 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package cruntime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
// Rkt contains rkt runtime state
|
||||
type Rkt struct {
|
||||
Socket string
|
||||
Runner CommandRunner
|
||||
}
|
||||
|
||||
// Name is a human readable name for rkt
|
||||
func (r *Rkt) Name() string {
|
||||
return "rkt"
|
||||
}
|
||||
|
||||
// Version retrieves the current version of this runtime
|
||||
func (r *Rkt) Version() (string, error) {
|
||||
ver, err := r.Runner.CombinedOutput("rkt version")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// rkt Version: 1.24.0
|
||||
// appc Version: 0.8.10
|
||||
line := strings.Split(ver, "\n")[0]
|
||||
return strings.Replace(line, "rkt Version: ", "", 1), nil
|
||||
}
|
||||
|
||||
// SocketPath returns the path to the socket file for rkt/rktlet
|
||||
func (r *Rkt) SocketPath() string {
|
||||
if r.Socket != "" {
|
||||
return r.Socket
|
||||
}
|
||||
return "/var/run/rktlet.sock"
|
||||
}
|
||||
|
||||
// DefaultCNI returns whether to use CNI networking by default
|
||||
func (r *Rkt) DefaultCNI() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Active returns if rkt is active on the host
|
||||
func (r *Rkt) Active() bool {
|
||||
err := r.Runner.Run("systemctl is-active --quiet service rkt-api")
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// Available returns an error if it is not possible to use this runtime on a host
|
||||
func (r *Rkt) Available() error {
|
||||
return r.Runner.Run("command -v rkt")
|
||||
}
|
||||
|
||||
// Enable idempotently enables rkt on a host
|
||||
func (r *Rkt) Enable() error {
|
||||
if err := disableOthers(r, r.Runner); err != nil {
|
||||
glog.Warningf("disableOthers: %v", err)
|
||||
}
|
||||
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := enableIPForwarding(r.Runner); err != nil {
|
||||
return err
|
||||
}
|
||||
err := r.Runner.Run("sudo systemctl start rkt-api")
|
||||
if err == nil {
|
||||
err = r.Runner.Run("sudo systemctl start rkt-metadata")
|
||||
}
|
||||
if err == nil {
|
||||
// Note: this is currently not included in minikube
|
||||
err = r.Runner.Run("sudo systemctl start rktlet")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// Disable idempotently disables rkt on a host
|
||||
func (r *Rkt) Disable() error {
|
||||
err := r.Runner.Run("sudo systemctl stop rkt-api")
|
||||
if err == nil {
|
||||
err = r.Runner.Run("sudo systemctl stop rkt-metadata")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// LoadImage loads an image into this runtime
|
||||
func (r *Rkt) LoadImage(path string) error {
|
||||
glog.Infof("Loading image: %s", path)
|
||||
// Note: this command (import) does not currently exist for rkt
|
||||
return r.Runner.Run(fmt.Sprintf("sudo rkt image import %s", path))
|
||||
}
|
||||
|
||||
// KubeletOptions returns kubelet options for a rkt
|
||||
func (r *Rkt) KubeletOptions() map[string]string {
|
||||
return map[string]string{
|
||||
"container-runtime": "remote",
|
||||
"container-runtime-endpoint": fmt.Sprintf("unix://%s", r.SocketPath()),
|
||||
"image-service-endpoint": fmt.Sprintf("unix://%s", r.SocketPath()),
|
||||
"runtime-request-timeout": "15m",
|
||||
}
|
||||
}
|
||||
|
||||
// ListContainers returns a list of managed by this container runtime
|
||||
func (r *Rkt) ListContainers(filter string) ([]string, error) {
|
||||
return listCRIContainers(r.Runner, filter)
|
||||
}
|
||||
|
||||
// KillContainers removes containers based on ID
|
||||
func (r *Rkt) KillContainers(ids []string) error {
|
||||
return killCRIContainers(r.Runner, ids)
|
||||
}
|
||||
|
||||
// StopContainers stops containers based on ID
|
||||
func (r *Rkt) StopContainers(ids []string) error {
|
||||
return stopCRIContainers(r.Runner, ids)
|
||||
}
|
||||
|
||||
// ContainerLogCmd returns the command to retrieve the log for a container based on ID
|
||||
func (r *Rkt) ContainerLogCmd(id string, len int, follow bool) string {
|
||||
return criContainerLogCmd(id, len, follow)
|
||||
}
|
|
@ -50,6 +50,7 @@ type kvmDriver struct {
|
|||
Boot2DockerURL string
|
||||
DiskPath string
|
||||
GPU bool
|
||||
Hidden bool
|
||||
}
|
||||
|
||||
func createKVM2Host(config cfg.MachineConfig) interface{} {
|
||||
|
@ -68,5 +69,6 @@ func createKVM2Host(config cfg.MachineConfig) interface{} {
|
|||
DiskPath: filepath.Join(constants.GetMinipath(), "machines", cfg.GetMachineName(), fmt.Sprintf("%s.rawdisk", cfg.GetMachineName())),
|
||||
ISO: filepath.Join(constants.GetMinipath(), "machines", cfg.GetMachineName(), "boot2docker.iso"),
|
||||
GPU: config.GPU,
|
||||
Hidden: config.Hidden,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,11 +20,10 @@ package exit
|
|||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/minikube/pkg/minikube/console"
|
||||
"k8s.io/minikube/pkg/minikube/problem"
|
||||
)
|
||||
|
||||
// Exit codes based on sysexits(3)
|
||||
|
@ -40,8 +39,8 @@ const (
|
|||
Config = 78 // Config represents an unconfigured or misconfigured state
|
||||
Permissions = 77 // Permissions represents a permissions error
|
||||
|
||||
// MaxProblems controls the number of problems to show for each source
|
||||
MaxProblems = 3
|
||||
// MaxLogEntries controls the number of log entries to show for each source
|
||||
MaxLogEntries = 3
|
||||
)
|
||||
|
||||
// Usage outputs a usage error and exits with error code 64
|
||||
|
@ -60,21 +59,33 @@ func WithCode(code int, format string, a ...interface{}) {
|
|||
|
||||
// WithError outputs an error and exits.
|
||||
func WithError(msg string, err error) {
|
||||
p := problem.FromError(err)
|
||||
if p != nil {
|
||||
WithProblem(msg, p)
|
||||
}
|
||||
displayError(msg, err)
|
||||
// Here is where we would insert code to optionally upload a stack trace.
|
||||
|
||||
// We can be smarter about guessing exit codes, but EX_SOFTWARE should suffice.
|
||||
os.Exit(Software)
|
||||
}
|
||||
|
||||
// WithProblems outputs an error along with any autodetected problems, and exits.
|
||||
func WithProblems(msg string, err error, problems map[string][]string) {
|
||||
// WithProblem outputs info related to a known problem and exits.
|
||||
func WithProblem(msg string, p *problem.Problem) {
|
||||
console.Err("\n")
|
||||
console.Fatal(msg)
|
||||
p.Display()
|
||||
console.Err("\n")
|
||||
console.ErrStyle("sad", "If the advice does not help, please let us know: ")
|
||||
console.ErrStyle("url", "https://github.com/kubernetes/minikube/issues/new")
|
||||
os.Exit(Config)
|
||||
}
|
||||
|
||||
// WithLogEntries outputs an error along with any important log entries, and exits.
|
||||
func WithLogEntries(msg string, err error, entries map[string][]string) {
|
||||
displayError(msg, err)
|
||||
|
||||
for name, lines := range problems {
|
||||
for name, lines := range entries {
|
||||
console.OutStyle("failure", "Problems detected in %q:", name)
|
||||
if len(lines) > MaxProblems {
|
||||
lines = lines[:MaxProblems]
|
||||
if len(lines) > MaxLogEntries {
|
||||
lines = lines[:MaxLogEntries]
|
||||
}
|
||||
for _, l := range lines {
|
||||
console.OutStyle("log-entry", l)
|
||||
|
@ -86,17 +97,9 @@ func WithProblems(msg string, err error, problems map[string][]string) {
|
|||
func displayError(msg string, err error) {
|
||||
// use Warning because Error will display a duplicate message to stderr
|
||||
glog.Warningf(fmt.Sprintf("%s: %v", msg, err))
|
||||
console.Err("\n")
|
||||
console.Fatal(msg+": %v", err)
|
||||
console.Err("\n")
|
||||
// unfortunately Cause only supports one level of actual error wrapping
|
||||
cause := errors.Cause(err)
|
||||
text := cause.Error()
|
||||
if strings.Contains(text, "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path") ||
|
||||
strings.Contains(text, "Driver \"kvm2\" not found. Do you have the plugin binary \"docker-machine-driver-kvm2\" accessible in your PATH?") {
|
||||
console.ErrStyle("usage", "Make sure to install all necessary requirements, according to the documentation:")
|
||||
console.ErrStyle("url", "https://kubernetes.io/docs/tasks/tools/install-minikube/")
|
||||
} else {
|
||||
console.ErrStyle("sad", "Sorry that minikube crashed. If this was unexpected, we would love to hear from you:")
|
||||
console.ErrStyle("url", "https://github.com/kubernetes/minikube/issues/new")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -314,10 +314,21 @@ func CacheImage(image, dst string) error {
|
|||
}
|
||||
|
||||
glog.Infoln("OPENING: ", dstPath)
|
||||
f, err := os.Create(dstPath)
|
||||
f, err := ioutil.TempFile(filepath.Dir(dstPath), filepath.Base(dstPath)+".*.tmp")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
return tarball.Write(tag, img, nil, f)
|
||||
err = tarball.Write(tag, img, nil, f)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = f.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Rename(f.Name(), dstPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
Copyright 2019 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package problem
|
||||
|
||||
import "regexp"
|
||||
|
||||
// re is a shortcut around regexp.MustCompile
|
||||
func re(s string) *regexp.Regexp {
|
||||
return regexp.MustCompile(s)
|
||||
}
|
||||
|
||||
// vmProblems are VM related problems
|
||||
var vmProblems = map[string]match{
|
||||
"VBOX_NOT_FOUND": {
|
||||
Regexp: re(`VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path`),
|
||||
Advice: "Install VirtualBox, ensure that VBoxManage is executable and in path, or select an alternative value for --vm-driver",
|
||||
URL: "https://www.virtualbox.org/wiki/Downloads",
|
||||
Issues: []int{3784, 3776},
|
||||
},
|
||||
"VBOX_VTX_DISABLED": {
|
||||
Regexp: re(`This computer doesn't have VT-X/AMD-v enabled`),
|
||||
Advice: "In some environments, this message is incorrect. Try 'minikube start --no-vtx-check'",
|
||||
Issues: []int{3900},
|
||||
},
|
||||
"KVM2_NOT_FOUND": {
|
||||
Regexp: re(`Driver "kvm2" not found. Do you have the plugin binary .* accessible in your PATH`),
|
||||
Advice: "Please install the minikube kvm2 VM driver, or select an alternative --vm-driver",
|
||||
URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver",
|
||||
},
|
||||
"KVM2_NO_IP": {
|
||||
Regexp: re(`Error starting stopped host: Machine didn't return an IP after 120 seconds`),
|
||||
Advice: "The KVM driver is unable to ressurect this old VM. Please run `minikube delete` to delete it and try again.",
|
||||
Issues: []int{3901, 3566, 3434},
|
||||
},
|
||||
"VM_DOES_NOT_EXIST": {
|
||||
Regexp: re(`Error getting state for host: machine does not exist`),
|
||||
Advice: "Your system no longer knows about the VM previously created by minikube. Run 'minikube delete' to reset your local state.",
|
||||
Issues: []int{3864},
|
||||
},
|
||||
"VM_IP_NOT_FOUND": {
|
||||
Regexp: re(`Error getting ssh host name for driver: IP not found`),
|
||||
Advice: "The minikube VM is offline. Please run 'minikube start' to start it again.",
|
||||
Issues: []int{3849, 3648},
|
||||
},
|
||||
}
|
||||
|
||||
// proxyDoc is the URL to proxy documentation
|
||||
const proxyDoc = "https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md"
|
||||
|
||||
// netProblems are network related problems.
|
||||
var netProblems = map[string]match{
|
||||
"GCR_UNAVAILABLE": {
|
||||
Regexp: re(`gcr.io.*443: connect: invalid argument`),
|
||||
Advice: "minikube is unable to access the Google Container Registry. You may need to configure it to use a HTTP proxy.",
|
||||
URL: proxyDoc,
|
||||
Issues: []int{3860},
|
||||
},
|
||||
"DOWNLOAD_RESET_BY_PEER": {
|
||||
Regexp: re(`Error downloading .*connection reset by peer`),
|
||||
Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.",
|
||||
URL: proxyDoc,
|
||||
Issues: []int{3909},
|
||||
},
|
||||
"DOWNLOAD_IO_TIMEOUT": {
|
||||
Regexp: re(`Error downloading .*timeout`),
|
||||
Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.",
|
||||
URL: proxyDoc,
|
||||
Issues: []int{3846},
|
||||
},
|
||||
"DOWNLOAD_TLS_OVERSIZED": {
|
||||
Regexp: re(`failed to download.*tls: oversized record received with length`),
|
||||
Advice: "A firewall is interfering with minikube's ability to make outgoing HTTPS requests. You may need to configure minikube to use a proxy.",
|
||||
URL: proxyDoc,
|
||||
Issues: []int{3857, 3759},
|
||||
},
|
||||
"ISO_DOWNLOAD_FAILED": {
|
||||
Regexp: re(`iso: failed to download`),
|
||||
Advice: "A firewall is likely blocking minikube from reaching the internet. You may need to configure minikube to use a proxy.",
|
||||
URL: proxyDoc,
|
||||
Issues: []int{3922},
|
||||
},
|
||||
"PULL_TIMEOUT_EXCEEDED": {
|
||||
Regexp: re(`failed to pull image k8s.gcr.io.*Client.Timeout exceeded while awaiting headers`),
|
||||
Advice: "A firewall is blocking Docker within the minikube VM from reaching the internet. You may need to configure it to use a proxy.",
|
||||
URL: proxyDoc,
|
||||
Issues: []int{3898},
|
||||
},
|
||||
"SSH_AUTH_FAILURE": {
|
||||
Regexp: re(`ssh: handshake failed: ssh: unable to authenticate.*, no supported methods remain`),
|
||||
Advice: "Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.",
|
||||
Issues: []int{3930},
|
||||
},
|
||||
"SSH_TCP_FAILURE": {
|
||||
Regexp: re(`dial tcp .*:22: connectex: A connection attempt failed because the connected party did not properly respond`),
|
||||
Advice: "Your host is failing to route packets to the minikube VM. If you have VPN software, try turning it off or configuring it so that it does not re-route traffic to the VM IP. If not, check your VM environment routing options.",
|
||||
Issues: []int{3388},
|
||||
},
|
||||
"INVALID_PROXY_HOSTNAME": {
|
||||
Regexp: re(`dial tcp: lookup.*: no such host`),
|
||||
Advice: "Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.",
|
||||
URL: proxyDoc,
|
||||
},
|
||||
}
|
||||
|
||||
// deployProblems are Kubernetes deployment problems.
|
||||
var deployProblems = map[string]match{
|
||||
"DOCKER_UNAVAILABLE": {
|
||||
Regexp: re(`Error configuring auth on host: OS type not recognized`),
|
||||
Advice: "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.",
|
||||
Issues: []int{3952},
|
||||
},
|
||||
"INVALID_KUBERNETES_VERSION": {
|
||||
Regexp: re(`No Major.Minor.Patch elements found`),
|
||||
Advice: "Specify --kubernetes-version in v<major>.<minor.<build> form. example: 'v1.1.14'",
|
||||
},
|
||||
"KUBERNETES_VERSION_MISSING_V": {
|
||||
Regexp: re(`strconv.ParseUint: parsing "": invalid syntax`),
|
||||
Advice: "Check that your --kubernetes-version has a leading 'v'. For example: 'v1.1.14'",
|
||||
},
|
||||
}
|
||||
|
||||
// osProblems are operating-system specific issues
|
||||
var osProblems = map[string]match{
|
||||
"NON_C_DRIVE": {
|
||||
Regexp: re(`.iso: The system cannot find the path specified.`),
|
||||
Advice: "Run minikube from the C: drive.",
|
||||
Issues: []int{1574},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
Copyright 2019 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package problem helps deliver actionable feedback to a user based on an error message.
|
||||
package problem
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/console"
|
||||
)
|
||||
|
||||
const issueBase = "https://github.com/kubernetes/minikube/issue"
|
||||
|
||||
// Problem represents a known problem in minikube.
|
||||
type Problem struct {
|
||||
ID string
|
||||
Err error
|
||||
Advice string
|
||||
URL string
|
||||
Issues []int
|
||||
}
|
||||
|
||||
// match maps a regular expression to problem metadata.
|
||||
type match struct {
|
||||
Regexp *regexp.Regexp
|
||||
Advice string
|
||||
URL string
|
||||
Issues []int
|
||||
}
|
||||
|
||||
// Display problem metadata to the console
|
||||
func (p *Problem) Display() {
|
||||
console.ErrStyle("failure", "Error: [%s] %v", p.ID, p.Err)
|
||||
console.ErrStyle("tip", "Advice: %s", p.Advice)
|
||||
if p.URL != "" {
|
||||
console.ErrStyle("documentation", "Documentation: %s", p.URL)
|
||||
}
|
||||
if len(p.Issues) == 0 {
|
||||
return
|
||||
}
|
||||
console.ErrStyle("issues", "Related issues:")
|
||||
issues := p.Issues
|
||||
if len(issues) > 3 {
|
||||
issues = issues[0:3]
|
||||
}
|
||||
for _, i := range issues {
|
||||
console.ErrStyle("issue", "%s/%d", issueBase, i)
|
||||
}
|
||||
}
|
||||
|
||||
// FromError returns a known problem from an error.
|
||||
func FromError(err error) *Problem {
|
||||
maps := []map[string]match{
|
||||
osProblems,
|
||||
vmProblems,
|
||||
netProblems,
|
||||
deployProblems,
|
||||
}
|
||||
for _, m := range maps {
|
||||
for k, v := range m {
|
||||
if v.Regexp.MatchString(err.Error()) {
|
||||
return &Problem{
|
||||
Err: err,
|
||||
Advice: v.Advice,
|
||||
URL: v.URL,
|
||||
ID: k,
|
||||
Issues: v.Issues,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -84,7 +84,7 @@ func (provisioner *MockProvisioner) GetOsReleaseInfo() (*provision.OsRelease, er
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
// AttemptIPContact attemps to contact an IP and port
|
||||
// AttemptIPContact attempts to contact an IP and port
|
||||
func (provisioner *MockProvisioner) AttemptIPContact(dockerPort int) {
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ func testPersistence(t *testing.T) {
|
|||
"/var/lib/cni",
|
||||
"/var/lib/kubelet",
|
||||
"/var/lib/minikube",
|
||||
"/var/lib/rkt",
|
||||
"/var/lib/toolbox",
|
||||
"/var/lib/boot2docker",
|
||||
} {
|
||||
output, err := minikubeRunner.SSH(fmt.Sprintf("df %s | tail -n 1 | awk '{print $1}'", dir))
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
Copyright 2019 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/machine/libmachine/state"
|
||||
"github.com/pkg/errors"
|
||||
pkgutil "k8s.io/minikube/pkg/util"
|
||||
"k8s.io/minikube/test/integration/util"
|
||||
)
|
||||
|
||||
func TestVersionUpgrade(t *testing.T) {
|
||||
currentRunner := NewMinikubeRunner(t)
|
||||
currentRunner.RunCommand("delete", true)
|
||||
currentRunner.CheckStatus(state.None.String())
|
||||
|
||||
// Grab latest release binary
|
||||
url := pkgutil.GetBinaryDownloadURL("latest", runtime.GOOS)
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
t.Fatal(errors.Wrap(err, "Failed to get latest release binary"))
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
tf, err := ioutil.TempFile("", "minikube")
|
||||
if err != nil {
|
||||
t.Fatal(errors.Wrap(err, "Failed to create binary file"))
|
||||
}
|
||||
defer os.Remove(tf.Name())
|
||||
|
||||
_, err = io.Copy(tf, resp.Body)
|
||||
if err != nil {
|
||||
t.Fatal(errors.Wrap(err, "Failed to populate temp file"))
|
||||
}
|
||||
if err := tf.Close(); err != nil {
|
||||
t.Fatal(errors.Wrap(err, "Failed to close temp file"))
|
||||
}
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
if err := os.Chmod(tf.Name(), 0700); err != nil {
|
||||
t.Fatal(errors.Wrap(err, "Failed to make binary executable."))
|
||||
}
|
||||
}
|
||||
|
||||
releaseRunner := util.MinikubeRunner{
|
||||
Args: currentRunner.Args,
|
||||
BinaryPath: tf.Name(),
|
||||
StartArgs: currentRunner.StartArgs,
|
||||
MountArgs: currentRunner.MountArgs,
|
||||
T: t,
|
||||
}
|
||||
releaseRunner.Start()
|
||||
releaseRunner.CheckStatus(state.Running.String())
|
||||
releaseRunner.RunCommand("stop", true)
|
||||
releaseRunner.CheckStatus(state.Stopped.String())
|
||||
|
||||
currentRunner.Start()
|
||||
currentRunner.CheckStatus(state.Running.String())
|
||||
currentRunner.RunCommand("delete", true)
|
||||
currentRunner.CheckStatus(state.None.String())
|
||||
}
|
Loading…
Reference in New Issue