Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed Dec 9, 2019
2 parents 9ad7fb7 + a6c749f commit a84db18
Show file tree
Hide file tree
Showing 61 changed files with 869 additions and 245 deletions.
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Release Notes

## Version 1.6.0-beta.1 - 2019-11-26

* cri-o v1.16.0 [#5970](https://github.com/kubernetes/minikube/pull/5970)
* Update default k8s version to 1.17.0-rc.1 [#5973](https://github.com/kubernetes/minikube/pull/5973)
* Update crictl to v1.16.1 [#5972](https://github.com/kubernetes/minikube/pull/5972)
* Update docker to v19.03.5 [#5914](https://github.com/kubernetes/minikube/pull/5914)
* Fix profile list for non existenting folder [#5955](https://github.com/kubernetes/minikube/pull/5955)
* Upgrade podman to 1.6.3 [#5971](https://github.com/kubernetes/minikube/pull/5971)
* Fix validation of container-runtime config [#5964](https://github.com/kubernetes/minikube/pull/5964)
* Add option for virtualbox users to set nat-nic-type [#5960](https://github.com/kubernetes/minikube/pull/5960)
* Upgrade buildroot minor version to 2019.02.7 [#5967](https://github.com/kubernetes/minikube/pull/5967)
* dashboard: Update to latest images (2.0.0-beta6) [#5934](https://github.com/kubernetes/minikube/pull/5934)

Huge thank you for this release towards our contributors:
- Adam Crowder
- Anders F Björklund
- David Newman
- Harsimran Singh Maan
- Kenta Iso
- Medya Ghazizadeh
- Reuven Harrison
- Sharif Elgamal
- Thomas Stromberg
- yuxiaobo

## Version 1.6.0-beta.0 - 2019-11-15

* Update DefaultKubernetesVersion to v1.17.0-beta.1 to prepare for betas [#5925](https://github.com/kubernetes/minikube/pull/5925)
* Make it possible to recover from a previously aborted StartCluster (Ctrl-C) [#5916](https://github.com/kubernetes/minikube/pull/5916)
* Add retry to SSH connectivity check [#5848](https://github.com/kubernetes/minikube/pull/5848)
* Make --wait=false non-blocking, --wait=true blocks on system pods [#5894](https://github.com/kubernetes/minikube/pull/5894)
* Only copy new or modified files into VM on restart [#5864](https://github.com/kubernetes/minikube/pull/5864)
* Remove heapster addon [#5243](https://github.com/kubernetes/minikube/pull/5243)
* mention fix for AppArmor related permission errors [#5842](https://github.com/kubernetes/minikube/pull/5842)
* Health check previously configured driver & exit if not installed [#5840](https://github.com/kubernetes/minikube/pull/5840)
* Add memory and wait longer for TestFunctional tests, include node logs [#5852](https://github.com/kubernetes/minikube/pull/5852)
* Improve message when selected driver is incompatible with existing cluster [#5854](https://github.com/kubernetes/minikube/pull/5854)
* Update libmachine to point to latest [#5877](https://github.com/kubernetes/minikube/pull/5877)
* none driver: Warn about --cpus, --memory, and --container-runtime settings [#5845](https://github.com/kubernetes/minikube/pull/5845)
* Refactor config.Config to prepare for multinode [#5889](https://github.com/kubernetes/minikube/pull/5889)

Huge thank you for this release towards our contributors:
- Anders Björklund
- Aresforchina
- Igor Zibarev
- Josh Woodcock
- Medya Ghazizadeh
- Nanik T
- Priya Wadhwa
- RA489
- Ruslan Gustomiasov
- Sharif Elgamal
- Steffen Gransow
- Thomas Strömberg

## Version 1.5.2 - 2019-10-31 (Happy Halloween!)

* service: fix --url mode [#5790](https://github.com/kubernetes/minikube/pull/5790)
Expand Down
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 5
VERSION_BUILD ?= 2
VERSION_MINOR ?= 6
VERSION_BUILD ?= 0-beta.1
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).${VERSION_BUILD}
VERSION ?= v$(RAW_VERSION)

# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).1
ISO_VERSION ?= v1.6.0-beta.1
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
RPM_VERSION ?= $(DEB_VERSION)
Expand All @@ -29,7 +29,7 @@ RPM_VERSION ?= $(DEB_VERSION)
GO_VERSION ?= 1.13.4

INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2019.02.6
BUILDROOT_BRANCH ?= 2019.02.7
REGISTRY?=gcr.io/k8s-minikube

# Get git commit id
Expand All @@ -49,7 +49,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.76
KERNEL_VERSION ?= 4.19.81
# latest from https://github.com/golangci/golangci-lint/releases
GOLINT_VERSION ?= v1.21.0
# Limit number of default jobs, to avoid the CI builds running out of memory
Expand Down Expand Up @@ -117,7 +117,7 @@ HYPERKIT_LDFLAGS := -X k8s.io/minikube/pkg/drivers/hyperkit.version=$(VERSION) -

# $(call DOCKER, image, command)
define DOCKER
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --entrypoint /bin/bash $(1) -c '$(2)'
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --init $(1) /bin/bash -c '$(2)'
endef

ifeq ($(BUILD_IN_DOCKER),y)
Expand Down Expand Up @@ -435,7 +435,10 @@ out/minikube-installer.exe: out/minikube-windows-amd64.exe

out/docker-machine-driver-hyperkit:
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(HYPERKIT_BUILD_IMAGE),CC=o64-clang CXX=o64-clang++ /usr/bin/make $@)
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 \
--user $(shell id -u):$(shell id -g) -w /app \
-v $(PWD):/app -v $(GOPATH):/go --init --entrypoint "" \
$(HYPERKIT_BUILD_IMAGE) /bin/bash -c 'CC=o64-clang CXX=o64-clang++ /usr/bin/make $@'
else
GOOS=darwin CGO_ENABLED=1 go build \
-ldflags="$(HYPERKIT_LDFLAGS)" \
Expand All @@ -444,7 +447,7 @@ endif

hyperkit_in_docker:
rm -f out/docker-machine-driver-hyperkit
$(call DOCKER,$(HYPERKIT_BUILD_IMAGE),CC=o64-clang CXX=o64-clang++ /usr/bin/make out/docker-machine-driver-hyperkit)
$(MAKE) MINIKUBE_BUILD_IN_DOCKER=y out/docker-machine-driver-hyperkit

.PHONY: install-hyperkit-driver
install-hyperkit-driver: out/docker-machine-driver-hyperkit ## Install hyperkit to local machine
Expand Down
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var settings = []Setting{
{
name: "container-runtime",
set: SetString,
validations: []setFn{IsContainerdRuntime},
validations: []setFn{IsValidRuntime},
callbacks: []setFn{RequiresRestartMsg},
},
{
Expand Down
32 changes: 29 additions & 3 deletions cmd/minikube/cmd/config/profile_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ import (
"strconv"
"strings"

"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/out"

"github.com/golang/glog"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -58,7 +61,7 @@ var printProfilesTable = func() {
var validData [][]string

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Profile", "VM Driver", "NodeIP", "Node Port", "Kubernetes Version"})
table.SetHeader([]string{"Profile", "VM Driver", "NodeIP", "Node Port", "Kubernetes Version", "Status"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")
Expand All @@ -67,8 +70,18 @@ var printProfilesTable = func() {
if len(validProfiles) == 0 || err != nil {
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
}
api, err := machine.NewAPIClient()
if err != nil {
glog.Infof("failed to get machine api client %v", err)
}
defer api.Close()

for _, p := range validProfiles {
validData = append(validData, []string{p.Name, p.Config[0].VMDriver, p.Config[0].KubernetesConfig.NodeIP, strconv.Itoa(p.Config[0].KubernetesConfig.NodePort), p.Config[0].KubernetesConfig.KubernetesVersion})
p.Status, err = cluster.GetHostStatus(api, p.Name)
if err != nil {
glog.Infof("error getting host status for %v", err)
}
validData = append(validData, []string{p.Name, p.Config[0].VMDriver, p.Config[0].KubernetesConfig.NodeIP, strconv.Itoa(p.Config[0].KubernetesConfig.NodePort), p.Config[0].KubernetesConfig.KubernetesVersion, p.Status})
}

table.AppendBulk(validData)
Expand All @@ -93,7 +106,20 @@ var printProfilesTable = func() {
}

var printProfilesJSON = func() {
api, err := machine.NewAPIClient()
if err != nil {
glog.Infof("failed to get machine api client %v", err)
}
defer api.Close()

validProfiles, invalidProfiles, err := config.ListProfiles()
for _, v := range validProfiles {
status, err := cluster.GetHostStatus(api, v.Name)
if err != nil {
glog.Infof("error getting host status for %v", err)
}
v.Status = status
}

var valid []*config.Profile
var invalid []*config.Profile
Expand All @@ -112,7 +138,7 @@ var printProfilesJSON = func() {

var body = map[string]interface{}{}

if err == nil {
if err == nil || os.IsNotExist(err) {
body["valid"] = valid
body["invalid"] = invalid
jsonString, _ := json.Marshal(body)
Expand Down
9 changes: 4 additions & 5 deletions cmd/minikube/cmd/config/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,16 @@ func TestValidateProfile(t *testing.T) {
profileName: "82374328742_2974224498",
},
{
profileName: "minikube",
profileName: "validate_test",
},
}

for _, test := range testCases {
profileNam := test.profileName
expectedMsg := fmt.Sprintf("profile %q not found", test.profileName)

expected := fmt.Sprintf("profile %q not found", test.profileName)
err, ok := ValidateProfile(profileNam)
if !ok && err.Error() != expectedMsg {
t.Errorf("Didnt receive expected message")
if !ok && err.Error() != expected {
t.Errorf("got error %q, expected %q", err, expected)
}
}
}
9 changes: 9 additions & 0 deletions cmd/minikube/cmd/config/validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ func IsValidAddon(name string, val string) error {
return errors.Errorf("Cannot enable/disable invalid addon %s", name)
}

// IsValidRuntime checks if a string is a valid runtime
func IsValidRuntime(name string, runtime string) error {
_, err := cruntime.New(cruntime.Config{Type: runtime})
if err != nil {
return fmt.Errorf("invalid runtime: %v", err)
}
return nil
}

// IsContainerdRuntime is a validator which returns an error if the current runtime is not containerd
func IsContainerdRuntime(_, _ string) error {
config, err := config.Load()
Expand Down
27 changes: 27 additions & 0 deletions cmd/minikube/cmd/config/validations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,33 @@ func TestValidCIDR(t *testing.T) {
runValidations(t, tests, "cidr", IsValidCIDR)
}

func TestValidRuntime(t *testing.T) {
var tests = []validationTest{
{
value: "", // default
shouldErr: false,
},
{
value: "invalid",
shouldErr: true,
},
{
value: "containerd",
shouldErr: false,
},
{
value: "crio",
shouldErr: false,
},
{
value: "docker",
shouldErr: false,
},
}

runValidations(t, tests, "container-runtime", IsValidRuntime)
}

func TestIsURLExists(t *testing.T) {

self, err := os.Executable()
Expand Down
32 changes: 25 additions & 7 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ const (
minimumCPUS = 2
minimumDiskSize = "2000mb"
autoUpdate = "auto-update-drivers"
hostOnlyNicType = "host-only-nic-type"
natNicType = "nat-nic-type"
)

var (
Expand Down Expand Up @@ -178,7 +180,7 @@ func initMinikubeFlags() {

// initKubernetesFlags inits the commandline flags for kubernetes related options
func initKubernetesFlags() {
startCmd.Flags().String(kubernetesVersion, constants.DefaultKubernetesVersion, "The kubernetes version that the minikube VM will use (ex: v1.2.3)")
startCmd.Flags().String(kubernetesVersion, "", "The kubernetes version that the minikube VM will use (ex: v1.2.3)")
startCmd.Flags().Var(&extraOptions, "extra-config",
`A set of key=value pairs that describe configuration that may be passed to different components.
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
Expand Down Expand Up @@ -208,6 +210,8 @@ func initDriverFlags() {
startCmd.Flags().Bool(dnsProxy, false, "Enable proxy for NAT DNS requests (virtualbox driver only)")
startCmd.Flags().Bool(hostDNSResolver, true, "Enable host resolver for NAT DNS requests (virtualbox driver only)")
startCmd.Flags().Bool(noVTXCheck, false, "Disable checking for the availability of hardware virtualization before the vm is started (virtualbox driver only)")
startCmd.Flags().String(hostOnlyNicType, "virtio", "NIC Type used for host only network. One of Am79C970A, Am79C973, 82540EM, 82543GC, 82545EM, or virtio (virtualbox driver only)")
startCmd.Flags().String(natNicType, "virtio", "NIC Type used for host only network. One of Am79C970A, Am79C973, 82540EM, 82543GC, 82545EM, or virtio (virtualbox driver only)")

// hyperkit
startCmd.Flags().StringSlice(vsockPorts, []string{}, "List of guest VSock ports that should be exposed as sockets on the host (hyperkit driver only)")
Expand Down Expand Up @@ -912,6 +916,8 @@ func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string, drvName string)
NoVTXCheck: viper.GetBool(noVTXCheck),
DNSProxy: viper.GetBool(dnsProxy),
HostDNSResolver: viper.GetBool(hostDNSResolver),
HostOnlyNicType: viper.GetString(hostOnlyNicType),
NatNicType: viper.GetString(natNicType),
KubernetesConfig: cfg.KubernetesConfig{
KubernetesVersion: k8sVersion,
NodePort: viper.GetInt(apiServerPort),
Expand Down Expand Up @@ -1114,15 +1120,20 @@ func tryRegistry(r command.Runner) {

// getKubernetesVersion ensures that the requested version is reasonable
func getKubernetesVersion(old *cfg.MachineConfig) (string, bool) {
rawVersion := viper.GetString(kubernetesVersion)
paramVersion := viper.GetString(kubernetesVersion)
isUpgrade := false
if rawVersion == "" {
rawVersion = constants.DefaultKubernetesVersion

if paramVersion == "" { // if the user did not specify any version then ...
if old != nil { // .. use the old version from config
paramVersion = old.KubernetesConfig.KubernetesVersion
} else { // .. otherwise use the default version
paramVersion = constants.DefaultKubernetesVersion
}
}

nvs, err := semver.Make(strings.TrimPrefix(rawVersion, version.VersionPrefix))
nvs, err := semver.Make(strings.TrimPrefix(paramVersion, version.VersionPrefix))
if err != nil {
exit.WithCodeT(exit.Data, `Unable to parse "{{.kubernetes_version}}": {{.error}}`, out.V{"kubernetes_version": rawVersion, "error": err})
exit.WithCodeT(exit.Data, `Unable to parse "{{.kubernetes_version}}": {{.error}}`, out.V{"kubernetes_version": paramVersion, "error": err})
}
nv := version.VersionPrefix + nvs.String()

Expand All @@ -1134,6 +1145,10 @@ func getKubernetesVersion(old *cfg.MachineConfig) (string, bool) {
if err != nil {
exit.WithCodeT(exit.Data, "Unable to parse oldest Kubernetes version from constants: {{.error}}", out.V{"error": err})
}
defaultVersion, err := semver.Make(strings.TrimPrefix(constants.DefaultKubernetesVersion, version.VersionPrefix))
if err != nil {
exit.WithCodeT(exit.Data, "Unable to parse default Kubernetes version from constants: {{.error}}", out.V{"error": err})
}

if nvs.LT(oldestVersion) {
out.WarningT("Specified Kubernetes version {{.specified}} is less than the oldest supported version: {{.oldest}}", out.V{"specified": nvs, "oldest": constants.OldestKubernetesVersion})
Expand Down Expand Up @@ -1162,8 +1177,11 @@ func getKubernetesVersion(old *cfg.MachineConfig) (string, bool) {
* Reuse the existing cluster with Kubernetes v{{.old}} or newer: Run "minikube start {{.profile}} --kubernetes-version={{.old}}"`, out.V{"new": nvs, "old": ovs, "profile": profileArg})

}
if defaultVersion.GT(nvs) {
out.T(out.ThumbsUp, "Kubernetes {{.new}} is now available. If you would like to upgrade, specify: --kubernetes-version={{.new}}", out.V{"new": defaultVersion})
}

if nvs.GT(ovs) {
out.T(out.ThumbsUp, "Upgrading from Kubernetes {{.old}} to {{.new}}", out.V{"old": ovs, "new": nvs})
isUpgrade = true
}
return nv, isUpgrade
Expand Down
Loading

0 comments on commit a84db18

Please sign in to comment.