未验证 提交 e8329f63 编写于 作者: S Sharif Elgamal

Merge branch 'master' of github.com:kubernetes/minikube into localization-poc

---
name: English
about: Report an issue in English
---
<!-- Please use this template while reporting an issue, providing as much information as possible. Failure to do so may result in a delayed response. Thank you! -->
**The exact command to reproduce the issue**:
......
---
name: Español
about: Reportar un problema en Español
labels:
- l/es
---
<!-- Utiliza esta plantilla para informar de incidencias y proporciona tanta información como sea posible. Si no lo haces, es posible que la respuesta se retrase. Muchas gracias. -->
 
**Los comandos necesarios para reproducir la incidencia**:
 
**El resultado completo del comando que ha fallado**:
 
**El resultado del comando `minikube logs`**:
 
**La versión del sistema operativo que utilizaste**:
---
name: Português
about: Reportar um problema em Português
labels:
- l/pt-BR
---
<!-- Use este modelo ao reportar um problema e forneça o máximo de informações possível. Se não fazer isso, pode haver um atraso na resposta. A equipe agradece. -->
 
**Os comandos necessários para reproduzir o problema**:
 
**A saída completa do comando que apresentou falha**:
 
**A saída do comando `minikube logs`**:
 
**A versão do sistema operacional usado**:
---
name: 中文 Chinese
about: Report issue in Chinese (中文)
labels:
- l/zh-CN
---
<!-- 请在报告问题时使用此模板,并提供尽可能详细的信息。否则可能导致响应延迟。谢谢!-->
 
**重现问题所需的命令**
 
**失败的命令的完整输出**
 
**`minikube logs`命令的输出**
 
**使用的操作系统版本**
[submodule "site/themes/hugo-whisper-theme"]
path = site/themes/hugo-whisper-theme
url = https://github.com/jugglerx/hugo-whisper-theme.git
......@@ -23,7 +23,7 @@ VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
DEB_VERSION ?= $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
RPM_VERSION ?= $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2018.05
BUILDROOT_BRANCH ?= 2018.05.3
REGISTRY?=gcr.io/k8s-minikube
HYPERKIT_BUILD_IMAGE ?= karalabe/xgo-1.12.x
......@@ -367,7 +367,7 @@ release-minikube: out/minikube checksum
out/docker-machine-driver-kvm2:
go build \
-installsuffix "static" \
-ldflags "-X k8s.io/minikube/pkg/drivers/kvm/version.VERSION=$(VERSION)" \
-ldflags "-X k8s.io/minikube/pkg/drivers/kvm.version=$(VERSION)" \
-tags libvirt.1.3.1 \
-o $(BUILD_DIR)/docker-machine-driver-kvm2 \
k8s.io/minikube/cmd/drivers/kvm
......
......@@ -23,7 +23,7 @@ minikube's [primary goals](https://github.com/kubernetes/minikube/blob/master/do
:mega: **Please fill out our [fast 5-question survey](https://forms.gle/Gg3hG5ZySw8c1C24A)** so that we can learn how & why you use minikube, and what improvements we should make. Thank you! :dancers:
* 2019-06-27 - v1.1.1 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.1.1)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-111---2019-06-07)]
* 2019-06-07 - v1.1.1 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.1.1)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-111---2019-06-07)]
* 2019-05-21 - v1.1.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.1.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-110---2019-05-21)]
* 2019-04-29 - v1.0.1 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.0.1)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-101---2019-04-29)]
* 2019-03-27 - v1.0.0 released! [[download](https://github.com/kubernetes/minikube/releases/tag/v1.0.0)] [[release notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md#version-1000---2019-03-27)]
......@@ -38,7 +38,7 @@ minikube runs the latest stable release of Kubernetes, with support for standard
* [Persistent Volumes](https://github.com/kubernetes/minikube/blob/master/docs/persistent_volumes.md)
* Ingress
* RBAC
* Dashboard - `minikube dashboard`
* [Dashboard](https://github.com/kubernetes/minikube/blob/master/docs/dashboard.md) - `minikube dashboard`
* [Container runtimes](https://github.com/kubernetes/minikube/blob/master/docs/alternative_runtimes.md) - `start --container-runtime`
* [Configure apiserver and kubelet options](https://github.com/kubernetes/minikube/blob/master/docs/configuring_kubernetes.md) via command-line flags
......
......@@ -19,10 +19,18 @@ limitations under the License.
package main
import (
"fmt"
"os"
"github.com/docker/machine/libmachine/drivers/plugin"
"k8s.io/minikube/pkg/drivers/kvm"
)
func main() {
if len(os.Args) > 1 && os.Args[1] == "--version" {
fmt.Println(kvm.GetVersion())
return
}
plugin.RegisterDriver(kvm.NewDriver("", ""))
}
......@@ -23,7 +23,9 @@ import (
"github.com/spf13/viper"
pkgConfig "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/console"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/exit"
pkgutil "k8s.io/minikube/pkg/util"
)
// ProfileCmd represents the profile command
......@@ -48,9 +50,24 @@ var ProfileCmd = &cobra.Command{
}
err := Set(pkgConfig.MachineProfile, profile)
if err != nil {
exit.WithError("set failed", err)
} else {
console.Success("minikube profile was successfully set to %s", profile)
exit.WithError("Setting profile failed", err)
}
cc, err := pkgConfig.Load()
// might err when loading older version of cfg file that doesn't have KeepContext field
if err != nil && !os.IsNotExist(err) {
console.ErrLn("Error loading profile config: %v", err)
}
if err == nil {
if cc.MachineConfig.KeepContext {
console.Success("Skipped switching kubectl context for %s , because --keep-context", profile)
console.Success("To connect to this cluster, use: kubectl --context=%s", profile)
} else {
err := pkgutil.SetCurrentContext(constants.KubeconfigPath, profile)
if err != nil {
console.ErrLn("Error while setting kubectl current context : %v", err)
}
}
}
console.Success("minikube profile was successfully set to %s", profile)
},
}
......@@ -27,6 +27,7 @@ import (
"k8s.io/minikube/pkg/minikube/bootstrapper"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/console"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
......@@ -136,8 +137,31 @@ func EnableOrDisableAddon(name string, val string) error {
return enableOrDisableAddonInternal(addon, cmd, data, enable)
}
func isAddonAlreadySet(addon *assets.Addon, enable bool) error {
addonStatus, err := addon.IsEnabled()
if err != nil {
return errors.Wrap(err, "get the addon status")
}
if addonStatus && enable {
return fmt.Errorf("addon %s was already enabled", addon.Name())
} else if !addonStatus && !enable {
return fmt.Errorf("addon %s was already disabled", addon.Name())
}
return nil
}
func enableOrDisableAddonInternal(addon *assets.Addon, cmd bootstrapper.CommandRunner, data interface{}, enable bool) error {
var err error
// check addon status before enabling/disabling it
if err := isAddonAlreadySet(addon, enable); err != nil {
console.ErrStyle(console.Conflict, "%v", err)
os.Exit(0)
}
if enable {
for _, addon := range addon.Assets {
var addonFile assets.CopyableFile
......
......@@ -19,6 +19,7 @@ package config
import (
"testing"
"k8s.io/minikube/pkg/minikube/assets"
pkgConfig "k8s.io/minikube/pkg/minikube/config"
)
......@@ -79,3 +80,33 @@ func TestSetBool(t *testing.T) {
t.Fatalf("SetBool set wrong value")
}
}
func TestIsAddonAlreadySet(t *testing.T) {
testCases := []struct {
addonName string
expectErr string
}{
{
addonName: "ingress",
expectErr: "addon ingress was already ",
},
{
addonName: "heapster",
expectErr: "addon heapster was already ",
},
}
for _, test := range testCases {
addon := assets.Addons[test.addonName]
addonStatus, _ := addon.IsEnabled()
expectMsg := test.expectErr + "enabled"
if !addonStatus {
expectMsg = test.expectErr + "disabled"
}
err := isAddonAlreadySet(addon, addonStatus)
if err.Error() != expectMsg {
t.Errorf("Did not get expected error, \n\n expected: %+v \n\n actual: %+v", expectMsg, err)
}
}
}
......@@ -32,6 +32,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
configcmd "k8s.io/minikube/cmd/minikube/cmd/config"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/cluster"
pkg_config "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/console"
......@@ -94,12 +95,17 @@ var dashboardCmd = &cobra.Command{
cluster.EnsureMinikubeRunningOrExit(api, 1)
// Send status messages to stderr for folks re-using this output.
console.ErrStyle(console.Enabling, "Enabling dashboard ...")
// Enable the dashboard add-on
err = configcmd.Set("dashboard", "true")
if err != nil {
exit.WithError("Unable to enable dashboard", err)
// Check dashboard status before enabling it
dashboardAddon := assets.Addons["dashboard"]
dashboardStatus, _ := dashboardAddon.IsEnabled()
if !dashboardStatus {
// Send status messages to stderr for folks re-using this output.
console.ErrStyle(console.Enabling, "Enabling dashboard ...")
// Enable the dashboard add-on
err = configcmd.Set("dashboard", "true")
if err != nil {
exit.WithError("Unable to enable dashboard", err)
}
}
ns := "kube-system"
......
......@@ -29,6 +29,8 @@ import (
"strings"
"time"
"k8s.io/minikube/pkg/minikube/drivers/none"
"github.com/blang/semver"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/host"
......@@ -190,6 +192,7 @@ func runStart(cmd *cobra.Command, args []string) {
} else {
// With "none", images are persistently stored in Docker, so internal caching isn't necessary.
viper.Set(cacheImages, false)
config.KubernetesConfig.ShouldLoadCachedImages = false
}
// Now that the ISO is downloaded, pull images in the background while the VM boots.
......@@ -350,6 +353,11 @@ func validateConfig() {
exit.Usage("Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2")
}
err := autoSetOptions(viper.GetString(vmDriver))
if err != nil {
glog.Errorf("Error autoSetOptions : %v", err)
}
// check that kubeadm extra args contain only whitelisted parameters
for param := range extraOptions.AsMap().Get(kubeadm.Kubeadm) {
if !pkgutil.ContainsString(kubeadm.KubeadmExtraArgsWhitelist[kubeadm.KubeadmCmdParam], param) &&
......@@ -439,6 +447,7 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
cfg := cfg.Config{
MachineConfig: cfg.MachineConfig{
KeepContext: viper.GetBool(keepContext),
MinikubeISO: viper.GetString(isoURL),
Memory: viper.GetInt(memory),
CPUs: viper.GetInt(cpus),
......@@ -486,6 +495,17 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
return cfg, nil
}
// autoSetOptions sets the options needed for specific configuration automatically.
func autoSetOptions(vmDriver string) error {
// options for none driver
if vmDriver == constants.DriverNone {
if o := none.AutoOptions(); o != "" {
return extraOptions.Set(o)
}
}
return nil
}
// prepareNone prepares the user and host for the joy of the "none" driver
func prepareNone() {
if viper.GetBool(cfg.WantNoneDriverWarning) {
......
......@@ -23,9 +23,9 @@ import (
"encoding/hex"
"fmt"
"io/ioutil"
"net/http"
"testing"
retryablehttp "github.com/hashicorp/go-retryablehttp"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/notify"
"k8s.io/minikube/pkg/util"
......@@ -33,7 +33,7 @@ import (
func getSHAFromURL(url string) (string, error) {
fmt.Println("Downloading: ", url)
r, err := http.Get(url)
r, err := retryablehttp.Get(url)
if err != nil {
return "", err
}
......
# Dashboard
Minikube supports the [Kubernetes Dashboard](https://github.com/kubernetes/dashboard) out of the box.
## Accessing the UI
To access the dashboard:
```shell
minikube dashboard
```
This will enable the dashboard add-on, and open the proxy in the default web browser.
To stop the proxy (leaves the dashboard running), abort the started process (`Ctrl+C`).
## Individual steps
If the automatic command doesn't work for you for some reason, here are the steps:
```console
$ minikube addons enable dashboard
✅ dashboard was successfully enabled
```
If you have your kubernetes client configured for minikube, you can start the proxy:
```console
$ kubectl --context minikube proxy
Starting to serve on 127.0.0.1:8001
```
Access the dashboard at:
<http://localhost:8001/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/>
For additional information, see [this page](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/).
......@@ -32,6 +32,7 @@ require (
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/go-multierror v0.0.0-20160811015721-8c5f0ad93604 // indirect
github.com/hashicorp/go-retryablehttp v0.5.4
github.com/hashicorp/go-version v1.1.0 // indirect
github.com/hashicorp/golang-lru v0.0.0-20160207214719-a0d98a5f2880 // indirect
github.com/hashicorp/hcl v0.0.0-20160711231752-d8c773c4cba1 // indirect
......
[build]
base = "site/"
publish = "site/public/"
command = "hugo"
[build.environment]
HUGO_VERSION = "0.55.0"
[context.production.environment]
HUGO_ENV = "production"
HUGO_BASEURL = "https://minikube.sigs.k8s.io/"
[context.deploy-preview]
command = "hugo --enableGitInfo --buildFuture -b $DEPLOY_PRIME_URL"
[context.branch-deploy]
command = "hugo --enableGitInfo --buildFuture -b $DEPLOY_PRIME_URL"
......@@ -108,6 +108,11 @@ func (d *Driver) ensureNetwork() error {
// createNetwork is called during creation of the VM only (and not on start)
func (d *Driver) createNetwork() error {
if d.Network == defaultPrivateNetworkName {
return fmt.Errorf("KVM network can't be named %s. This is the name of the private network created by minikube", defaultPrivateNetworkName)
}
conn, err := getConnection()
if err != nil {
return errors.Wrap(err, "getting libvirt connection")
......
/*
Copyright 2016 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 kvm
// The current version of the docker-machine-driver-kvm2
// version is a private field and should be set when compiling with --ldflags="-X k8s.io/minikube/pkg/drivers/kvm.version=vX.Y.Z"
var version = "v0.0.0-unset"
// GetVersion returns the current docker-machine-driver-kvm2 version
func GetVersion() string {
return version
}
......@@ -47,6 +47,11 @@ func NewAddon(assets []*BinAsset, enabled bool, addonName string) *Addon {
return a
}
// Name get the addon name
func (a *Addon) Name() string {
return a.addonName
}
// IsEnabled checks if an Addon is enabled
func (a *Addon) IsEnabled() (bool, error) {
addonStatusText, err := config.Get(a.addonName)
......@@ -255,6 +260,12 @@ var Addons = map[string]*Addon{
"registry-svc.yaml",
"0640",
false),
MustBinAsset(
"deploy/addons/registry/registry-proxy.yaml.tmpl",
constants.AddonsPath,
"registry-proxy.yaml",
"0640",
false),
}, false, "registry"),
"registry-creds": NewAddon([]*BinAsset{
MustBinAsset(
......
......@@ -19,9 +19,10 @@ package kubeadm
// defaultCNIConfig is the CNI config which is provisioned when --enable-default-cni
// has been passed to `minikube start`.
//
// The config is being written to /etc/cni/net.d/k8s.conf and /etc/rkt/net.d/k8s.conf.
// The config is being written to /etc/cni/net.d/k8s.conf.
const defaultCNIConfig = `
{
"cniVersion": "0.3.0",
"name": "rkt.kubernetes.io",
"type": "bridge",
"bridge": "mybridge",
......
......@@ -634,8 +634,7 @@ func copyConfig(cfg config.KubernetesConfig, files []assets.CopyableFile, kubead
// and minikube was started with "--extra-config=kubelet.network-plugin=cni".
if cfg.EnableDefaultCNI {
files = append(files,
assets.NewMemoryAssetTarget([]byte(defaultCNIConfig), constants.DefaultCNIConfigPath, "0644"),
assets.NewMemoryAssetTarget([]byte(defaultCNIConfig), constants.DefaultRktNetConfigPath, "0644"))
assets.NewMemoryAssetTarget([]byte(defaultCNIConfig), constants.DefaultCNIConfigPath, "0644"))
}
return files
......
......@@ -75,7 +75,7 @@ Wants=crio.service
[Service]
ExecStart=
ExecStart=/usr/bin/kubelet --allow-privileged=true --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=/var/run/crio/crio.sock --kubeconfig=/etc/kubernetes/kubelet.conf --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
ExecStart=/usr/bin/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-dns=10.96.0.10 --cluster-domain=cluster.local --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=/var/run/crio/crio.sock --kubeconfig=/etc/kubernetes/kubelet.conf --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m
[Install]
`,
......
......@@ -242,7 +242,14 @@ var versionSpecificOpts = []VersionedExtraOption{
// System pods args
NewUnversionedOption(Kubelet, "pod-manifest-path", "/etc/kubernetes/manifests"),
NewUnversionedOption(Kubelet, "allow-privileged", "true"),
{
Option: util.ExtraOption{
Component: Kubelet,
Key: "allow-privileged",
Value: "true",
},
LessThanOrEqual: semver.MustParse("1.15.0-alpha.3"),
},
// Network args
NewUnversionedOption(Kubelet, "cluster-dns", "10.96.0.10"),
......
......@@ -132,12 +132,15 @@ func mntCmd(source string, target string, c *MountConfig) string {
// umountCmd returns a command for unmounting
func umountCmd(target string, force bool) string {
flag := ""
// Call fuser before unmount, for killing the processes using the mount point. Notes: don't use 'lsof' to avoid the innocents
flag1 := fmt.Sprintf("sudo fuser -km %s;", target)
flag2 := ""
if force {
flag = "-f "
flag1 = ""
flag2 = "-f "
}
// grep because findmnt will also display the parent!
return fmt.Sprintf("findmnt -T %s | grep %s && sudo umount %s%s || true", target, target, flag, target)
return fmt.Sprintf("[ \"x$(findmnt -T %s | grep %s)\" != \"x\" ] && { %s sudo umount %s%s; } || echo ", target, target, flag1, flag2, target)
}
// Unmount unmounts a path
......
......@@ -54,7 +54,7 @@ func TestMount(t *testing.T) {
target: "target",
cfg: &MountConfig{Type: "9p", Mode: os.FileMode(0700)},
want: []string{
"findmnt -T target | grep target && sudo umount target || true",
"[ \"x$(findmnt -T target | grep target)\" != \"x\" ] && { sudo fuser -km target; sudo umount target; } || echo ",
"sudo mkdir -m 700 -p target && sudo mount -t 9p -o dfltgid=0,dfltuid=0 src target",
},
},
......@@ -64,7 +64,7 @@ func TestMount(t *testing.T) {
target: "target",
cfg: &MountConfig{Type: "9p", Mode: os.FileMode(0700), UID: "docker", GID: "docker"},
want: []string{
"findmnt -T target | grep target && sudo umount target || true",
"[ \"x$(findmnt -T target | grep target)\" != \"x\" ] && { sudo fuser -km target; sudo umount target; } || echo ",
"sudo mkdir -m 700 -p target && sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker) src target",
},
},
......@@ -77,7 +77,7 @@ func TestMount(t *testing.T) {
"cache": "fscache",
}},
want: []string{
"findmnt -T /target | grep /target && sudo umount /target || true",
"[ \"x$(findmnt -T /target | grep /target)\" != \"x\" ] && { sudo fuser -km /target; sudo umount /target; } || echo ",
"sudo mkdir -m 777 -p /target && sudo mount -t 9p -o cache=fscache,dfltgid=72,dfltuid=82,noextend,version=9p2000.u 10.0.0.1 /target",
},
},
......@@ -89,7 +89,7 @@ func TestMount(t *testing.T) {
"version": "9p2000.L",
}},
want: []string{
"findmnt -T tgt | grep tgt && sudo umount tgt || true",
"[ \"x$(findmnt -T tgt | grep tgt)\" != \"x\" ] && { sudo fuser -km tgt; sudo umount tgt; } || echo ",
"sudo mkdir -m 700 -p tgt && sudo mount -t 9p -o dfltgid=0,dfltuid=0,version=9p2000.L src tgt",
},
},
......@@ -115,7 +115,7 @@ func TestUnmount(t *testing.T) {
t.Fatalf("Unmount(/mnt): %v", err)
}
want := []string{"findmnt -T /mnt | grep /mnt && sudo umount /mnt || true"}
want := []string{"[ \"x$(findmnt -T /mnt | grep /mnt)\" != \"x\" ] && { sudo fuser -km /mnt; sudo umount /mnt; } || echo "}
if diff := cmp.Diff(r.cmds, want); diff != "" {
t.Errorf("command diff (-want +got): %s", diff)
}
......
......@@ -30,6 +30,7 @@ type Config struct {
// MachineConfig contains the parameters used to start a cluster.
type MachineConfig struct {
KeepContext bool // used by start and profile command to or not to switch kubectl's current context
MinikubeISO string
Memory int
CPUs int
......
......@@ -165,7 +165,7 @@ var DefaultISOSHAURL = DefaultISOURL + SHASuffix
var DefaultKubernetesVersion = "v1.14.3"
// NewestKubernetesVersion is the newest Kubernetes version to test against
var NewestKubernetesVersion = "v1.14.3"
var NewestKubernetesVersion = "v1.15.0-beta.1"
// OldestKubernetesVersion is the oldest Kubernetes version to test against
var OldestKubernetesVersion = "v1.10.13"
......@@ -199,8 +199,6 @@ const (
KubeadmConfigFile = "/var/lib/kubeadm.yaml"
// DefaultCNIConfigPath is the path to the CNI configuration
DefaultCNIConfigPath = "/etc/cni/net.d/k8s.conf"
// DefaultRktNetConfigPath is the path to the rkt net configuration
DefaultRktNetConfigPath = "/etc/rkt/net.d/k8s.conf"
)
const (
......
......@@ -18,6 +18,7 @@ package none
import (
"fmt"
"os"
"github.com/docker/machine/libmachine/drivers"
"k8s.io/minikube/pkg/drivers/none"
......@@ -47,3 +48,13 @@ func createNoneHost(config cfg.MachineConfig) interface{} {
ContainerRuntime: config.ContainerRuntime,
})
}
// AutoOptions returns suggested extra options based on the current config
func AutoOptions() string {
// for more info see: https://github.com/kubernetes/minikube/issues/3511
f := "/run/systemd/resolve/resolv.conf"
if _, err := os.Stat(f); err != nil {
return ""
}
return fmt.Sprintf("kubelet.resolv-conf=%s", f)
}
......@@ -325,3 +325,16 @@ func UnsetCurrentContext(filename, machineName string) error {
}
return nil
}
//SetCurrentContext sets the kubectl's current-context
func SetCurrentContext(kubeCfgPath, name string) error {
kcfg, err := ReadConfigOrNew(kubeCfgPath)
if err != nil {
return errors.Wrap(err, "Error getting kubeconfig status")
}
kcfg.CurrentContext = name
if err := WriteConfig(kcfg, kubeCfgPath); err != nil {
return errors.Wrap(err, "writing kubeconfig")
}
return nil
}
......@@ -41,7 +41,7 @@ import (
var (
// ReasonableMutateTime is how long to wait for basic object mutations, such as deletions, to show up
ReasonableMutateTime = time.Minute * 1
ReasonableMutateTime = time.Minute * 2
// ReasonableStartTime is how long to wait for pods to start, considering dependency chains & slow networks.
ReasonableStartTime = time.Minute * 10
)
......
......@@ -32,6 +32,7 @@ import (
units "github.com/docker/go-units"
"github.com/golang/glog"
retryablehttp "github.com/hashicorp/go-retryablehttp"
"github.com/pkg/errors"
)
......@@ -130,7 +131,7 @@ func RetryAfter(attempts int, callback func() error, d time.Duration) (err error
// ParseSHAFromURL downloads and reads a SHA checksum from an URL
func ParseSHAFromURL(url string) (string, error) {
r, err := http.Get(url)
r, err := retryablehttp.Get(url)
if err != nil {
return "", errors.Wrap(err, "Error downloading checksum.")
} else if r.StatusCode != http.StatusOK {
......
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---
title = "minikube"
baseURL = "https://minikube.sigs.k8s.io"
languageCode = "en-us"
# code highlighting
pygmentsCodeFences = true
pygmentsCodefencesGuessSyntax = true
pygmentsUseClasses = true
# unused
disableKinds = ["taxonomy", "taxonomyTerm"]
themesDir = "themes"
theme = "hugo-whisper-theme"
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "Docs"
url = "/docs/"
weight = 2
[params]
google_analytics_id=""
homepage_button_link = '/docs'
homepage_button_text = 'Read The Docs'
homepage_intro = 'minikube implements a local Kubernetes cluster on macOS, Linux, and Windows.'
homepage_image = 'https://github.com/kubernetes/minikube/raw/master/images/start.jpg'
[params.homepage_meta_tags]
meta_description = "minikube desc"
meta_og_title = "minikube"
meta_og_type = "website"
meta_og_url = "https://minikube.sigs.k8s.io"
meta_og_image = "https://raw.githubusercontent.com/JugglerX/hugo-whisper-theme/master/images/tn.png"
[params.logo]
mobile = "https://github.com/kubernetes/minikube/raw/master/images/logo/logo.png"
standard = "https://github.com/kubernetes/minikube/raw/master/images/logo/logo.png"
---
title: "minikube"
date: 2019-06-15T09:19:25+08:00
draft: true
---
minikube implements a local Kubernetes cluster on macOS, Linux, and Windows.
This is just a test website.
{"Target":"css/style.css","MediaType":"text/css","Data":{}}
\ No newline at end of file
Subproject commit c679e0b497ad533a75fb4374d602cff91898b773
......@@ -32,6 +32,7 @@ import (
"time"
"github.com/docker/machine/libmachine/state"
retryablehttp "github.com/hashicorp/go-retryablehttp"
"k8s.io/apimachinery/pkg/labels"
pkgutil "k8s.io/minikube/pkg/util"
"k8s.io/minikube/test/integration/util"
......@@ -105,7 +106,7 @@ func testDashboard(t *testing.T) {
t.Errorf("got host %s, expected 127.0.0.1", host)
}
resp, err := http.Get(u.String())
resp, err := retryablehttp.Get(u.String())
if err != nil {
t.Fatalf("failed get: %v", err)
}
......
......@@ -31,6 +31,7 @@ import (
"net/url"
"github.com/elazarl/goproxy"
retryablehttp "github.com/hashicorp/go-retryablehttp"
"github.com/phayes/freeport"
"github.com/pkg/errors"
)
......@@ -148,7 +149,8 @@ func testProxyDashboard(t *testing.T) {
if err != nil {
t.Fatalf("failed to parse %q: %v", s, err)
}
resp, err := http.Get(u.String())
resp, err := retryablehttp.Get(u.String())
if err != nil {
t.Fatalf("failed get: %v", err)
}
......
......@@ -6,7 +6,7 @@ metadata:
integration-test: busybox-mount
spec:
containers:
- image: busybox:glibc
- image: busybox:1.28.4-glibc
command: [ "/bin/sh", "-c", "--" ]
args: [ "cat /mount-9p/fromhost; echo test > /mount-9p/frompod; rm /mount-9p/fromhostremove; echo test > /mount-9p/frompodremove;" ]
name: busybox
......
......@@ -6,7 +6,7 @@ metadata:
integration-test: busybox
spec:
containers:
- image: busybox:glibc
- image: busybox:1.28.4-glibc
command:
- sleep
- "3600"
......
......@@ -20,49 +20,59 @@ import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"runtime"
"testing"
"github.com/docker/machine/libmachine/state"
retryablehttp "github.com/hashicorp/go-retryablehttp"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/constants"
pkgutil "k8s.io/minikube/pkg/util"
)
func TestVersionUpgrade(t *testing.T) {
currentRunner := NewMinikubeRunner(t)
currentRunner.RunCommand("delete", true)
currentRunner.CheckStatus(state.None.String())
func downloadMinikubeBinary(version string) (*os.File, error) {
// Grab latest release binary
url := pkgutil.GetBinaryDownloadURL("latest", runtime.GOOS)
resp, err := http.Get(url)
url := pkgutil.GetBinaryDownloadURL(version, runtime.GOOS)
resp, err := retryablehttp.Get(url)
if err != nil {
t.Fatal(errors.Wrap(err, "Failed to get latest release binary"))
return nil, errors.Wrap(err, "Failed to get latest release binary")
}
defer resp.Body.Close()
tf, err := ioutil.TempFile("", "minikube")
if err != nil {
t.Fatal(errors.Wrap(err, "Failed to create binary file"))
return nil, errors.Wrap(err, "Failed to create binary file")
}
defer os.Remove(tf.Name())
_, err = io.Copy(tf, resp.Body)
if err != nil {
t.Fatal(errors.Wrap(err, "Failed to populate temp file"))
return nil, errors.Wrap(err, "Failed to populate temp file")
}
if err := tf.Close(); err != nil {
t.Fatal(errors.Wrap(err, "Failed to close temp file"))
return nil, errors.Wrap(err, "Failed to close temp file")
}
if runtime.GOOS != "windows" {
if err := os.Chmod(tf.Name(), 0700); err != nil {
t.Fatal(errors.Wrap(err, "Failed to make binary executable."))
return nil, err
// t.Fatal(errors.Wrap(err, "Failed to make binary executable."))
}
}
return tf, err
}
// TestVersionUpgrade downloads latest version of minikube and runs with
// the odlest supported k8s version and then runs the current head minikube
// and it tries to upgrade from the older supported k8s to news supported k8s
func TestVersionUpgrade(t *testing.T) {
currentRunner := NewMinikubeRunner(t)
currentRunner.RunCommand("delete", true)
currentRunner.CheckStatus(state.None.String())
tf, err := downloadMinikubeBinary("latest")
if err != nil || tf == nil {
t.Fatal(errors.Wrap(err, "Failed to download minikube binary."))
}
defer os.Remove(tf.Name())
releaseRunner := NewMinikubeRunner(t)
releaseRunner.BinaryPath = tf.Name()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册