Merge branch 'w/add-spinner' of https://github.com/alonyb/minikube into w/add-spinner

pull/9855/head
alonyb 2020-12-08 16:46:10 -05:00
commit e09dcaa941
122 changed files with 1241 additions and 388 deletions

View File

@ -82,7 +82,7 @@ jobs:
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
sudo apt-get install -y jq
- name: Run Integration Test

View File

@ -60,7 +60,7 @@ jobs:
- name: Install gopogh
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
sudo apt-get install -y jq
rm -f gopogh-linux-amd64 || true

View File

@ -120,7 +120,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -205,7 +205,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Install docker
shell: bash
@ -350,7 +350,7 @@ jobs:
continue-on-error: true
shell: powershell
run: |
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
choco install -y kubernetes-cli
choco install -y jq
choco install -y caffeine
@ -487,7 +487,7 @@ jobs:
shell: powershell
run: |
$ErrorActionPreference = "SilentlyContinue"
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
choco install -y kubernetes-cli
choco install -y jq
choco install -y caffeine
@ -592,7 +592,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -689,7 +689,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -771,7 +771,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Install docker
shell: bash
@ -883,7 +883,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -967,7 +967,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -1074,7 +1074,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -1156,7 +1156,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1

View File

@ -118,7 +118,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -203,7 +203,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Install docker
shell: bash
@ -348,7 +348,7 @@ jobs:
continue-on-error: true
shell: powershell
run: |
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
choco install -y kubernetes-cli
choco install -y jq
choco install -y caffeine
@ -485,7 +485,7 @@ jobs:
shell: powershell
run: |
$ErrorActionPreference = "SilentlyContinue"
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
(New-Object Net.WebClient).DownloadFile("https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh.exe", "C:\ProgramData\chocolatey\bin\gopogh.exe")
choco install -y kubernetes-cli
choco install -y jq
choco install -y caffeine
@ -590,7 +590,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -687,7 +687,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -769,7 +769,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Install docker
shell: bash
@ -881,7 +881,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -965,7 +965,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -1072,7 +1072,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64
sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1
@ -1154,7 +1154,7 @@ jobs:
shell: bash
run: |
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64
sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
- name: Download Binaries
uses: actions/download-artifact@v1

View File

@ -32,7 +32,7 @@ RPM_VERSION ?= $(DEB_VERSION)
GO_VERSION ?= 1.15.2
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2020.02.7
BUILDROOT_BRANCH ?= 2020.02.8
REGISTRY?=gcr.io/k8s-minikube
REGISTRY_GH?=docker.pkg.github.com/kubernetes/minikube
@ -58,7 +58,7 @@ MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
KERNEL_VERSION ?= 4.19.150
KERNEL_VERSION ?= 4.19.157
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.30.0
# Limit number of default jobs, to avoid the CI builds running out of memory
@ -92,7 +92,7 @@ SHA512SUM=$(shell command -v sha512sum || echo "shasum -a 512")
GVISOR_TAG ?= latest
# storage provisioner tag to push changes to
STORAGE_PROVISIONER_TAG ?= v3
STORAGE_PROVISIONER_TAG ?= v4
STORAGE_PROVISIONER_MANIFEST ?= $(REGISTRY)/storage-provisioner:$(STORAGE_PROVISIONER_TAG)
STORAGE_PROVISIONER_IMAGE ?= $(REGISTRY)/storage-provisioner-$(GOARCH):$(STORAGE_PROVISIONER_TAG)
@ -462,6 +462,11 @@ out/minikube_$(DEB_VERSION)-0_%.deb: out/minikube-linux-%
chmod 0755 out/minikube_$(DEB_VERSION)/DEBIAN
sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control
sed -E -i 's/--ARCH--/'$*'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control
if [ "$*" = "amd64" ]; then \
sed -E -i 's/--RECOMMENDS--/virtualbox/' out/minikube_$(DEB_VERSION)/DEBIAN/control; \
else \
sed -E -i '/Recommends: --RECOMMENDS--/d' out/minikube_$(DEB_VERSION)/DEBIAN/control; \
fi
mkdir -p out/minikube_$(DEB_VERSION)/usr/bin
cp $< out/minikube_$(DEB_VERSION)/usr/bin/minikube
fakeroot dpkg-deb --build out/minikube_$(DEB_VERSION) $@
@ -767,6 +772,11 @@ out/mkcmp:
out/performance-bot:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ cmd/performance/pr-bot/bot.go
.PHONY: out/metrics-collector
out/metrics-collector:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ hack/metrics/*.go
.PHONY: compare
compare: out/mkcmp out/minikube
mv out/minikube out/$(CURRENT_GIT_BRANCH).minikube

View File

@ -92,8 +92,8 @@ var settings = []Setting{
},
{
name: "memory",
set: SetInt,
validations: []setFn{IsPositive},
set: SetString,
validations: []setFn{IsValidDiskSize},
callbacks: []setFn{RequiresRestartMsg},
},
{

View File

@ -19,6 +19,7 @@ package config
import (
"io/ioutil"
"net"
"regexp"
"github.com/spf13/cobra"
"k8s.io/minikube/pkg/minikube/config"
@ -204,6 +205,22 @@ var addonsConfigureCmd = &cobra.Command{
cfg.KubernetesConfig.LoadBalancerEndIP = AskForStaticValidatedValue("-- Enter Load Balancer End IP: ", validator)
}
if err := config.SaveProfile(profile, cfg); err != nil {
out.ErrT(style.Fatal, "Failed to save config {{.profile}}", out.V{"profile": profile})
}
case "ingress":
profile := ClusterFlagValue()
_, cfg := mustload.Partial(profile)
validator := func(s string) bool {
format := regexp.MustCompile("^.+/.+$")
return format.MatchString(s)
}
if cfg.KubernetesConfig.CustomIngressCert == "" {
cfg.KubernetesConfig.CustomIngressCert = AskForStaticValidatedValue("-- Enter custom cert(format is \"namespace/secret\"): ", validator)
}
if err := config.SaveProfile(profile, cfg); err != nil {
out.ErrT(style.Fatal, "Failed to save config {{.profile}}", out.V{"profile": profile})
}

View File

@ -38,6 +38,10 @@ func TestSetNotAllowed(t *testing.T) {
if err == nil || err.Error() != "run validations for \"driver\" with value of \"123456\": [driver \"123456\" is not supported]" {
t.Fatalf("Set did not return error for unallowed value: %+v", err)
}
err = Set("memory", "10a")
if err == nil || err.Error() != "run validations for \"memory\" with value of \"10a\": [invalid disk size: invalid size: '10a']" {
t.Fatalf("Set did not return error for unallowed value: %+v", err)
}
}
func TestSetOK(t *testing.T) {

View File

@ -260,7 +260,7 @@ func deletePossibleKicLeftOver(cname string, driverName string) {
klog.Warningf("error deleting volumes (might be okay).\nTo see the list of volumes run: 'docker volume ls'\n:%v", errs)
}
errs = oci.DeleteKICNetworks()
errs = oci.DeleteKICNetworks(bin)
if errs != nil {
klog.Warningf("error deleting leftover networks (might be okay).\nTo see the list of networks: 'docker network ls'\n:%v", errs)
}

View File

@ -27,6 +27,7 @@ import (
"k8s.io/minikube/pkg/minikube/mustload"
"k8s.io/minikube/pkg/minikube/node"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/minikube/out/register"
"k8s.io/minikube/pkg/minikube/reason"
"k8s.io/minikube/pkg/minikube/style"
)
@ -54,6 +55,7 @@ var nodeStartCmd = &cobra.Command{
os.Exit(0)
}
register.Reg.SetStep(register.InitialSetup)
r, p, m, h, err := node.Provision(cc, n, false, viper.GetBool(deleteOnFailure))
if err != nil {
exit.Error(reason.GuestNodeProvision, "provisioning host for node", err)

View File

@ -29,6 +29,7 @@ import (
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/ssh"
"github.com/spf13/cobra"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/command"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/driver"
@ -39,9 +40,27 @@ import (
"k8s.io/minikube/pkg/minikube/shell"
)
var podmanEnv1Tmpl = fmt.Sprintf("{{ .Prefix }}%s{{ .Delimiter }}{{ .VarlinkBridge }}{{ .Suffix }}{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}{{ .UsageHint }}", constants.PodmanVarlinkBridgeEnv, constants.MinikubeActivePodmanEnv)
var podmanEnv1Tmpl = fmt.Sprintf(
"{{ .Prefix }}%s{{ .Delimiter }}{{ .VarlinkBridge }}{{ .Suffix }}"+
"{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}"+
"{{ .UsageHint }}",
constants.PodmanVarlinkBridgeEnv,
constants.MinikubeActivePodmanEnv)
var podmanEnv2Tmpl = fmt.Sprintf("{{ .Prefix }}%s{{ .Delimiter }}{{ .ContainerHost }}{{ .Suffix }}{{ if .ContainerSSHKey }}{{ .Prefix }}%s{{ .Delimiter }}{{ .ContainerSSHKey}}{{ .Suffix }}{{ end }}{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}{{ .UsageHint }}", constants.PodmanContainerHostEnv, constants.PodmanContainerSSHKeyEnv, constants.MinikubeActivePodmanEnv)
var podmanEnv2Tmpl = fmt.Sprintf(
"{{ .Prefix }}%s{{ .Delimiter }}{{ .ContainerHost }}{{ .Suffix }}"+
"{{ if .ContainerSSHKey }}"+
"{{ .Prefix }}%s{{ .Delimiter }}{{ .ContainerSSHKey}}{{ .Suffix }}"+
"{{ end }}"+
"{{ if .ExistingContainerHost }}"+
"{{ .Prefix }}%s{{ .Delimiter }}{{ .ExistingContainerHost }}{{ .Suffix }}"+
"{{ end }}"+
"{{ .Prefix }}%s{{ .Delimiter }}{{ .MinikubePodmanProfile }}{{ .Suffix }}"+
"{{ .UsageHint }}",
constants.PodmanContainerHostEnv,
constants.PodmanContainerSSHKeyEnv,
constants.ExistingContainerHostEnv,
constants.MinikubeActivePodmanEnv)
// PodmanShellConfig represents the shell config for Podman
type PodmanShellConfig struct {
@ -50,6 +69,8 @@ type PodmanShellConfig struct {
ContainerHost string
ContainerSSHKey string
MinikubePodmanProfile string
ExistingContainerHost string
}
var podmanUnset bool
@ -65,6 +86,9 @@ func podmanShellCfgSet(ec PodmanEnvConfig, envMap map[string]string) *PodmanShel
s.VarlinkBridge = envMap[constants.PodmanVarlinkBridgeEnv]
s.ContainerHost = envMap[constants.PodmanContainerHostEnv]
s.ContainerSSHKey = envMap[constants.PodmanContainerSSHKeyEnv]
s.ExistingContainerHost = envMap[constants.ExistingContainerHostEnv]
s.MinikubePodmanProfile = envMap[constants.MinikubeActivePodmanEnv]
return s
@ -259,6 +283,13 @@ func podmanEnvVars(ec PodmanEnvConfig) map[string]string {
for k, v := range env0 {
env[k] = v
}
if os.Getenv(constants.MinikubeActivePodmanEnv) == "" {
e := constants.PodmanContainerHostEnv
if v := oci.InitialEnv(e); v != "" {
key := constants.ExistingContainerHostEnv
env[key] = v
}
}
return env
}

View File

@ -46,6 +46,7 @@ var (
stopAll bool
keepActive bool
scheduledStopDuration time.Duration
cancelScheduledStop bool
)
// stopCmd represents the stop command
@ -60,6 +61,8 @@ func init() {
stopCmd.Flags().BoolVar(&stopAll, "all", false, "Set flag to stop all profiles (clusters)")
stopCmd.Flags().BoolVar(&keepActive, "keep-context-active", false, "keep the kube-context active after cluster is stopped. Defaults to false.")
stopCmd.Flags().DurationVar(&scheduledStopDuration, "schedule", 0*time.Second, "Set flag to stop cluster after a set amount of time (e.g. --schedule=5m)")
stopCmd.Flags().BoolVar(&cancelScheduledStop, "cancel-scheduled", false, "cancel any existing scheduled stop requests")
if err := stopCmd.Flags().MarkHidden("schedule"); err != nil {
klog.Info("unable to mark --schedule flag as hidden")
}
@ -97,6 +100,11 @@ func runStop(cmd *cobra.Command, args []string) {
// Kill any existing scheduled stops
schedule.KillExisting(profilesToStop)
if cancelScheduledStop {
register.Reg.SetStep(register.Done)
out.Step(style.Stopped, `All existing scheduled stops cancelled`)
return
}
if scheduledStopDuration != 0 {
if err := schedule.Daemonize(profilesToStop, scheduledStopDuration); err != nil {

View File

@ -65,6 +65,9 @@ spec:
- --validating-webhook=:8443
- --validating-webhook-certificate=/usr/local/certificates/cert
- --validating-webhook-key=/usr/local/certificates/key
{{if .CustomIngressCert}}
- --default-ssl-certificate={{ .CustomIngressCert }}
{{end}}
securityContext:
capabilities:
drop:

View File

@ -1 +1 @@
docker 1000 docker 1000 =tcuser /home/docker /bin/bash wheel,vboxsf -
docker 1000 docker 1000 =tcuser /home/docker /bin/bash wheel,vboxsf,podman -

View File

@ -21,7 +21,7 @@ BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/patche
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_LATEST_VERSION=n
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.150"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.157"
BR2_LINUX_KERNEL_BZIMAGE=y
BR2_LINUX_KERNEL_LZ4=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y

View File

@ -1,7 +1,6 @@
menu "System tools"
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/varlink/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/conmon/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crio-bin/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crictl-bin/Config.in"

View File

@ -6,3 +6,4 @@ sha256 a0965e1492fca558629826f1aa89a9675de3d451cec67540400b30c0bf6ac387 v1.2.10.
sha256 318886ea1efdec36f088fd6a0a0fe2b2f0ebdfd0066bdb4bd284bad12abc0a41 v1.2.12.tar.gz
sha256 0811057ab67b78ce911416e793edaeb14b3f1e105d67b8e67b6302e0eab572e4 v1.2.13.tar.gz
sha256 d30d59e143697aa4f0960205b3f5ac59c573b332f20507740ef2dc0fb5ae8ded v1.3.7.tar.gz
sha256 9244212589c84b12262769dca6fb985c0c680cb5259c8904b29c511d81fd62d0 v1.3.9.tar.gz

View File

@ -3,8 +3,8 @@
# containerd
#
################################################################################
CONTAINERD_BIN_VERSION = v1.3.7
CONTAINERD_BIN_COMMIT = 8fba4e9a7d01810a393d5d25a3621dc101981175
CONTAINERD_BIN_VERSION = v1.3.9
CONTAINERD_BIN_COMMIT = ea765aba0d05254012b0b9e595e995c09186427f
CONTAINERD_BIN_SITE = https://github.com/containerd/containerd/archive
CONTAINERD_BIN_SOURCE = $(CONTAINERD_BIN_VERSION).tar.gz
CONTAINERD_BIN_DEPENDENCIES = host-go libgpgme

View File

@ -3,3 +3,4 @@ sha256 9bdbea7a2b382494aff2ff014da328a042c5aba9096a7772e57fdf487e5a1d51 crictl-
sha256 c3b71be1f363e16078b51334967348aab4f72f46ef64a61fe7754e029779d45a crictl-v1.15.0-linux-amd64.tar.gz
sha256 19fed421710fccfe58f5573383bb137c19438a9056355556f1a15da8d23b3ad1 crictl-v1.16.1-linux-amd64.tar.gz
sha256 7b72073797f638f099ed19550d52e9b9067672523fc51b746e65d7aa0bafa414 crictl-v1.17.0-linux-amd64.tar.gz
sha256 876dd2b3d0d1c2590371f940fb1bf1fbd5f15aebfbe456703ee465d959700f4a crictl-v1.18.0-linux-amd64.tar.gz

View File

@ -4,7 +4,7 @@
#
################################################################################
CRICTL_BIN_VERSION = v1.17.0
CRICTL_BIN_VERSION = v1.18.0
CRICTL_BIN_SITE = https://github.com/kubernetes-sigs/cri-tools/releases/download/$(CRICTL_BIN_VERSION)
CRICTL_BIN_SOURCE = crictl-$(CRICTL_BIN_VERSION)-linux-amd64.tar.gz
CRICTL_BIN_STRIP_COMPONENTS = 0

View File

@ -22,3 +22,4 @@ sha256 7c1576a0bc749418d1423d2b78c8920b5d61f849789904612862dd118742e82b docker-
sha256 0f4336378f61ed73ed55a356ac19e46699a995f2aff34323ba5874d131548b9e docker-19.03.11.tgz
sha256 88de1b87b8a2582fe827154899475a72fb707c5793cfb39d2a24813ba1f31197 docker-19.03.12.tgz
sha256 ddb13aff1fcdcceb710bf71a210169b9c1abfd7420eeaf42cf7975f8fae2fcc8 docker-19.03.13.tgz
sha256 9f1ec28e357a8f18e9561129239caf9c0807d74756e21cc63637c7fdeaafe847 docker-19.03.14.tgz

View File

@ -4,7 +4,7 @@
#
################################################################################
DOCKER_BIN_VERSION = 19.03.13
DOCKER_BIN_VERSION = 19.03.14
DOCKER_BIN_SITE = https://download.docker.com/linux/static/stable/x86_64
DOCKER_BIN_SOURCE = docker-$(DOCKER_BIN_VERSION).tgz

View File

@ -0,0 +1,4 @@
[Socket]
SocketMode=0660
SocketUser=root
SocketGroup=podman

View File

@ -0,0 +1 @@
d /run/podman 0770 root podman

View File

@ -1 +1,3 @@
sha256 a16846fe076aaf2c9ea2e854c3baba9fb838d916be7fb4b5be332e6c92d907d4 v1.9.3.tar.gz
sha256 5ebaa6e0dbd7fd1863f70d2bc71dc8a94e195c3339c17e3cac4560c9ec5747f8 v2.1.1.tar.gz
sha256 ec5473e51fa28f29af323473fc484f742dc7df23d06d8ba9f217f13382893a71 v2.2.0.tar.gz

View File

@ -1,12 +1,15 @@
PODMAN_DUMMY = DUMMY
PODMAN_VERSION = v1.9.3
PODMAN_COMMIT = 5d44534fff6877b1cb15b760242279ae6293154c
PODMAN_VERSION = v2.2.0
PODMAN_COMMIT = db1d2ff111ee9b012779ff3a5279a982520ccda4
PODMAN_SITE = https://github.com/containers/podman/archive
PODMAN_SOURCE = $(PODMAN_VERSION).tar.gz
PODMAN_LICENSE = Apache-2.0
PODMAN_LICENSE_FILES = LICENSE
PODMAN_DEPENDENCIES = host-go
ifeq ($(BR2_INIT_SYSTEMD),y)
# need libsystemd for journal
PODMAN_DEPENDENCIES += systemd
endif
PODMAN_GOPATH = $(@D)/_output
PODMAN_BIN_ENV = \
@ -17,11 +20,24 @@ PODMAN_BIN_ENV = \
PATH=$(PODMAN_GOPATH)/bin:$(BR_PATH)
define PODMAN_USERS
- -1 podman -1 - - - - -
endef
define PODMAN_MOD_VENDOR_MAKEFILE
# "build flag -mod=vendor only valid when using modules"
sed -e 's|-mod=vendor ||' -i $(@D)/Makefile
endef
PODMAN_POST_EXTRACT_HOOKS += PODMAN_MOD_VENDOR_MAKEFILE
define PODMAN_CONFIGURE_CMDS
mkdir -p $(PODMAN_GOPATH) && mv $(@D)/vendor $(PODMAN_GOPATH)/src
mkdir -p $(PODMAN_GOPATH)/src/github.com/containers
ln -sf $(@D) $(PODMAN_GOPATH)/src/github.com/containers/libpod
mkdir -p $(PODMAN_GOPATH)/src/github.com/varlink
ln -sf $(@D)/vendor/github.com/varlink/go $(PODMAN_GOPATH)/src/github.com/varlink/go
ln -sf $(@D) $(PODMAN_GOPATH)/src/github.com/containers/podman
ln -sf $(@D) $(PODMAN_GOPATH)/src/github.com/containers/podman/v2
endef
define PODMAN_BUILD_CMDS
@ -35,4 +51,21 @@ define PODMAN_INSTALL_TARGET_CMDS
$(INSTALL) -m 644 $(@D)/cni/87-podman-bridge.conflist $(TARGET_DIR)/etc/cni/net.d/87-podman-bridge.conflist
endef
define PODMAN_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 \
$(@D)/contrib/systemd/system/podman.service \
$(TARGET_DIR)/usr/lib/systemd/system/podman.service
$(INSTALL) -D -m 644 \
$(@D)/contrib/systemd/system/podman.socket \
$(TARGET_DIR)/usr/lib/systemd/system/podman.socket
# Allow running podman-remote as a user in the group "podman"
$(INSTALL) -D -m 644 \
$(PODMAN_PKGDIR)/override.conf \
$(TARGET_DIR)/usr/lib/systemd/system/podman.socket.d/override.conf
$(INSTALL) -D -m 644 \
$(PODMAN_PKGDIR)/podman.conf \
$(TARGET_DIR)/usr/lib/tmpfiles.d/podman.conf
endef
$(eval $(generic-package))

View File

@ -1,3 +0,0 @@
config BR2_PACKAGE_VARLINK
bool "varlink"
default y

View File

@ -1,4 +0,0 @@
sha256 3857f109574750403b233b5fdf73f1852d8decc33dac8f73bd49f2003b69ad22 16.tar.gz
sha256 0dcb451f32033154c56710c216e67f245923fe2b011321271f6670e5a2285ce6 17.tar.gz
sha256 7a32543643116ad105da4ddb2f8030de7dcad1cdb3feb1a214ae5e7b65a6a198 18.tar.gz
sha256 0e316138ef6abc34363b05d0caf6df2e389a93b832e8d971e3ae64b48ba96133 19.tar.gz

View File

@ -1,9 +0,0 @@
VARLINK_VERSION = 19
VARLINK_SITE = https://github.com/varlink/libvarlink/archive
VARLINK_SOURCE = $(VARLINK_VERSION).tar.gz
VARLINK_LICENSE = Apache-2.0
VARLINK_LICENSE_FILES = LICENSE
VARLINK_NEEDS_HOST_PYTHON = python3
$(eval $(meson-package))

View File

@ -19,7 +19,7 @@
# start from ubuntu 20.04, this image is reasonably small as a starting point
# for a kubernetes node image, it doesn't contain much we don't need
FROM ubuntu:focal-20200925
FROM ubuntu:focal-20201106
ARG BUILDKIT_VERSION="v0.7.2"
@ -123,19 +123,26 @@ RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/
RUN sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \
apt-key add - < Release.key && \
clean-install containers-common catatonit conmon containernetworking-plugins cri-tools podman-plugins varlink
clean-install containers-common catatonit conmon containernetworking-plugins cri-tools podman-plugins
# install cri-o based on https://github.com/cri-o/cri-o/blob/release-1.18/README.md#installing-cri-o
RUN sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:1.18.list" && \
curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18/xUbuntu_20.04/Release.key && \
RUN sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.4/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:1.18.list" && \
curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.4/xUbuntu_20.04/Release.key && \
apt-key add - < Release.key && \
clean-install cri-o cri-o-runc
# install podman
RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /etc/apt/sources.list.d/podman.list" && \
curl -L https://bintray.com/user/downloadSubjectPublicKey?username=afbjorklund -o afbjorklund-public.key.asc && \
apt-key add - < afbjorklund-public.key.asc && \
clean-install podman=1.9.3~1
RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \
apt-key add - < Release.key && \
clean-install podman && \
addgroup --system podman && \
mkdir -p /etc/systemd/system/podman.socket.d && \
printf "[Socket]\nSocketMode=0660\nSocketUser=root\nSocketGroup=podman\n" \
> /etc/systemd/system/podman.socket.d/override.conf && \
mkdir -p /etc/tmpfiles.d && \
echo "d /run/podman 0770 root podman" > /etc/tmpfiles.d/podman.conf && \
systemd-tmpfiles --create
# automount service
COPY automount/minikube-automount /usr/sbin/minikube-automount
@ -153,7 +160,7 @@ RUN ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \
# disable non-docker runtimes by default
RUN systemctl disable containerd && systemctl disable crio && rm /etc/crictl.yaml
# enable docker which is default
RUN systemctl enable docker
RUN systemctl enable docker.service && systemctl enable podman.socket
# making SSH work for docker container
# based on https://github.com/rastasheep/ubuntu-sshd/blob/master/18.04/Dockerfile
RUN mkdir /var/run/sshd
@ -168,6 +175,7 @@ EXPOSE 22
# create docker user for minikube ssh. to match VM using "docker" as username
RUN adduser --ingroup docker --disabled-password --gecos '' docker
RUN adduser docker sudo
RUN adduser docker podman
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER docker
RUN mkdir /home/docker/.ssh

View File

@ -19,6 +19,16 @@ set -o nounset
set -o pipefail
set -x
configure_proxy() {
# ensure all processes receive the proxy settings by default
# https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html
mkdir -p /etc/systemd/system.conf.d/
cat <<EOF >/etc/systemd/system.conf.d/proxy-default-environment.conf
[Manager]
DefaultEnvironment="HTTP_PROXY=${HTTP_PROXY:-}" "HTTPS_PROXY=${HTTPS_PROXY:-}" "NO_PROXY=${NO_PROXY:-}"
EOF
}
update-alternatives() {
echo "retryable update-alternatives: $*"
local args=$*
@ -48,7 +58,7 @@ fix_mount() {
# This is a workaround to an AUFS bug that might cause `Text file
# busy` on `mount` command below. See more details in
# https://github.com/moby/moby/issues/9547
if [[ "$(stat -f -c %T /bin/mount)" == 'aufs' ]]; then
if [[ "$(stat -f -c %T "$(which mount)")" == 'aufs' ]]; then
echo 'INFO: detected aufs, calling sync' >&2
sync
fi
@ -174,16 +184,6 @@ fix_kmsg() {
fi
}
configure_proxy() {
# ensure all processes receive the proxy settings by default
# https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html
mkdir -p /etc/systemd/system.conf.d/
cat <<EOF >/etc/systemd/system.conf.d/proxy-default-environment.conf
[Manager]
DefaultEnvironment="HTTP_PROXY=${HTTP_PROXY:-}" "HTTPS_PROXY=${HTTPS_PROXY:-}" "NO_PROXY=${NO_PROXY:-}"
EOF
}
select_iptables() {
# based on: https://github.com/kubernetes/kubernetes/blob/ffe93b3979486feb41a0f85191bdd189cbd56ccc/build/debian-iptables/iptables-wrapper
local mode=nft
@ -229,7 +229,7 @@ enable_network_magic(){
sed -e "s/${docker_embedded_dns_ip}/${docker_host_ip}/g" /etc/resolv.conf.original >/etc/resolv.conf
# fixup IPs in manifests ...
curr_ipv4="$( (getent ahostsv4 $(hostname) | head -n1 | cut -d' ' -f1) || true)"
curr_ipv4="$( (getent ahostsv4 "$(hostname)" | head -n1 | cut -d' ' -f1) || true)"
echo "INFO: Detected IPv4 address: ${curr_ipv4}" >&2
if [ -f /kind/old-ipv4 ]; then
old_ipv4=$(cat /kind/old-ipv4)
@ -249,7 +249,7 @@ enable_network_magic(){
fi
# do IPv6
curr_ipv6="$( (getent ahostsv6 $(hostname) | head -n1 | cut -d' ' -f1) || true)"
curr_ipv6="$( (getent ahostsv6 "$(hostname)" | head -n1 | cut -d' ' -f1) || true)"
echo "INFO: Detected IPv6 address: ${curr_ipv6}" >&2
if [ -f /kind/old-ipv6 ]; then
old_ipv6=$(cat /kind/old-ipv6)
@ -269,14 +269,15 @@ enable_network_magic(){
}
# run pre-init fixups
select_iptables
# NOTE: it's important that we do configure* first in this order to avoid races
configure_proxy
fix_kmsg
fix_mount
retryable_fix_cgroup_mounts
fix_machine_id
fix_product_name
fix_product_uuid
configure_proxy
select_iptables
enable_network_magic
# we want the command (expected to be systemd) to be PID1, so exec to it

10
go.sum
View File

@ -45,6 +45,7 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1 h1:Dll2uFfOVI3fa8UzsHyP6z0M6fEc9ZTAMo+Y3z282Xg=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw=
contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA=
@ -92,7 +93,6 @@ github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGt
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/GoogleCloudPlatform/opentelemetry-operations-go v0.13.0 h1:Gx9IxOjR9ug5Ad8YbafxJ6N2g6oDj/Q419tYHdd1od4=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.13.0 h1:fjKUtfldCPIF4nIzAAj3LzP8Lrd3DuRIMiFdOsj4fLc=
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.13.0/go.mod h1:q/paYxLXKVhwfC3lzLfhtL54fAx14wzMN9DundQOBMc=
@ -148,6 +148,7 @@ github.com/alonyb/spinner v1.12.1/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FSc
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ=
github.com/apex/log v1.3.0 h1:1fyfbPvUwD10nMoh3hY6MXzvZShJQn9/ck7ATgAt5pA=
github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs=
github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
@ -214,6 +215,7 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH
github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc=
github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
@ -557,6 +559,7 @@ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPg
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible h1:xmapqc1AyLoB+ddYT6r04bD9lIjlOqGaREovi0SzFaE=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f h1:Jnx61latede7zDD3DiiP4gmNz33uK0U5HDUaF0a/HVQ=
@ -587,6 +590,7 @@ github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.3.0 h1:CcQijm0XKekKjP/YCz28LXVSpgguuB+nCxaSjCe09y0=
github.com/googleapis/gnostic v0.3.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleinterns/cloud-operations-api-mock v0.0.0-20200709193332-a1e58c29bdd3 h1:eHv/jVY/JNop1xg2J9cBb4EzyMpWZoNCP1BslSAIkOI=
github.com/googleinterns/cloud-operations-api-mock v0.0.0-20200709193332-a1e58c29bdd3/go.mod h1:h/KNeRx7oYU4SpA4SoY7W2/NxDKEEVuwA6j9A27L4OI=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
@ -1107,6 +1111,7 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
@ -1192,7 +1197,6 @@ go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io v0.1.0 h1:EANZoRCOP+A3faIlw/iN6YEWoYb1vleZRKm1EvH8T48=
go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA=
go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY=
go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ=
@ -1505,6 +1509,7 @@ golang.org/x/tools v0.0.0-20200527183253-8e7acdbce89d h1:SR+e35rACZFBohNb4Om1ibX
golang.org/x/tools v0.0.0-20200527183253-8e7acdbce89d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200701151220-7cb253f4c4f8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY=
golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
@ -1663,6 +1668,7 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.1.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=

View File

@ -27,28 +27,30 @@ set -ex -o pipefail
readonly PROFILE_NAME="k8sconformance"
readonly MINIKUBE=${1:-./out/minikube}
shift || true
readonly START_ARGS=${@:-}
# Requires a fully running Kubernetes cluster.
"${MINIKUBE}" delete -p "${PROFILE_NAME}" || true
"${MINIKUBE}" start -p "${PROFILE_NAME}" --wait=all
"${MINIKUBE}" start -p "${PROFILE_NAME}" ${START_ARGS} --wait=all --nodes=2
kubectl --context "${PROFILE_NAME}" get pods --all-namespaces
"${MINIKUBE}" status -p "${PROFILE_NAME}"
go get -u -v github.com/vmware-tanzu/sonobuoy
curl -LO https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.19.0/sonobuoy_0.19.0_linux_amd64.tar.gz || true
tar -xzf sonobuoy_0.19.0_linux_amd64.tar.gz
sonobuoy run --wait
./sonobuoy run --mode=certified-conformance --wait --alsologtostderr
outdir="$(mktemp -d)"
sonobuoy retrieve "${outdir}"
./sonobuoy retrieve "${outdir}"
cwd=$(pwd)
cd "${outdir}"
mkdir ./results; tar xzf *.tar.gz -C ./results
version=$(${MINIKUBE} version | cut -d" " -f3)
version=$(${cwd}/${MINIKUBE} version | cut -d" " -f3)
mkdir "minikube-${version}"
mkdir -p "minikube-${version}"
cd "minikube-${version}"
cat <<EOF >PRODUCT.yaml
@ -67,6 +69,6 @@ cat <<EOF >README.md
./hack/conformance_tests.sh $MINIKUBE $START_ARGS
EOF
cp ../results/plugins/e2e/results/* .
cp -r ../results/plugins/e2e/results/global/* .
cd ..
cp -r "minikube-${version}" "${cwd}"

View File

@ -28,9 +28,18 @@ WANT_GOLANG_VERSION=$(grep '^GO_VERSION' Makefile | awk '{ print $3 }')
declare -rx GOPATH=/var/lib/jenkins/go
GIT_COMMIT_AT_HEAD=$(git rev-parse HEAD | xargs)
MINIKUBE_LATEST_COMMIT=$(gsutil stat gs://minikube/latest/minikube-linux-amd64 | grep commit | awk '{ print $2 }' | xargs)
if [ "$GIT_COMMIT_AT_HEAD" = "$MINIKUBE_LATEST_COMMIT" ]; then
echo "The current uploaded binary is already latest, skipping build"
exit 0
fi
make cross && failed=$? || failed=$?
if [[ "${failed}" -ne 0 ]]; then
echo "build failed"
exit "${failed}"
fi
gsutil cp out/minikube-* "gs://${bucket}"
gsutil setmeta -r -h "x-goog-meta-commit:$GIT_COMMIT_AT_HEAD" "gs://${bucket}"

View File

@ -347,9 +347,9 @@ fi
echo ">> Installing gopogh"
if [ "$(uname)" != "Darwin" ]; then
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-linux-amd64 && sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-linux-amd64 && sudo install gopogh-linux-amd64 /usr/local/bin/gopogh
else
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.2.4/gopogh-darwin-amd64 && sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
curl -LO https://github.com/medyagh/gopogh/releases/download/v0.3.0/gopogh-darwin-amd64 && sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh
fi
echo ">> Running gopogh"

View File

@ -48,7 +48,9 @@ env BUILD_IN_DOCKER=y \
all \
out/minikube-installer.exe \
"out/minikube_${DEB_VERSION}-0_amd64.deb" \
"out/minikube_${DEB_VERSION}-0_arm64.deb" \
"out/minikube-${RPM_VERSION}-0.x86_64.rpm" \
"out/minikube-${RPM_VERSION}-0.aarch64.rpm" \
"out/docker-machine-driver-kvm2_${DEB_VERSION}-0_amd64.deb" \
"out/docker-machine-driver-kvm2-${RPM_VERSION}-0.x86_64.rpm"
@ -56,7 +58,9 @@ make checksum
# unversioned names to avoid updating upstream Kubernetes documentation each release
cp "out/minikube_${DEB_VERSION}-0_amd64.deb" out/minikube_latest_amd64.deb
cp "out/minikube_${DEB_VERSION}-0_arm64.deb" out/minikube_latest_arm64.deb
cp "out/minikube-${RPM_VERSION}-0.x86_64.rpm" out/minikube-latest.x86_64.rpm
cp "out/minikube-${RPM_VERSION}-0.aarch64.rpm" out/minikube-latest.aarch64.rpm
gsutil -m cp out/* "gs://$BUCKET/releases/$TAGNAME/"

12
hack/metrics/README.md Normal file
View File

@ -0,0 +1,12 @@
This script runs `minikube start` in a loop and measures how long it takes.
It exports this data to Stackdriver via the OpenTelemetry API.
To run this script, run:
```
MINIKUBE_GCP_PROJECT_ID=<GCP Project ID> go run hack/metrics/*.go
```
This script is used to track minikube performance and prevent regressions.
_Note: this script will export data to both Cloud Monitoring and Cloud Trace in the provided GCP project_

171
hack/metrics/metrics.go Normal file
View File

@ -0,0 +1,171 @@
/*
Copyright 2020 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 main
import (
"context"
"flag"
"fmt"
"log"
"os"
"os/exec"
"strings"
"time"
_ "cloud.google.com/go/storage"
"contrib.go.opencensus.io/exporter/stackdriver"
"github.com/pkg/errors"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/trace"
pkgtrace "k8s.io/minikube/pkg/trace"
)
const (
customMetricName = "custom.googleapis.com/minikube/start_time"
profile = "cloud-monitoring"
)
var (
// The task latency in seconds
latencyS = stats.Float64("repl/start_time", "start time in seconds", "s")
labels string
tmpFile string
)
func main() {
if err := execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func init() {
flag.StringVar(&labels, "label", "", "Comma separated list of labels to add to metrics in key:value format")
flag.StringVar(&tmpFile, "file", "/tmp/minikube", "Download minikube to this file for testing")
flag.Parse()
}
func execute() error {
projectID := os.Getenv(pkgtrace.ProjectEnvVar)
if projectID == "" {
return fmt.Errorf("metrics collector requires a valid GCP project id set via the %s env variable", pkgtrace.ProjectEnvVar)
}
ctx := context.Background()
if err := downloadMinikube(ctx, tmpFile); err != nil {
return errors.Wrap(err, "downloading minikube")
}
// Register the view. It is imperative that this step exists,
// otherwise recorded metrics will be dropped and never exported.
v := &view.View{
Name: customMetricName,
Measure: latencyS,
Description: "minikube start time",
Aggregation: view.LastValue(),
}
if err := view.Register(v); err != nil {
return errors.Wrap(err, "registering view")
}
for _, cr := range []string{"docker", "containerd", "crio"} {
if err := exportMinikubeStart(ctx, projectID, cr); err != nil {
log.Printf("error exporting minikube start data for runtime %v: %v", cr, err)
}
}
return nil
}
func exportMinikubeStart(ctx context.Context, projectID, containerRuntime string) error {
sd, err := getExporter(projectID, containerRuntime)
if err != nil {
return errors.Wrap(err, "getting stackdriver exporter")
}
// Register it as a trace exporter
trace.RegisterExporter(sd)
if err := sd.StartMetricsExporter(); err != nil {
return errors.Wrap(err, "starting metric exporter")
}
// track minikube start time and record it to metrics collector
st, err := minikubeStartTime(ctx, projectID, tmpFile, containerRuntime)
if err != nil {
return errors.Wrap(err, "collecting start time")
}
fmt.Printf("Latency: %f\n", st)
stats.Record(ctx, latencyS.M(st))
time.Sleep(30 * time.Second)
sd.Flush()
sd.StopMetricsExporter()
trace.UnregisterExporter(sd)
return nil
}
func getExporter(projectID, containerRuntime string) (*stackdriver.Exporter, error) {
return stackdriver.NewExporter(stackdriver.Options{
ProjectID: projectID,
// MetricPrefix helps uniquely identify your metrics.
MetricPrefix: "minikube_start",
// ReportingInterval sets the frequency of reporting metrics
// to stackdriver backend.
ReportingInterval: 1 * time.Second,
DefaultMonitoringLabels: getLabels(containerRuntime),
})
}
func getLabels(containerRuntime string) *stackdriver.Labels {
l := &stackdriver.Labels{}
l.Set("container-runtime", containerRuntime, "container-runtime")
if labels == "" {
return l
}
separated := strings.Split(labels, ",")
for _, s := range separated {
sep := strings.Split(s, ":")
if len(sep) != 2 {
continue
}
log.Printf("Adding label %s=%s to metrics...", sep[0], sep[1])
l.Set(sep[0], sep[1], "")
}
return l
}
func minikubeStartTime(ctx context.Context, projectID, minikubePath, containerRuntime string) (float64, error) {
defer deleteMinikube(ctx, minikubePath)
cmd := exec.CommandContext(ctx, minikubePath, "start", "--driver=docker", "-p", profile, "--memory=2000", "--trace=gcp", fmt.Sprintf("--container-runtime=%s", containerRuntime))
cmd.Env = append(os.Environ(), fmt.Sprintf("%s=%s", pkgtrace.ProjectEnvVar, projectID))
cmd.Stdout = os.Stderr
cmd.Stderr = os.Stderr
t := time.Now()
log.Printf("Running [%v]....", cmd.Args)
if err := cmd.Run(); err != nil {
return 0, errors.Wrapf(err, "running %v", cmd.Args)
}
totalTime := time.Since(t).Seconds()
return totalTime, nil
}
func deleteMinikube(ctx context.Context, minikubePath string) {
cmd := exec.CommandContext(ctx, minikubePath, "delete", "-p", profile)
cmd.Stdout = os.Stderr
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Printf("error deleting: %v", err)
}
}

101
hack/metrics/minikube.go Normal file
View File

@ -0,0 +1,101 @@
/*
Copyright 2020 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 main
import (
"context"
"fmt"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strings"
"log"
"cloud.google.com/go/storage"
"github.com/pkg/errors"
)
const (
bucketName = "minikube"
)
// download minikube latest to file
func downloadMinikube(ctx context.Context, minikubePath string) error {
client, err := storage.NewClient(ctx)
if err != nil {
return errors.Wrap(err, "creating client")
}
obj := client.Bucket("minikube").Object(fmt.Sprintf("latest/%s", binary()))
if localMinikubeIsLatest(ctx, minikubePath, obj) {
log.Print("local minikube is latest, skipping download...")
return nil
}
os.Remove(minikubePath)
// download minikube binary from GCS
rc, err := obj.NewReader(ctx)
if err != nil {
return errors.Wrap(err, "gcs new reader")
}
defer rc.Close()
data, err := ioutil.ReadAll(rc)
if err != nil {
return errors.Wrap(err, "ioutil read all")
}
log.Printf("downloading gs://%s/%s to %v", bucketName, binary(), minikubePath)
if err := ioutil.WriteFile(minikubePath, data, 0777); err != nil {
return errors.Wrap(err, "writing minikubePath")
}
if err := os.Chmod(minikubePath, 0700); err != nil {
return errors.Wrap(err, "chmod")
}
return nil
}
// localMinikubeIsLatest returns true if the local version of minikube
// matches the latest version in GCS
func localMinikubeIsLatest(ctx context.Context, minikubePath string, obj *storage.ObjectHandle) bool {
log.Print("checking if local minikube is latest...")
attrs, err := obj.Attrs(ctx)
if err != nil {
log.Printf("error getting %s object attrs: %v", obj.ObjectName(), err)
return false
}
gcsMinikubeVersion, ok := attrs.Metadata["commit"]
if !ok {
log.Printf("there is no commit: %v", attrs.Metadata)
return false
}
currentMinikubeVersion, err := exec.Command(minikubePath, "version", "--output=json").Output()
if err != nil {
log.Printf("error running [%s version]: %v", minikubePath, err)
return false
}
return strings.Contains(string(currentMinikubeVersion), gcsMinikubeVersion)
}
func binary() string {
b := fmt.Sprintf("minikube-%s-amd64", runtime.GOOS)
if runtime.GOOS == "windows" {
b += ".exe"
}
return b
}

View File

@ -221,7 +221,7 @@ func GHReleases(ctx context.Context, owner, repo string) (stable, latest string,
return "", "", err
}
for _, rl := range rls {
ver := rl.GetName()
ver := rl.GetTagName()
if !semver.IsValid(ver) {
continue
}

View File

@ -0,0 +1,108 @@
/*
Copyright 2020 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.
*/
/*
Script expects the following env variables:
- UPDATE_TARGET=<string>: optional - if unset/absent, default option is "fs"; valid options are:
- "fs" - update only local filesystem repo files [default]
- "gh" - update only remote GitHub repo files and create PR (if one does not exist already)
- "all" - update local and remote repo files and create PR (if one does not exist already)
- GITHUB_TOKEN=<string>: GitHub [personal] access token
- note: GITHUB_TOKEN is required if UPDATE_TARGET is "gh" or "all"
*/
package main
import (
"context"
"time"
"golang.org/x/mod/semver"
"k8s.io/klog/v2"
"k8s.io/minikube/hack/update"
)
const (
// default context timeout
cxTimeout = 300 * time.Second
)
var (
schema = map[string]update.Item{
".github/workflows/iso.yml": {
Replace: map[string]string{
`(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`,
},
},
".github/workflows/kic_image.yml": {
Replace: map[string]string{
`(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`,
},
},
".github/workflows/master.yml": {
Replace: map[string]string{
`(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`,
},
},
".github/workflows/pr.yml": {
Replace: map[string]string{
`(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`,
},
},
"hack/jenkins/common.sh": {
Replace: map[string]string{
`(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`,
},
},
}
// PR data
prBranchPrefix = "update-gopogh-version_" // will be appended with first 7 characters of the PR commit SHA
prTitle = `update_gopogh_version: {stable: "{{.StableVersion}}"}`
prIssue = 9850
)
// Data holds stable gopogh version in semver format.
type Data struct {
StableVersion string `json:"stableVersion"`
}
func main() {
// set a context with defined timeout
ctx, cancel := context.WithTimeout(context.Background(), cxTimeout)
defer cancel()
// get gopogh stable version from https://github.com/medyagh/gopogh
stable, err := gopoghVersion(ctx, "medyagh", "gopogh")
if err != nil || stable == "" {
klog.Fatalf("Unable to get gopogh stable version: %v", err)
}
data := Data{StableVersion: stable}
klog.Infof("gopogh stable version: %s", data.StableVersion)
update.Apply(ctx, schema, data, prBranchPrefix, prTitle, prIssue)
}
// gopoghVersion returns gopogh stable version in semver format.
func gopoghVersion(ctx context.Context, owner, repo string) (stable string, err error) {
// get Kubernetes versions from GitHub Releases
stable, _, err = update.GHReleases(ctx, owner, repo)
if err != nil || !semver.IsValid(stable) {
return "", err
}
return stable, nil
}

View File

@ -88,8 +88,7 @@ func (i *Item) apply(data interface{}) error {
if i.Content == nil {
return fmt.Errorf("unable to update content: nothing to update")
}
org := string(i.Content)
str := org
str := string(i.Content)
for src, dst := range i.Replace {
out, err := ParseTmpl(dst, data, "")
if err != nil {

View File

@ -3,7 +3,7 @@ Version: --VERSION--
Section: base
Priority: optional
Architecture: --ARCH--
Recommends: virtualbox
Recommends: --RECOMMENDS--
Maintainer: Thomas Strömberg <t+minikube@stromberg.org>
Description: Minikube
minikube is a tool that makes it easy to run Kubernetes locally.

View File

@ -320,7 +320,7 @@ func (d *Driver) Remove() error {
return fmt.Errorf("expected no container ID be found for %q after delete. but got %q", d.MachineName, id)
}
if err := oci.RemoveNetwork(d.NodeConfig.ClusterName); err != nil {
if err := oci.RemoveNetwork(d.OCIBinary, d.NodeConfig.ClusterName); err != nil {
klog.Warningf("failed to remove network (which might be okay) %s: %v", d.NodeConfig.ClusterName, err)
}
return nil

View File

@ -25,6 +25,7 @@ import (
var initialEnvs = make(map[string]string)
func init() {
// docker
for _, env := range constants.DockerDaemonEnvs {
if v, set := os.LookupEnv(env); set {
initialEnvs[env] = v
@ -34,6 +35,15 @@ func init() {
initialEnvs[exEnv] = v
}
}
// podman
env := constants.PodmanContainerHostEnv
if v, set := os.LookupEnv(env); set {
initialEnvs[env] = v
}
exEnv := constants.ExistingContainerHostEnv
if v, set := os.LookupEnv(exEnv); set {
initialEnvs[exEnv] = v
}
}
// InitialEnv returns the value of the environment variable env before any environment changes made by minikube

View File

@ -85,14 +85,15 @@ func LogContainerDebug(ociBin string, name string) string {
} else {
klog.Infof("postmortem docker info: %+v", di)
}
logDockerNetworkInspect(name)
logDockerNetworkInspect(ociBin, name)
} else {
pi, err := podmanSystemInfo()
if err != nil {
klog.Warningf("couldn't get postmortem info, failed to to run podman info: %v", err)
klog.Warningf("couldn't get postmortem podman info: %v", err)
} else {
klog.Infof("postmortem podman info: %+v", pi)
}
logDockerNetworkInspect(ociBin, name)
}
if rr.Stdout.Len() == 0 {

View File

@ -35,7 +35,7 @@ import (
func RoutableHostIPFromInside(ociBin string, clusterName string, containerName string) (net.IP, error) {
if ociBin == Docker {
if runtime.GOOS == "linux" {
info, err := dockerNetworkInspect(clusterName)
info, err := containerNetworkInspect(ociBin, clusterName)
if err != nil {
if errors.Is(err, ErrNetworkNotFound) {
klog.Infof("The container %s is not attached to a network, this could be because the cluster was created by minikube <v1.14, will try to get the IP using container gatway", containerName)
@ -51,7 +51,7 @@ func RoutableHostIPFromInside(ociBin string, clusterName string, containerName s
}
// podman
if runtime.GOOS == "linux" {
return containerGatewayIP(Podman, containerName)
return containerGatewayIP(ociBin, containerName)
}
return nil, fmt.Errorf("RoutableHostIPFromInside is currently only implemented for linux")
@ -128,14 +128,14 @@ func ForwardedPort(ociBin string, ociID string, contPort int) (int, error) {
// ContainerIPs returns ipv4,ipv6, error of a container by their name
func ContainerIPs(ociBin string, name string) (string, string, error) {
if ociBin == Podman {
return podmanContainerIP(name)
return podmanContainerIP(ociBin, name)
}
return dockerContainerIP(name)
return dockerContainerIP(ociBin, name)
}
// podmanContainerIP returns ipv4, ipv6 of container or error
func podmanContainerIP(name string) (string, string, error) {
rr, err := runCmd(exec.Command(Podman, "container", "inspect",
func podmanContainerIP(ociBin string, name string) (string, string, error) {
rr, err := runCmd(exec.Command(ociBin, "container", "inspect",
"-f", "{{.NetworkSettings.IPAddress}}",
name))
if err != nil {
@ -143,15 +143,20 @@ func podmanContainerIP(name string) (string, string, error) {
}
output := strings.TrimSpace(rr.Stdout.String())
if err == nil && output == "" { // podman returns empty for 127.0.0.1
// check network, if the ip address is missing
ipv4, ipv6, err := dockerContainerIP(ociBin, name)
if err == nil {
return ipv4, ipv6, nil
}
return DefaultBindIPV4, "", nil
}
return output, "", nil
}
// dockerContainerIP returns ipv4, ipv6 of container or error
func dockerContainerIP(name string) (string, string, error) {
func dockerContainerIP(ociBin string, name string) (string, string, error) {
// retrieve the IP address of the node using docker inspect
lines, err := inspect(Docker, name, "{{range .NetworkSettings.Networks}}{{.IPAddress}},{{.GlobalIPv6Address}}{{end}}")
lines, err := inspect(ociBin, name, "{{range .NetworkSettings.Networks}}{{.IPAddress}},{{.GlobalIPv6Address}}{{end}}")
if err != nil {
return "", "", errors.Wrap(err, "inspecting NetworkSettings.Networks")
}

View File

@ -37,20 +37,17 @@ const firstSubnetAddr = "192.168.49.0"
// big enough for a cluster of 254 nodes
const defaultSubnetMask = 24
// name of the default Docker bridge network, used to lookup the MTU (see #9528)
const dockerDefaultBridge = "bridge"
// name of the default bridge network, used to lookup the MTU (see #9528)
const defaultBridgeName = "bridge"
// CreateNetwork creates a network returns gateway and error, minikube creates one network per cluster
func CreateNetwork(ociBin string, name string) (net.IP, error) {
if ociBin != Docker {
return nil, fmt.Errorf("%s network not implemented yet", ociBin)
}
return createDockerNetwork(name)
return createDockerNetwork(ociBin, name)
}
func createDockerNetwork(clusterName string) (net.IP, error) {
func createDockerNetwork(ociBin string, clusterName string) (net.IP, error) {
// check if the network already exists
info, err := dockerNetworkInspect(clusterName)
info, err := containerNetworkInspect(ociBin, clusterName)
if err == nil {
klog.Infof("Found existing network %+v", info)
return info.gateway, nil
@ -58,16 +55,16 @@ func createDockerNetwork(clusterName string) (net.IP, error) {
// will try to get MTU from the docker network to avoid issue with systems with exotic MTU settings.
// related issue #9528
info, err = dockerNetworkInspect(dockerDefaultBridge)
info, err = containerNetworkInspect(ociBin, defaultBridgeName)
if err != nil {
klog.Warningf("failed to get mtu information from the docker's default network %q: %v", dockerDefaultBridge, err)
klog.Warningf("failed to get mtu information from the %s's default network %q: %v", ociBin, defaultBridgeName, err)
}
attempts := 0
subnetAddr := firstSubnetAddr
// Rather than iterate through all of the valid subnets, give up at 20 to avoid a lengthy user delay for something that is unlikely to work.
// will be like 192.168.49.0/24 ,...,192.168.239.0/24
for attempts < 20 {
info.gateway, err = tryCreateDockerNetwork(subnetAddr, defaultSubnetMask, info.mtu, clusterName)
info.gateway, err = tryCreateDockerNetwork(ociBin, subnetAddr, defaultSubnetMask, info.mtu, clusterName)
if err == nil {
return info.gateway, nil
}
@ -90,7 +87,7 @@ func createDockerNetwork(clusterName string) (net.IP, error) {
return info.gateway, fmt.Errorf("failed to create network after 20 attempts")
}
func tryCreateDockerNetwork(subnetAddr string, subnetMask int, mtu int, name string) (net.IP, error) {
func tryCreateDockerNetwork(ociBin string, subnetAddr string, subnetMask int, mtu int, name string) (net.IP, error) {
gateway := net.ParseIP(subnetAddr)
gateway.To4()[3]++ // first ip for gateway
klog.Infof("attempt to create network %s/%d with subnet: %s and gateway %s and MTU of %d ...", subnetAddr, subnetMask, name, gateway, mtu)
@ -100,20 +97,25 @@ func tryCreateDockerNetwork(subnetAddr string, subnetMask int, mtu int, name str
"--driver=bridge",
fmt.Sprintf("--subnet=%s", fmt.Sprintf("%s/%d", subnetAddr, subnetMask)),
fmt.Sprintf("--gateway=%s", gateway),
}
if ociBin == Docker {
// options documentation https://docs.docker.com/engine/reference/commandline/network_create/#bridge-driver-options
"-o", "--ip-masq",
"-o", "--icc",
fmt.Sprintf("--label=%s=%s", CreatedByLabelKey, "true"),
name,
}
// adding MTU option because #9528
if mtu > 0 {
args = append(args, "-o")
args = append(args, fmt.Sprintf("com.docker.network.driver.mtu=%d", mtu))
}
args = append(args, "--ip-masq")
args = append(args, "-o")
args = append(args, "--icc")
rr, err := runCmd(exec.Command(Docker, args...))
// adding MTU option because #9528
if mtu > 0 {
args = append(args, "-o")
args = append(args, fmt.Sprintf("com.docker.network.driver.mtu=%d", mtu))
}
args = append(args, fmt.Sprintf("--label=%s=%s", CreatedByLabelKey, "true"))
}
args = append(args, name)
rr, err := runCmd(exec.Command(ociBin, args...))
if err != nil {
// Pool overlaps with other one on this address space
if strings.Contains(rr.Output(), "Pool overlaps") {
@ -135,6 +137,16 @@ type netInfo struct {
mtu int
}
func containerNetworkInspect(ociBin string, name string) (netInfo, error) {
if ociBin == Docker {
return dockerNetworkInspect(name)
}
if ociBin == Podman {
return podmanNetworkInspect(name)
}
return netInfo{}, fmt.Errorf("%s unknown", ociBin)
}
// networkInspect is only used to unmarshal the docker network inspect output and translate it to netInfo
type networkInspect struct {
Name string
@ -153,7 +165,7 @@ func dockerNetworkInspect(name string) (netInfo, error) {
cmd := exec.Command(Docker, "network", "inspect", name, "--format", `{"Name": "{{.Name}}","Driver": "{{.Driver}}","Subnet": "{{range .IPAM.Config}}{{.Subnet}}{{end}}","Gateway": "{{range .IPAM.Config}}{{.Gateway}}{{end}}","MTU": {{(index .Options "com.docker.network.driver.mtu")}},{{$first := true}} "ContainerIPs": [{{range $k,$v := .Containers }}{{if $first}}{{$first = false}}{{else}}, {{end}}"{{$v.IPv4Address}}"{{end}}]}`)
rr, err := runCmd(cmd)
if err != nil {
logDockerNetworkInspect(name)
logDockerNetworkInspect(Docker, name)
if strings.Contains(rr.Output(), "No such network") {
return info, ErrNetworkNotFound
@ -177,8 +189,39 @@ func dockerNetworkInspect(name string) (netInfo, error) {
return info, nil
}
func logDockerNetworkInspect(name string) {
cmd := exec.Command(Docker, "network", "inspect", name)
func podmanNetworkInspect(name string) (netInfo, error) {
var info = netInfo{name: name}
cmd := exec.Command(Podman, "network", "inspect", name, "--format", `{{(index .IPAM.Config 0).Subnet}},{{(index .IPAM.Config 0).Gateway}}`)
rr, err := runCmd(cmd)
if err != nil {
logDockerNetworkInspect(Podman, name)
if strings.Contains(rr.Output(), "No such network") {
return info, ErrNetworkNotFound
}
return info, err
}
// results looks like 172.17.0.0/16,172.17.0.1,1500
vals := strings.Split(strings.TrimSpace(rr.Stdout.String()), ",")
if len(vals) == 0 {
return info, fmt.Errorf("empty list network inspect: %q", rr.Output())
}
if len(vals) > 0 {
info.gateway = net.ParseIP(vals[1])
}
_, info.subnet, err = net.ParseCIDR(vals[0])
if err != nil {
return info, errors.Wrapf(err, "parse subnet for %s", name)
}
return info, nil
}
func logDockerNetworkInspect(ociBin string, name string) {
cmd := exec.Command(ociBin, "network", "inspect", name)
klog.Infof("running %v to gather additional debugging logs...", cmd.Args)
rr, err := runCmd(cmd)
if err != nil {
@ -188,11 +231,11 @@ func logDockerNetworkInspect(name string) {
}
// RemoveNetwork removes a network
func RemoveNetwork(name string) error {
if !networkExists(name) {
func RemoveNetwork(ociBin string, name string) error {
if !networkExists(ociBin, name) {
return nil
}
rr, err := runCmd(exec.Command(Docker, "network", "remove", name))
rr, err := runCmd(exec.Command(ociBin, "network", "rm", name))
if err != nil {
if strings.Contains(rr.Output(), "No such network") {
return ErrNetworkNotFound
@ -206,8 +249,8 @@ func RemoveNetwork(name string) error {
return err
}
func networkExists(name string) bool {
_, err := dockerNetworkInspect(name)
func networkExists(ociBin string, name string) bool {
_, err := containerNetworkInspect(ociBin, name)
if err != nil && !errors.Is(err, ErrNetworkNotFound) { // log unexpected error
klog.Warningf("Error inspecting docker network %s: %v", name, err)
}
@ -216,12 +259,8 @@ func networkExists(name string) bool {
// networkNamesByLabel returns all network names created by a label
func networkNamesByLabel(ociBin string, label string) ([]string, error) {
if ociBin != Docker {
return nil, fmt.Errorf("%s not supported", ociBin)
}
// docker network ls --filter='label=created_by.minikube.sigs.k8s.io=true' --format '{{.Name}}'
rr, err := runCmd(exec.Command(Docker, "network", "ls", fmt.Sprintf("--filter=label=%s", label), "--format", "{{.Name}}"))
rr, err := runCmd(exec.Command(ociBin, "network", "ls", fmt.Sprintf("--filter=label=%s", label), "--format", "{{.Name}}"))
if err != nil {
return nil, err
}
@ -235,14 +274,14 @@ func networkNamesByLabel(ociBin string, label string) ([]string, error) {
}
// DeleteKICNetworks deletes all networks created by kic
func DeleteKICNetworks() []error {
func DeleteKICNetworks(ociBin string) []error {
var errs []error
ns, err := networkNamesByLabel(Docker, CreatedByLabelKey+"=true")
ns, err := networkNamesByLabel(ociBin, CreatedByLabelKey)
if err != nil {
return []error{errors.Wrap(err, "list all volume")}
}
for _, n := range ns {
err := RemoveNetwork(n)
err := RemoveNetwork(ociBin, n)
if err != nil {
errs = append(errs, err)
}

View File

@ -146,6 +146,12 @@ func CreateContainerNode(p CreateParams) error {
// label th enode wuth the node ID
"--label", p.NodeLabel,
}
// to provide a static IP
if p.Network != "" && p.IP != "" {
runArgs = append(runArgs, "--network", p.Network)
runArgs = append(runArgs, "--ip", p.IP)
}
memcgSwap := true
if runtime.GOOS == "linux" {
if _, err := os.Stat("/sys/fs/cgroup/memory/memsw.limit_in_bytes"); os.IsNotExist(err) {
@ -170,11 +176,6 @@ func CreateContainerNode(p CreateParams) error {
virtualization = "podman" // VIRTUALIZATION_PODMAN
}
if p.OCIBinary == Docker {
// to provide a static IP for docker
if p.Network != "" && p.IP != "" {
runArgs = append(runArgs, "--network", p.Network)
runArgs = append(runArgs, "--ip", p.IP)
}
runArgs = append(runArgs, "--volume", fmt.Sprintf("%s:/var", p.Name))
// ignore apparmore github actions docker: https://github.com/kubernetes/minikube/issues/7624
runArgs = append(runArgs, "--security-opt", "apparmor=unconfined")

View File

@ -17,19 +17,16 @@ limitations under the License.
package generate
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/out"
)
@ -65,49 +62,71 @@ func DocForCommand(command *cobra.Command) (string, error) {
if err := writeSubcommands(command, buf); err != nil {
return "", errors.Wrap(err, "writing subcommands")
}
return removeHelpText(buf), nil
return buf.String(), nil
}
// after every command, cobra automatically appends
// ### SEE ALSO
// GenMarkdown creates markdown output.
func GenMarkdown(cmd *cobra.Command, w io.Writer) error {
return GenMarkdownCustom(cmd, w, func(s string) string { return s })
}
// * [minikube addons](minikube_addons.md) - Modify minikube's Kubernetes addons
// GenMarkdownCustom creates custom markdown output.
func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error {
cmd.InitDefaultHelpCmd()
cmd.InitDefaultHelpFlag()
// ###### Auto generated by spf13/cobra on 1-Apr-2020
// help text which is unnecessary info after every subcommand
// This function removes that text.
func removeHelpText(buffer *bytes.Buffer) string {
beginningHelpText := "### SEE ALSO"
endHelpText := "###### Auto generated by spf13/cobra"
scanner := bufio.NewScanner(buffer)
includeLine := true
buf := new(bytes.Buffer)
name := cmd.CommandPath()
final := bytes.NewBuffer([]byte{})
for scanner.Scan() {
line := scanner.Text()
if strings.Contains(line, beginningHelpText) {
includeLine = false
continue
}
if strings.Contains(line, endHelpText) {
includeLine = true
continue
}
if !includeLine {
continue
}
// scanner strips the ending newline
if _, err := final.WriteString(line + "\n"); err != nil {
klog.Warningf("error removing help text: %v", err)
break
}
short := cmd.Short
long := cmd.Long
if len(long) == 0 {
long = short
}
return final.String()
buf.WriteString("## " + name + "\n\n")
buf.WriteString(short + "\n\n")
buf.WriteString("### Synopsis\n\n")
buf.WriteString(long + "\n\n")
if cmd.Runnable() {
buf.WriteString(fmt.Sprintf("```shell\n%s\n```\n\n", cmd.UseLine()))
}
if len(cmd.Example) > 0 {
buf.WriteString("### Examples\n\n")
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
}
if err := printOptions(buf, cmd); err != nil {
return err
}
_, err := buf.WriteTo(w)
return err
}
func printOptions(buf *bytes.Buffer, cmd *cobra.Command) error {
flags := cmd.NonInheritedFlags()
flags.SetOutput(buf)
if flags.HasAvailableFlags() {
buf.WriteString("### Options\n\n```\n")
flags.PrintDefaults()
buf.WriteString("```\n\n")
}
parentFlags := cmd.InheritedFlags()
parentFlags.SetOutput(buf)
if parentFlags.HasAvailableFlags() {
buf.WriteString("### Options inherited from parent commands\n\n```\n")
parentFlags.PrintDefaults()
buf.WriteString("```\n\n")
}
return nil
}
// writeSubcommands recursively appends all subcommands to the doc
func writeSubcommands(command *cobra.Command, w io.Writer) error {
if err := doc.GenMarkdown(command, w); err != nil {
if err := GenMarkdown(command, w); err != nil {
return errors.Wrapf(err, "getting markdown custom")
}
if !command.HasSubCommands() {

View File

@ -489,6 +489,7 @@ func GenerateTemplateData(cfg config.KubernetesConfig) interface{} {
ImageRepository string
LoadBalancerStartIP string
LoadBalancerEndIP string
CustomIngressCert string
StorageProvisionerVersion string
}{
Arch: a,
@ -496,6 +497,7 @@ func GenerateTemplateData(cfg config.KubernetesConfig) interface{} {
ImageRepository: cfg.ImageRepository,
LoadBalancerStartIP: cfg.LoadBalancerStartIP,
LoadBalancerEndIP: cfg.LoadBalancerEndIP,
CustomIngressCert: cfg.CustomIngressCert,
StorageProvisionerVersion: version.GetStorageProvisionerVersion(),
}

View File

@ -24,7 +24,7 @@ import (
func TestAuxiliary(t *testing.T) {
want := []string{
"gcr.io/k8s-minikube/storage-provisioner:v3",
"gcr.io/k8s-minikube/storage-provisioner:v4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}
@ -36,7 +36,7 @@ func TestAuxiliary(t *testing.T) {
func TestAuxiliaryMirror(t *testing.T) {
want := []string{
"test.mirror/storage-provisioner:v3",
"test.mirror/storage-provisioner:v4",
"test.mirror/dashboard:v2.0.3",
"test.mirror/metrics-scraper:v1.0.4",
}

View File

@ -37,7 +37,7 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/coredns:1.6.5",
"k8s.gcr.io/etcd:3.4.3-0",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"gcr.io/k8s-minikube/storage-provisioner:v4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
@ -49,7 +49,7 @@ func TestKubeadmImages(t *testing.T) {
"mirror.k8s.io/coredns:1.6.2",
"mirror.k8s.io/etcd:3.3.15-0",
"mirror.k8s.io/pause:3.1",
"mirror.k8s.io/storage-provisioner:v3",
"mirror.k8s.io/storage-provisioner:v4",
"mirror.k8s.io/dashboard:v2.0.3",
"mirror.k8s.io/metrics-scraper:v1.0.4",
}},
@ -61,7 +61,7 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/coredns:1.3.1",
"k8s.gcr.io/etcd:3.3.10",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"gcr.io/k8s-minikube/storage-provisioner:v4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
@ -73,7 +73,7 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/coredns:1.3.1",
"k8s.gcr.io/etcd:3.3.10",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"gcr.io/k8s-minikube/storage-provisioner:v4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
@ -85,7 +85,7 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/coredns:1.2.6",
"k8s.gcr.io/etcd:3.2.24",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"gcr.io/k8s-minikube/storage-provisioner:v4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},
@ -97,7 +97,7 @@ func TestKubeadmImages(t *testing.T) {
"k8s.gcr.io/coredns:1.2.2",
"k8s.gcr.io/etcd:3.2.24",
"k8s.gcr.io/pause:3.1",
"gcr.io/k8s-minikube/storage-provisioner:v3",
"gcr.io/k8s-minikube/storage-provisioner:v4",
"docker.io/kubernetesui/dashboard:v2.0.3",
"docker.io/kubernetesui/metrics-scraper:v1.0.4",
}},

View File

@ -92,6 +92,7 @@ type KubernetesConfig struct {
ImageRepository string
LoadBalancerStartIP string // currently only used by MetalLB addon
LoadBalancerEndIP string // currently only used by MetalLB addon
CustomIngressCert string // used by Ingress addon
ExtraOptions ExtraOptionSlice
ShouldLoadCachedImages bool

View File

@ -93,6 +93,9 @@ const (
ExistingDockerCertPathEnv = MinikubeExistingPrefix + "DOCKER_CERT_PATH"
// ExistingDockerTLSVerifyEnv is used to save original docker environment
ExistingDockerTLSVerifyEnv = MinikubeExistingPrefix + "DOCKER_TLS_VERIFY"
// ExistingContainerHostEnv is used to save original podman environment
ExistingContainerHostEnv = MinikubeExistingPrefix + "CONTAINER_HOST"
)
var (

View File

@ -27,7 +27,7 @@ func TestAddRepoTagToImageName(t *testing.T) {
}{
{"kubernetesui/dashboard:v2.0.3", "docker.io/kubernetesui/dashboard:v2.0.3"},
{"kubernetesui/metrics-scraper:v1.0.4", "docker.io/kubernetesui/metrics-scraper:v1.0.4"},
{"gcr.io/k8s-minikube/storage-provisioner:v3", "gcr.io/k8s-minikube/storage-provisioner:v3"},
{"gcr.io/k8s-minikube/storage-provisioner:v4", "gcr.io/k8s-minikube/storage-provisioner:v4"},
}
for _, tc := range tests {
t.Run(tc.imgName, func(t *testing.T) {

View File

@ -41,7 +41,7 @@ const (
// PreloadVersion is the current version of the preloaded tarball
//
// NOTE: You may need to bump this version up when upgrading auxiliary docker images
PreloadVersion = "v6"
PreloadVersion = "v7"
// PreloadBucket is the name of the GCS bucket where preloaded volume tarballs exist
PreloadBucket = "minikube-preloaded-volume-tarballs"
)

View File

@ -124,6 +124,7 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down
baseImg := cc.KicBaseImage
if baseImg == kic.BaseImage && len(cc.KubernetesConfig.ImageRepository) != 0 {
baseImg = strings.Replace(baseImg, "gcr.io/k8s-minikube", cc.KubernetesConfig.ImageRepository, 1)
cc.KicBaseImage = baseImg
}
var finalImg string
// If we end up using a fallback image, notify the user

View File

@ -24,6 +24,7 @@ import (
"k8s.io/minikube/pkg/trace"
)
// If you add a new step here, please also add it to register.Reg registry inside the init() function
const (
InitialSetup RegStep = "Initial Minikube Setup"
SelectingDriver RegStep = "Selecting Driver"
@ -70,6 +71,7 @@ func init() {
SelectingDriver,
DownloadingArtifacts,
StartingNode,
PullingBaseImage,
RunningLocalhost,
LocalOSRelease,
CreatingContainer,

View File

@ -31,7 +31,8 @@ import (
)
const (
projectEnvVar = "MINIKUBE_GCP_PROJECT_ID"
// ProjectEnvVar is the name of the env variable that the user must pass in their GCP project ID through
ProjectEnvVar = "MINIKUBE_GCP_PROJECT_ID"
// this is the name of the parent span to help identify it
// in the Cloud Trace UI.
parentSpanName = "minikube start"
@ -72,9 +73,9 @@ func (t *gcpTracer) Cleanup() {
}
func initGCPTracer() (*gcpTracer, error) {
projectID := os.Getenv(projectEnvVar)
projectID := os.Getenv(ProjectEnvVar)
if projectID == "" {
return nil, fmt.Errorf("GCP tracer requires a valid GCP project id set via the %s env variable", projectEnvVar)
return nil, fmt.Errorf("GCP tracer requires a valid GCP project id set via the %s env variable", ProjectEnvVar)
}
_, flush, err := texporter.InstallNewPipeline(

View File

@ -180,7 +180,7 @@ section.td-box--height-auto {
// Allow code tags to span most of a window length (default is 80%)
pre {
max-width: 99% !important;
font-family: 'Inconsolata', monospace !important;
font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'liberation mono', 'courier new', monospace !important;
font-size: 13px !important;
}
@ -197,6 +197,17 @@ div.td-content {
padding: 0.5em !important;
margin-top: 1.25em;
margin-bottom: 1.25em;
background-color: $gray-100;
max-width: 99% !important;
pre {
background-color: inherit !important;
padding: 0 !important;
code {
font-family: inherit !important;
}
}
}
}
@ -214,3 +225,6 @@ div.td-content {
max-width: 460px;
}
div.code-toolbar > .toolbar {
top: -.3em !important;
}

View File

@ -92,6 +92,9 @@ github_subdir = "site"
# enabling local search https://www.docsy.dev/docs/adding-content/navigation/#configure-local-search-with-lunr
offlineSearch = true
# Enable syntax highlighting and copy buttons on code blocks with Prism
prism_syntax_highlighting = true
# User interface configuration
[params.ui]
# Enable to show the side bar menu in its compact state.

View File

@ -13,7 +13,7 @@ Enable or disable a minikube addon
addons modifies minikube addons files using subcommands like "minikube addons enable dashboard"
```
```shell
minikube addons SUBCOMMAND [flags]
```
@ -46,7 +46,7 @@ Configures the addon w/ADDON_NAME within minikube (example: minikube addons conf
Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list
```
```shell
minikube addons configure ADDON_NAME [flags]
```
@ -79,7 +79,7 @@ Disables the addon w/ADDON_NAME within minikube (example: minikube addons disabl
Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list
```
```shell
minikube addons disable ADDON_NAME [flags]
```
@ -112,7 +112,7 @@ Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable
Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list
```
```shell
minikube addons enable ADDON_NAME [flags]
```
@ -146,7 +146,7 @@ Help about any command
Help provides help for any command in the application.
Simply type addons help [path to command] for full details.
```
```shell
minikube addons help [command] [flags]
```
@ -179,7 +179,7 @@ Lists all available minikube addons as well as their current statuses (enabled/d
Lists all available minikube addons as well as their current statuses (enabled/disabled)
```
```shell
minikube addons list [flags]
```
@ -218,7 +218,7 @@ Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dash
Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list
```
```shell
minikube addons open ADDON_NAME [flags]
```

View File

@ -42,7 +42,7 @@ Add an image to local cache.
Add an image to local cache.
```
```shell
minikube cache add [flags]
```
@ -75,7 +75,7 @@ Delete an image from the local cache.
Delete an image from the local cache.
```
```shell
minikube cache delete [flags]
```
@ -109,7 +109,7 @@ Help about any command
Help provides help for any command in the application.
Simply type cache help [path to command] for full details.
```
```shell
minikube cache help [command] [flags]
```
@ -142,7 +142,7 @@ List all available images from the local cache.
List all available images from the local cache.
```
```shell
minikube cache list [flags]
```
@ -182,7 +182,7 @@ reload cached images.
reloads images previously added using the 'cache add' subcommand
```
```shell
minikube cache reload [flags]
```

View File

@ -34,7 +34,7 @@ Outputs minikube shell completion for the given shell (bash, zsh or fish)
Note for fish users: [2] please refer to this docs for more details https://fishshell.com/docs/current/#tab-completion
```
```shell
minikube completion SHELL [flags]
```

View File

@ -43,7 +43,7 @@ Configurable fields:
* embed-certs
* native-ssh
```
```shell
minikube config SUBCOMMAND [flags]
```
@ -79,7 +79,7 @@ Acceptable fields:
* driver
```
```shell
minikube config defaults PROPERTY_NAME [flags]
```
@ -118,7 +118,7 @@ Gets the value of PROPERTY_NAME from the minikube config file
Returns the value of PROPERTY_NAME from the minikube config file. Can be overwritten at runtime by flags or environmental variables.
```
```shell
minikube config get PROPERTY_NAME [flags]
```
@ -152,7 +152,7 @@ Help about any command
Help provides help for any command in the application.
Simply type config help [path to command] for full details.
```
```shell
minikube config help [command] [flags]
```
@ -186,7 +186,7 @@ Sets an individual value in a minikube config file
Sets the PROPERTY_NAME config value to PROPERTY_VALUE
These values can be overwritten by flags or environment variables at runtime.
```
```shell
minikube config set PROPERTY_NAME PROPERTY_VALUE [flags]
```
@ -219,7 +219,7 @@ unsets an individual value in a minikube config file
unsets PROPERTY_NAME from the minikube config file. Can be overwritten by flags or environmental variables
```
```shell
minikube config unset PROPERTY_NAME [flags]
```
@ -252,7 +252,7 @@ Display values currently set in the minikube config file
Display values currently set in the minikube config file.
```
```shell
minikube config view [flags]
```

View File

@ -13,7 +13,7 @@ Access the Kubernetes dashboard running within the minikube cluster
Access the Kubernetes dashboard running within the minikube cluster
```
```shell
minikube dashboard [flags]
```

View File

@ -14,7 +14,7 @@ Deletes a local Kubernetes cluster
Deletes a local Kubernetes cluster. This command deletes the VM, and removes all
associated files.
```
```shell
minikube delete [flags]
```

View File

@ -13,7 +13,7 @@ Configure environment to use minikube's Docker daemon
Sets up docker env variables; similar to '$(docker-machine env)'.
```
```shell
minikube docker-env [flags]
```

View File

@ -14,7 +14,7 @@ Help about any command
Help provides help for any command in the application.
Simply type minikube help [path to command] for full details.
```
```shell
minikube help [command] [flags]
```

View File

@ -13,7 +13,7 @@ Retrieves the IP address of the running cluster
Retrieves the IP address of the running cluster, and writes it to STDOUT.
```
```shell
minikube ip [flags]
```

View File

@ -17,7 +17,7 @@ Examples:
minikube kubectl -- --help
minikube kubectl -- get pods --namespace kube-system
```
```shell
minikube kubectl [flags]
```

View File

@ -13,7 +13,7 @@ Returns logs to debug a local Kubernetes cluster
Gets the logs of the running instance, used for debugging minikube, not user code.
```
```shell
minikube logs [flags]
```

View File

@ -13,7 +13,7 @@ Mounts the specified directory into minikube
Mounts the specified directory into minikube.
```
```shell
minikube mount [flags] <source directory>:<target directory>
```

View File

@ -13,7 +13,7 @@ Add, remove, or list additional nodes
Operations on nodes
```
```shell
minikube node [flags]
```
@ -46,7 +46,7 @@ Adds a node to the given cluster.
Adds a node to the given cluster config, and starts it.
```
```shell
minikube node add [flags]
```
@ -87,7 +87,7 @@ Deletes a node from a cluster.
Deletes a node from a cluster.
```
```shell
minikube node delete [flags]
```
@ -121,7 +121,7 @@ Help about any command
Help provides help for any command in the application.
Simply type node help [path to command] for full details.
```
```shell
minikube node help [command] [flags]
```
@ -154,7 +154,7 @@ List nodes.
List existing minikube nodes.
```
```shell
minikube node list [flags]
```
@ -187,7 +187,7 @@ Starts a node.
Starts an existing stopped node in a cluster.
```
```shell
minikube node start [flags]
```
@ -226,7 +226,7 @@ Stops a node in a cluster.
Stops a node in a cluster.
```
```shell
minikube node stop [flags]
```

View File

@ -13,7 +13,7 @@ pause Kubernetes
pause Kubernetes
```
```shell
minikube pause [flags]
```

View File

@ -13,7 +13,7 @@ Configure environment to use minikube's Podman service
Sets up podman env variables; similar to '$(podman-machine env)'.
```
```shell
minikube podman-env [flags]
```

View File

@ -13,7 +13,7 @@ Get or list the current profiles (clusters)
profile sets the current minikube profile, or gets the current profile if no arguments are provided. This is used to run and manage multiple minikube instance. You can return to the default minikube profile by running `minikube profile default`
```
```shell
minikube profile [MINIKUBE_PROFILE_NAME]. You can return to the default minikube profile by running `minikube profile default` [flags]
```
@ -47,7 +47,7 @@ Help about any command
Help provides help for any command in the application.
Simply type profile help [path to command] for full details.
```
```shell
minikube profile help [command] [flags]
```
@ -80,7 +80,7 @@ Lists all minikube profiles.
Lists all valid minikube profiles and detects all possible invalid profiles.
```
```shell
minikube profile list [flags]
```

View File

@ -13,7 +13,7 @@ Returns a URL to connect to a service
Returns the Kubernetes URL for a service in your local cluster. In the case of multiple URLs they will be printed one at a time.
```
```shell
minikube service [flags] SERVICE
```
@ -58,7 +58,7 @@ Help about any command
Help provides help for any command in the application.
Simply type service help [path to command] for full details.
```
```shell
minikube service help [command] [flags]
```
@ -92,7 +92,7 @@ Lists the URLs for the services in your local cluster
Lists the URLs for the services in your local cluster
```
```shell
minikube service list [flags]
```

View File

@ -13,7 +13,7 @@ Retrieve the ssh identity key path of the specified cluster
Retrieve the ssh identity key path of the specified cluster.
```
```shell
minikube ssh-key [flags]
```

View File

@ -13,7 +13,7 @@ Log into the minikube environment (for debugging)
Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'.
```
```shell
minikube ssh [flags]
```

View File

@ -13,7 +13,7 @@ Starts a local Kubernetes cluster
Starts a local Kubernetes cluster
```
```shell
minikube start [flags]
```

View File

@ -15,7 +15,7 @@ Gets the status of a local Kubernetes cluster.
Exit status contains the status of minikube's VM, cluster and Kubernetes encoded on it's bits in this order from right to left.
Eg: 7 meaning: 1 (for minikube NOK) + 2 (for cluster NOK) + 4 (for Kubernetes NOK)
```
```shell
minikube status [flags]
```

View File

@ -13,7 +13,7 @@ Stops a running local Kubernetes cluster
Stops a local Kubernetes cluster. This command stops the underlying VM or container, but keeps user data intact. The cluster can be started again with the "start" command.
```
```shell
minikube stop [flags]
```
@ -21,6 +21,7 @@ minikube stop [flags]
```
--all Set flag to stop all profiles (clusters)
--cancel-scheduled cancel any existing scheduled stop requests
--keep-context-active keep the kube-context active after cluster is stopped. Defaults to false.
-o, --output string Format to print stdout in. Options include: [text,json] (default "text")
```

View File

@ -13,7 +13,7 @@ Connect to LoadBalancer services
tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP. for a detailed example see https://minikube.sigs.k8s.io/docs/tasks/loadbalancer
```
```shell
minikube tunnel [flags]
```

View File

@ -13,7 +13,7 @@ unpause Kubernetes
unpause Kubernetes
```
```shell
minikube unpause [flags]
```

View File

@ -13,7 +13,7 @@ Print current and latest version number
Print current and latest version number
```
```shell
minikube update-check [flags]
```

View File

@ -14,7 +14,7 @@ Update kubeconfig in case of an IP or port change
Retrieves the IP address of the running cluster, checks it
with IP in kubeconfig, and corrects kubeconfig if incorrect.
```
```shell
minikube update-context [flags]
```

View File

@ -13,7 +13,7 @@ Print the version of minikube
Print the version of minikube.
```
```shell
minikube version [flags]
```

View File

@ -9,23 +9,33 @@ description: >
To create an addon, first fork the minikube repository, and check out your fork:
`git clone git@github.com:<username>/minikube.git`
```shell
git clone git@github.com:<username>/minikube.git
```
Then go into the source directory:
`cd minikube`
```shell
cd minikube
```
Create a subdirectory:
`mkdir deploy/addons/<addon name>`
```shell
mkdir deploy/addons/<addon name>
```
Add your manifest YAML's to the directory you have created:
`cp *.yaml deploy/addons/<addon name>`
```shell
cp *.yaml deploy/addons/<addon name>
```
Note: If the addon never needs authentication to GCP, then consider adding the following label to the pod's yaml:
`gcp-auth-skip-secret: "true"`
```yaml
gcp-auth-skip-secret: "true"
```
To make the addon appear in `minikube addons list`, add it to `pkg/addons/config.go`. Here is the entry used by the `registry` addon, which will work for any addon which does not require custom code:

View File

@ -22,7 +22,9 @@ Use Github's repositories and markdown editor as described by [Kubernetes's gene
To serve documentation pages locally, clone the `minikube` repository and run:
`make site`
```shell
make site
```
Notes :
@ -33,7 +35,9 @@ Notes :
We recommend installing [markdownlint](https://github.com/markdownlint/markdownlint) to find issues with your markdown file. Once installed, you can use this handy target:
`make mdlint`
```shell
make mdlint
```
## Style Guidelines

View File

@ -12,7 +12,7 @@ You may need to add logs to the registry if the `TestJSONOutput` integration tes
### Background
minikube provides JSON output for `minikube start`, accesible via the `--output` flag:
```
```shell
minikube start --output json
```
@ -61,7 +61,7 @@ You will need to add your new log in two places:
Finally, set your new step in the cod by placing this line before you call `out.T`:
```
```go
register.Reg.SetStep(register.MyNewStep)
```

View File

@ -30,4 +30,6 @@ The image is located at `gcr.io/k8s-minikube/gvisor-addon`
## Updating the gVisor image
`make push-gvisor-addon-image`
```shell
make push-gvisor-addon-image
```

View File

@ -10,15 +10,15 @@ aliases:
The vmware driver supports virtualization across all VMware based hypervisors.
{{% tabs %}}
{{% tab "macOS" %}}
{{% mactab %}}
{{% readfile file="/docs/drivers/includes/vmware_macos_usage.inc" %}}
{{% /tab %}}
{{% tab "Linux" %}}
{{% /mactab %}}
{{% linuxtab %}}
No documentation is available yet.
{{% /tab %}}
{{% tab "Windows" %}}
{{% /linuxtab %}}
{{% windowstab %}}
No documentation is available yet.
{{% /tab %}}
{{% /windowstab %}}
{{% /tabs %}}
## Issues

View File

@ -22,15 +22,18 @@ Alternatively, configure `sudo` to never prompt for the commands issued by minik
minikube's bootstrapper, [Kubeadm](https://github.com/kubernetes/kubeadm) verifies a list of features on the host system before installing Kubernetes. in case you get this error, and you still want to try minikube anyways despite your system's limitation you can skip the verification by starting minikube with this extra option:
`minikube start --extra-config kubeadm.ignore-preflight-errors=SystemVerification`
```shell
minikube start --extra-config kubeadm.ignore-preflight-errors=SystemVerification
```
## what is the resource allocation for Knative Setup using minikube?
Please allocate sufficient resources for Knative setup using minikube, especially when you run a minikube cluster on your local machine. We recommend allocating at least 6 CPUs and 8G memory.
`minikube start --cpus 6 --memory 8000`
```shell
minikube start --cpus 6 --memory 8000
```
## Do I need to install kubectl locally?
No, minikube comes with built-in kubectl [see minikube's kubectl documentation]({{< ref "docs/handbook/kubectl.md" >}}).

View File

@ -24,7 +24,9 @@ A NodePort service is the most basic way to get external traffic directly to you
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
`minikube service --url $SERVICE`
```shell
minikube service --url $SERVICE
```
## Getting the NodePort using kubectl
@ -32,13 +34,17 @@ The minikube VM is exposed to the host system via a host-only IP address, that c
To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output):
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'`
```shell
kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'
```
### Increasing the NodePort range
By default, minikube only exposes ports 30000-32767. If this does not work for you, you can adjust the range by using:
`minikube start --extra-config=apiserver.service-node-port-range=1-65535`
```shell
minikube start --extra-config=apiserver.service-node-port-range=1-65535
```
This flag also accepts a comma separated list of ports and port ranges.
@ -57,7 +63,7 @@ Services of type `LoadBalancer` can be exposed via the `minikube tunnel` command
#### Run tunnel in a separate terminal
it will ask for password.
```
```shell
minikube tunnel
```
@ -88,16 +94,16 @@ Status:
#### Create a kubernetes deployment
```
```shell
kubectl create deployment hello-minikube1 --image=k8s.gcr.io/echoserver:1.4
```
#### Create a kubernetes service type LoadBalancer
```
```shell
kubectl expose deployment hello-minikube1 --type=LoadBalancer --port=8080
```
### Check external IP
```
```shell
kubectl get svc
```
<pre>

View File

@ -8,8 +8,11 @@ date: 2020-07-15
If you have a containerized GCP app with a Kubernetes yaml, you can automatically add your credentials to all your deployed pods dynamically with this minikube addon. You just need to have a credentials file, which can be generated with `gcloud auth application-default login`. If you already have a json credentials file you want specify, use the GOOGLE_APPLICATION_CREDENTIALS environment variable.
- Start a cluster:
```
```shell
minikube start
```
```
😄 minikube v1.12.0 on Darwin 10.15.5
✨ Automatically selected the docker driver. Other choices: hyperkit, virtualbox
👍 Starting control plane node minikube in cluster minikube
@ -21,8 +24,11 @@ minikube start
```
- Enable the `gcp-auth` addon:
```
```shell
minikube addons enable gcp-auth
```
```
🔎 Verifying gcp-auth addon...
📌 Your GCP credentials will now be mounted into every pod created in the minikube cluster.
📌 If you don't want credential mounted into a specific pod, add a label with the `gcp-auth-skip-secret` key to your pod configuration.
@ -30,14 +36,17 @@ minikube addons enable gcp-auth
```
- For credentials in an arbitrary path:
```
```shell
export GOOGLE_APPLICATION_CREDENTIALS=<creds-path>.json
minikube addons enable gcp-auth
```
- Deploy your GCP app as normal:
```
```shell
kubectl apply -f test.yaml
```
```
deployment.apps/pytest created
```

View File

@ -49,7 +49,9 @@ This flag is repeated, so you can pass it several times with several different v
By default, minikube installs the latest stable version of Kubernetes that was available at the time of the minikube release. You may select a different Kubernetes release by using the `--kubernetes-version` flag, for example:
`minikube start --kubernetes-version=v1.11.10`
```shell
minikube start --kubernetes-version=v1.11.10
```
minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube aims to support older releases as well so that users can emulate legacy environments.

View File

@ -10,40 +10,60 @@ aliases:
Start a cluster by running:
`minikube start`
```shell
minikube start
```
Access the Kubernetes Dashboard running within the minikube cluster:
`minikube dashboard`
```shell
minikube dashboard
```
Once started, you can interact with your cluster using `kubectl`, just like any other Kubernetes cluster. For instance, starting a server:
`kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4`
```shell
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
```
Exposing a service as a NodePort
`kubectl expose deployment hello-minikube --type=NodePort --port=8080`
```shell
kubectl expose deployment hello-minikube --type=NodePort --port=8080
```
minikube makes it easy to open this exposed endpoint in your browser:
`minikube service hello-minikube`
```shell
minikube service hello-minikube
```
Upgrade your cluster:
`minikube start --kubernetes-version=latest`
```shell
minikube start --kubernetes-version=latest
```
Start a second local cluster (_note: This will not work if minikube is using the bare-metal/none driver_):
`minikube start -p cluster2`
```shell
minikube start -p cluster2
```
Stop your local cluster:
`minikube stop`
```shell
minikube stop
```
Delete your local cluster:
`minikube delete`
```shell
minikube delete
```
Delete all local clusters and profiles
`minikube delete --all`
```shell
minikube delete --all
```

View File

@ -10,7 +10,7 @@ aliases:
## kubectl
```
```shell
kubectl create deployment hello-minikube1 --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-minikube1 --type=LoadBalancer --port=8080
```

Some files were not shown because too many files have changed in this diff Show More