Merge branch 'master' of github.com:kubernetes/minikube into gvisor-image

pull/4717/head
Priya Wadhwa 2019-07-11 12:43:42 -07:00
commit 1ec4012052
56 changed files with 714 additions and 278 deletions

View File

@ -1,4 +1,3 @@
Balint Pato <balintp@google.com> (@balopat)
Thomas Stromberg <tstromberg@google.com> (@tstromberg)
Anders F Björklund <anders.f.bjorklund@gmail.com> (@afbjorklund)
Sharif Elgamal <selgamal@google.com> (@sharifelgamal)

3
OWNERS
View File

@ -1,14 +1,12 @@
# See the OWNERS docs at https://go.k8s.io/owners
reviewers:
- balopat
- tstromberg
- afbjorklund
- sharifelgamal
- RA489
- medyagh
approvers:
- balopat
- tstromberg
- afbjorklund
- sharifelgamal
@ -18,3 +16,4 @@ emeritus_approvers:
- dlorenc
- luxas
- jimmidyson
- r2d4

View File

@ -10,5 +10,7 @@
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
# INSTRUCTIONS AT https://kubernetes.io/security/
dlorenc
gbraad
tstromberg
afbjorklund
medyagh
sharifelgamal

View File

@ -57,7 +57,7 @@ var addonsOpenCmd = &cobra.Command{
exit.Usage("usage: minikube addons open ADDON_NAME")
}
addonName := args[0]
//TODO(r2d4): config should not reference API, pull this out
// TODO(r2d4): config should not reference API, pull this out
api, err := machine.NewAPIClient()
if err != nil {
exit.WithError("Error getting client", err)

View File

@ -110,7 +110,7 @@ func EnableOrDisableAddon(name string, val string) error {
return errors.Wrapf(err, "parsing bool: %s", name)
}
//TODO(r2d4): config package should not reference API, pull this out
// TODO(r2d4): config package should not reference API, pull this out
api, err := machine.NewAPIClient()
if err != nil {
return errors.Wrap(err, "machine client")

View File

@ -36,7 +36,10 @@ import (
var kubectlCmd = &cobra.Command{
Use: "kubectl",
Short: "Run kubectl",
Long: `Run the kubernetes client, download it if necessary.`,
Long: `Run the kubernetes client, download it if necessary.
Examples:
minikube kubectl -- --help
kubectl get pods --namespace kube-system`,
Run: func(cmd *cobra.Command, args []string) {
api, err := machine.NewAPIClient()
if err != nil {

View File

@ -20,7 +20,6 @@ import (
"os"
"strings"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
core "k8s.io/api/core/v1"
"k8s.io/minikube/pkg/minikube/console"
@ -59,12 +58,7 @@ var serviceListCmd = &cobra.Command{
}
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Namespace", "Name", "URL"})
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")
table.AppendBulk(data) // Add Bulk Data
table.Render()
service.PrintServiceList(os.Stdout, data)
},
}

View File

@ -181,7 +181,7 @@ assumes you have already installed one of the VM drivers: virtualbox/parallels/v
// runStart handles the executes the flow of "minikube start"
func runStart(cmd *cobra.Command, args []string) {
console.OutStyle(console.Happy, "minikube %s on %s (%s)", version.GetVersion(), runtime.GOOS, runtime.GOARCH)
console.OutT(console.Happy, "minikube {{.version}} on {{.os}} ({{.arch}})", console.Arg{"version": version.GetVersion(), "os": runtime.GOOS, "arch": runtime.GOARCH})
validateConfig()
validateUser()
@ -239,7 +239,7 @@ func runStart(cmd *cobra.Command, args []string) {
// Bypass proxy for minikube's vm ip
err = proxy.ExcludeIP(ip)
if err != nil {
console.ErrStyle(console.FailureType, "Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,%s`.", ip)
console.ErrT(console.FailureType, "Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,{{.ip}}`.", console.Arg{"ip": ip})
}
// Save IP to configuration file for subsequent use
@ -297,7 +297,7 @@ func skipCache(config cfg.Config) {
func showVersionInfo(k8sVersion string, cr cruntime.Manager) {
version, _ := cr.Version()
console.OutStyle(cr.Style(), "Configuring environment for Kubernetes %s on %s %s", k8sVersion, cr.Name(), version)
console.OutT(cr.Style(), "Configuring environment for Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}}", console.Arg{"k8sVersion": k8sVersion, "runtime": cr.Name(), "runtimeVersion": version})
for _, v := range dockerOpt {
console.OutStyle(console.Option, "opt %s", v)
}
@ -308,9 +308,9 @@ func showVersionInfo(k8sVersion string, cr cruntime.Manager) {
func showKubectlConnectInfo(kubeconfig *pkgutil.KubeConfigSetup) {
if kubeconfig.KeepContext {
console.OutStyle(console.Kubectl, "To connect to this cluster, use: kubectl --context=%s", kubeconfig.ClusterName)
console.OutT(console.Kubectl, "To connect to this cluster, use: kubectl --context={{.name}}", console.Arg{"name": kubeconfig.ClusterName})
} else {
console.OutStyle(console.Ready, "Done! kubectl is now configured to use %q", cfg.GetMachineName())
console.OutT(console.Ready, "Done! kubectl is now configured to use {{.name}}", console.Arg{"name": cfg.GetMachineName()})
}
_, err := exec.LookPath("kubectl")
if err != nil {
@ -380,7 +380,7 @@ func validateUser() {
exit.Usage("Please run with sudo. the vm-driver %q requires sudo.", constants.DriverNone)
} else if u.Name == "root" && !(d == constants.DriverHyperv || d == constants.DriverNone) {
console.OutStyle(console.WarningType, "Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with %s driver.", d)
console.OutT(console.WarningType, "Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with {{.driver}} driver.", console.Arg{"driver": d})
}
} else {
@ -406,7 +406,7 @@ func validateConfig() {
exit.Usage("Requested memory allocation (%dMB) is less than the minimum allowed of %dMB", memorySizeMB, pkgutil.CalculateSizeInMB(constants.MinimumMemorySize))
}
if memorySizeMB < pkgutil.CalculateSizeInMB(constants.DefaultMemorySize) {
console.OutStyle(console.Notice, "Requested memory allocation (%dMB) is less than the default memory allocation of (%dMB). Beware that Minikube might not work correctly or crash unexpectedly.", memorySizeMB, pkgutil.CalculateSizeInMB(constants.DefaultMemorySize))
console.OutT(console.Notice, "Requested memory allocation ({{.memory}}MB) is less than the default memory allocation of {{.default}}MB. Beware that minikube might not work correctly or crash unexpectedly.", console.Arg{"memory": memorySizeMB, "default": pkgutil.CalculateSizeInMB(constants.DefaultMemorySize)})
}
// check that kubeadm extra args contain only whitelisted parameters
@ -421,7 +421,7 @@ func validateConfig() {
}
// This function validates if the --registry-mirror
//args match the format of http://localhost
// args match the format of http://localhost
func validateRegistryMirror() {
if len(registryMirror) > 0 {
@ -515,7 +515,7 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
}
if repository != "" {
console.OutStyle(console.SuccessType, "using image repository %s", repository)
console.OutT(console.SuccessType, "Using image repository {{.name}}", console.Arg{"name": repository})
}
cfg := cfg.Config{
@ -686,11 +686,11 @@ func validateKubernetesVersions(old *cfg.Config) (string, bool) {
if nvs.LT(ovs) {
nv = version.VersionPrefix + ovs.String()
console.ErrStyle(console.Conflict, "Kubernetes downgrade is not supported, will continue to use %v", nv)
console.ErrT(console.Conflict, "Kubernetes downgrade is not supported, will continue to use {{.version}}", console.Arg{"version": nv})
return nv, isUpgrade
}
if nvs.GT(ovs) {
console.OutStyle(console.ThumbsUp, "minikube will upgrade the local cluster from Kubernetes %s to %s", ovs, nvs)
console.OutT(console.ThumbsUp, "minikube will upgrade the local cluster from Kubernetes {{.old}} to {{.new}}", console.Arg{"old": ovs, "new": nvs})
isUpgrade = true
}
return nv, isUpgrade
@ -751,7 +751,11 @@ func configureRuntimes(runner cruntime.CommandRunner) cruntime.Manager {
exit.WithError(fmt.Sprintf("Failed runtime for %+v", config), err)
}
err = cr.Enable()
disableOthers := true
if viper.GetString(vmDriver) == constants.DriverNone {
disableOthers = false
}
err = cr.Enable(disableOthers)
if err != nil {
exit.WithError("Failed to enable container runtime", err)
}
@ -767,12 +771,12 @@ func bootstrapCluster(bs bootstrapper.Bootstrapper, r cruntime.Manager, runner c
if isUpgrade || !preexisting {
console.OutStyle(console.Pulling, "Pulling images ...")
if err := bs.PullImages(kc); err != nil {
console.OutStyle(console.FailureType, "Unable to pull images, which may be OK: %v", err)
console.OutT(console.FailureType, "Unable to pull images, which may be OK: {{.error}}", console.Arg{"error": err})
}
}
if preexisting {
console.OutStyle(console.Restarting, "Relaunching Kubernetes %s using %s ... ", kc.KubernetesVersion, bsName)
console.OutT(console.Restarting, "Relaunching Kubernetes {{.version}} using {{.bootstrapper}} ... ", console.Arg{"version": kc.KubernetesVersion, "bootstrapper": bsName})
if err := bs.RestartCluster(kc); err != nil {
exit.WithLogEntries("Error restarting cluster", err, logs.FindProblems(r, bs, runner))
}
@ -791,7 +795,7 @@ func configureMounts() {
return
}
console.OutStyle(console.Mounting, "Creating mount %s ...", viper.GetString(mountString))
console.OutT(console.Mounting, "Creating mount {{.name}} ...", console.Arg{"name": viper.GetString(mountString)})
path := os.Args[0]
mountDebugVal := 0
if glog.V(8) {

View File

@ -18,47 +18,28 @@ package cmd
import (
"os"
"text/template"
"github.com/docker/machine/libmachine/state"
"github.com/golang/glog"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
"github.com/spf13/viper"
cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config"
"k8s.io/minikube/cmd/util"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
pkg_config "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
pkgutil "k8s.io/minikube/pkg/util"
)
var statusFormat string
// Status represents the status
type Status struct {
Host string
Kubelet string
APIServer string
Kubeconfig string
}
const (
minikubeNotRunningStatusFlag = 1 << 0
clusterNotRunningStatusFlag = 1 << 1
k8sNotRunningStatusFlag = 1 << 2
)
// statusCmd represents the status command
var statusCmd = &cobra.Command{
Use: "status",
Short: "Gets the status of a local kubernetes cluster",
Long: `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)`,
Long: `Gets the status of a local kubernetes cluster.`,
Run: func(cmd *cobra.Command, args []string) {
var returnCode = 0
api, err := machine.NewAPIClient()
if err != nil {
exit.WithCode(exit.Unavailable, "Error getting client: %v", err)
@ -79,12 +60,10 @@ var statusCmd = &cobra.Command{
if err != nil {
exit.WithError("Error getting bootstrapper", err)
}
kubeletSt, err = clusterBootstrapper.GetKubeletStatus()
if err != nil {
glog.Warningf("kubelet err: %v", err)
returnCode |= clusterNotRunningStatusFlag
} else if kubeletSt != state.Running.String() {
returnCode |= clusterNotRunningStatusFlag
}
ip, err := cluster.GetHostDriverIP(api, config.GetMachineName())
@ -101,47 +80,34 @@ var statusCmd = &cobra.Command{
apiserverSt, err = clusterBootstrapper.GetAPIServerStatus(ip, apiserverPort)
if err != nil {
glog.Errorln("Error apiserver status:", err)
} else if apiserverSt != state.Running.String() {
returnCode |= clusterNotRunningStatusFlag
}
ks, err := pkgutil.GetKubeConfigStatus(ip, util.GetKubeConfigPath(), config.GetMachineName())
if err != nil {
glog.Errorln("Error kubeconfig status:", err)
}
if ks {
kubeconfigSt = "Correctly Configured: pointing to minikube-vm at " + ip.String()
} else {
kubeconfigSt = "Misconfigured: pointing to stale minikube-vm." +
"\nTo fix the kubectl context, run minikube update-context"
returnCode |= k8sNotRunningStatusFlag
}
} else {
returnCode |= minikubeNotRunningStatusFlag
}
status := Status{
Host: hostSt,
Kubelet: kubeletSt,
APIServer: apiserverSt,
Kubeconfig: kubeconfigSt,
}
tmpl, err := template.New("status").Parse(statusFormat)
if err != nil {
exit.WithError("Error creating status template", err)
}
err = tmpl.Execute(os.Stdout, status)
if err != nil {
exit.WithError("Error executing status template", err)
}
var data [][]string
data = append(data, []string{pkg_config.GetMachineName(), hostSt, kubeletSt, apiserverSt, kubeconfigSt})
os.Exit(returnCode)
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Profile", "Host", "Kubelet", "APIServer", "Kubectl"})
table.SetAutoFormatHeaders(false)
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")
table.AppendBulk(data) // Add Bulk Data
table.Render()
},
}
func init() {
statusCmd.Flags().StringVar(&statusFormat, "format", constants.DefaultStatusFormat,
`Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status`)
RootCmd.AddCommand(statusCmd)
}

View File

@ -81,6 +81,7 @@ func runStop(cmd *cobra.Command, args []string) {
exit.WithError("update config", err)
}
}
func init() {
RootCmd.AddCommand(stopCmd)
}

View File

@ -59,10 +59,10 @@ var tunnelCmd = &cobra.Command{
}
glog.Infof("Creating k8s client...")
//Tunnel uses the k8s clientset to query the API server for services in the LoadBalancerEmulator.
//We define the tunnel and minikube error free if the API server responds within a second.
//This also contributes to better UX, the tunnel status check can happen every second and
//doesn't hang on the API server call during startup and shutdown time or if there is a temporary error.
// Tunnel uses the k8s clientset to query the API server for services in the LoadBalancerEmulator.
// We define the tunnel and minikube error free if the API server responds within a second.
// This also contributes to better UX, the tunnel status check can happen every second and
// doesn't hang on the API server call during startup and shutdown time or if there is a temporary error.
clientset, err := service.K8s.GetClientset(1 * time.Second)
if err != nil {
exit.WithError("error creating clientset", err)

View File

@ -1,2 +1,3 @@
sha256 8565a655345f3db2f7b78b77a2cd3103895229aa44cd0e4c710ba3559e344b5a v1.2.0.tar.gz
sha256 b92819bde71de947329814a3c649b8adb106cc03be16aae217b94297f4b843a1 v1.2.5.tar.gz
sha256 f2d578b743fb9faa5b3477b7cf4b33d00501087043a53b27754f14bbe741f891 v1.2.6.tar.gz

View File

@ -3,8 +3,8 @@
# containerd
#
################################################################################
CONTAINERD_BIN_VERSION = v1.2.5
CONTAINERD_BIN_COMMIT = bb71b10fd8f58240ca47fbb579b9d1028eea7c84
CONTAINERD_BIN_VERSION = v1.2.6
CONTAINERD_BIN_COMMIT = 894b81a4b802e4eb2a91d1ce216b8817763c29fb
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

@ -10,3 +10,4 @@ sha256 a979d9a952fae474886c7588da692ee00684cb2421d2c633c7ed415948cf0b10 docker-
sha256 346f9394393ee8db5f8bd1e229ee9d90e5b36931bdd754308b2ae68884dd6822 docker-18.06.3-ce.tgz
sha256 99ca9395e9c7ffbf75537de71aa828761f492491d02bc6e29db2920fa582c6c5 docker-18.09.5.tgz
sha256 1f3f6774117765279fce64ee7f76abbb5f260264548cf80631d68fb2d795bb09 docker-18.09.6.tgz
sha256 e106ccfa2b1f60794faaa6bae57a2dac9dc4cb33e5541fad6a826ea525d01cc4 docker-18.09.7.tgz

View File

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

View File

@ -4,3 +4,4 @@ sha256 9318fa9de6e3b2c89760f08d73bf718c97c93d683611716e024d2f3283c96d90 c1e454b2
sha256 a960decadf6bd5d3cee1ca7b94455d37cc921c964061428bd9f3dd17a13c8bb3 6635b4f0c6af3810594d2770f662f34ddc15b40d.tar.gz
sha256 ad41ae930059fef18de1926cd78e00474c89290248fecdcc0e431c8aefee1deb 0a012df867a2d525f62a146d8ebdf2e6ab8a5ad5.tar.gz
sha256 e52c5d7365b2b9048f977bac8f06bf626dccb4d816d0947ec8523f543272f4ff 2b18fe1d885ee5083ef9f0838fee39b62d653e30.tar.gz
sha256 257ac2c2bbc9770998f31b73f587718848ebb09465ce2cd20fbac198ebd5726e 425e105d5a03fabd737a126ad93d62a9eeede87f.tar.gz

View File

@ -4,8 +4,8 @@
#
################################################################################
# HEAD as of 2019-03-07
RUNC_MASTER_VERSION = 2b18fe1d885ee5083ef9f0838fee39b62d653e30
# HEAD as of 2019-04-25
RUNC_MASTER_VERSION = 425e105d5a03fabd737a126ad93d62a9eeede87f
RUNC_MASTER_SITE = https://github.com/opencontainers/runc/archive
RUNC_MASTER_SOURCE = $(RUNC_MASTER_VERSION).tar.gz
RUNC_MASTER_LICENSE = Apache-2.0

341
docs/cli_commands.md Normal file
View File

@ -0,0 +1,341 @@
# minikube CLI Commands
This document serves as a reference to all the commands, flags and their accepted arguments
## Global Flags
These flags can be used globally with any command on the CLI. Following are the global flags -
```
--alsologtostderr log to standard error as well as files
-b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (default "kubeadm")
-h, --help help for minikube
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files
-p, --profile string The name of the minikube VM being used.
This can be modified to allow for multiple minikube instances to be run independently (default "minikube")
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
## Commands
In this section, all commands which are accepted by the `minikube` CLI are described. To get help about any command, you can also type in `minikube help <command>`
---
### addons
**Description -** Modifies minikube addons files using subcommands like `minikube addons enable heapster`
**Usage -**
```
minikube addons SUBCOMMAND [flags]
minikube addons [command]
```
**Available Subcommands -**
```
configure Configures the addon w/ADDON_NAME within minikube (example: minikube addons configure registry-creds). For a list of available addons use: minikube addons list
disable Disables the addon w/ADDON_NAME within minikube (example: minikube addons disable dashboard). For a list of available addons use: minikube addons list
enable Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable dashboard). For a list of available addons use: minikube addons list
list Lists all available minikube addons as well as their current statuses (enabled/disabled)
open Opens the addon w/ADDON_NAME within minikube (example: minikube addons open dashboard). For a list of available addons use: minikube addons list
```
---
### cache
**Description -** Add or delete an image from the local cache.
**Usage -** `minikube cache [command]`
**Available Subcommands-**
```
add Add an image to local cache.
delete Delete an image from the local cache.
list List all available images from the local cache.
```
---
### completion
**Description -**
> Outputs minikube shell completion for the given shell (bash or zsh)
>
> This depends on the bash-completion binary. Example installation instructions:
> OS X:
> $ brew install bash-completion
> $ source $(brew --prefix)/etc/bash_completion
> $ minikube completion bash > ~/.minikube-completion # for bash users
> $ minikube completion zsh > ~/.minikube-completion # for zsh users
> $ source ~/.minikube-completion
> Ubuntu:
> $ apt-get install bash-completion
> $ source /etc/bash-completion
> $ source <(minikube completion bash) # for bash users
> $ source <(minikube completion zsh) # for zsh users
>
> Additionally, you may want to output the completion to a file and source in your .bashrc
>
> Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2
**Usage -** `minikube completion SHELL`
---
### config
**Description -** config modifies minikube config files using subcommands like `minikube config set vm-driver kvm`
Configurable fields:
* vm-driver
* feature-gates
* v
* cpus
* disk-size
* host-only-cidr
* memory
* log_dir
* kubernetes-version
* iso-url
* WantUpdateNotification
* ReminderWaitPeriodInHours
* WantReportError
* WantReportErrorPrompt
* WantKubectlDownloadMsg
* WantNoneDriverWarning
* profile
* bootstrapper
* ShowDriverDeprecationNotification
* ShowBootstrapperDeprecationNotification
* dashboard
* addon-manager
* default-storageclass
* heapster
* efk
* ingress
* registry
* registry-creds
* freshpod
* default-storageclass
* storage-provisioner
* storage-provisioner-gluster
* metrics-server
* nvidia-driver-installer
* nvidia-gpu-device-plugin
* logviewer
* gvisor
* hyperv-virtual-switch
* disable-driver-mounts
* cache
* embed-certs
**Usage -**
```
minikube config SUBCOMMAND [flags]
minikube config [command]
```
**Available Subcommands-**
```
get Gets the value of PROPERTY_NAME from the minikube config file
set Sets an individual value in a minikube config file
unset unsets an individual value in a minikube config file
view Display values currently set in the minikube config file
```
---
### dashboard
**Description -** Access the kubernetes dashboard running within the minikube cluster
**Usage -** `minikube dashboard [flags]`
**Available Flags -**
```
-h, --help help for dashboard
--url Display dashboard URL instead of opening a browser
```
---
### delete
**Description -** Deletes a local kubernetes cluster. This command deletes the VM, and removes all
associated files.
**Usage -** `minikube delete`
---
### docker-env
**Description -** Sets up docker env variables; similar to '$(docker-machine env)'.
**Usage -** `minikube docker-env [flags]`
**Available Flags -**
```
-h, --help help for docker-env
--no-proxy Add machine IP to NO_PROXY environment variable
--shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect
-u, --unset Unset variables instead of setting them
```
---
### help
**Description -** Help provides help for any command in the application. Simply type minikube help [path to command] for full details.
**Usage -** `minikube help [command] [flags]`
---
### ip
**Description -** Retrieves the IP address of the running cluster, and writes it to STDOUT.
**Usage -** `minikube ip`
---
### kubectl
**Description -** Run the kubernetes client, download it if necessary.
**Usage -** `minikube kubectl`
---
### logs
**Description -** Gets the logs of the running instance, used for debugging minikube, not user code.
**Usage -** `minikube logs [flags]`
**Available Flags -**
```
-f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.
-h, --help help for logs
-n, --length int Number of lines back to go within the log (default 50)
--problems Show only log entries which point to known problems
```
---
### mount
**Description -** Mounts the specified directory into minikube.
**Usage -** `minikube mount [flags] <source directory>:<target directory>`
**Available Flags -**
```
--9p-version string Specify the 9p version that the mount should use (default "9p2000.L")
--gid string Default group id used for the mount (default "docker")
-h, --help help for mount
--ip string Specify the ip that the mount should be setup on
--kill Kill the mount process spawned by minikube start
--mode uint File permissions used for the mount (default 493)
--msize int The number of bytes to use for 9p packet payload (default 262144)
--options strings Additional mount options, such as cache=fscache
--type string Specify the mount filesystem type (supported types: 9p) (default "9p")
--uid string Default user id used for the mount (default "docker")
```
---
### profile
**Description -** 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`
**Usage -**
```
minikube profile [MINIKUBE_PROFILE_NAME]. You can return to the default minikube profile by running `minikube profile default` [flags]
```
---
### service
**Description -** Gets the kubernetes URL(s) for the specified service in your local cluster. In the case of multiple URLs they will be printed one at a time.
**Usage -**
```
minikube service [flags] SERVICE
minikube service [command]
```
**Available Commands -**
```
list Lists the URLs for the services in your local cluster
```
**Available Flags -**
```
--format string Format to output service URL in. This format will be applied to each url individually and they will be printed one at a time. (default "http://{{.IP}}:{{.Port}}")
-h, --help help for service
--https Open the service URL with https instead of http
--interval int The time interval for each check that wait performs in seconds (default 20)
-n, --namespace string The service namespace (default "default")
--url Display the kubernetes service URL in the CLI instead of opening it in the default browser
--wait int Amount of time to wait for a service in seconds (default 20)
```
---
### ssh
**Description -** Log into or run a command on a machine with SSH; similar to 'docker-machine ssh'.
**Usage -** `minikube ssh`
---
### ssh-key
**Description -** Retrieve the ssh identity key path of the specified cluster.
**Usage -** `minikube ssh-key`
---
### start
**Description -** Starts a local kubernetes cluster using VM. This command assumes you have already installed one of the VM drivers: **virtualbox/parallels/vmwarefusion/kvm/xhyve/hyperv**.
**Usage -** `minikube start [flags]`
**Available Flags -**
```
--apiserver-ips ipSlice A set of apiserver IP Addresses which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default [])
--apiserver-name string The apiserver name which is used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine (default "minikubeCA")
--apiserver-names stringArray A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine
--apiserver-port int The apiserver listening port (default 8443)
--cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --vm-driver=none. (default true)
--container-runtime string The container runtime to be used (docker, crio, containerd) (default "docker")
--cpus int Number of CPUs allocated to the minikube VM (default 2)
--cri-socket string The cri socket path to be used
--disable-driver-mounts Disables the filesystem mounts provided by the hypervisors (vboxfs, xhyve-9p)
--disk-size string Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g) (default "20000mb")
--dns-domain string The cluster dns domain name used in the kubernetes cluster (default "cluster.local")
--docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value)
--docker-opt stringArray Specify arbitrary flags to pass to the Docker daemon. (format: key=value)
--download-only If true, only download and cache files for later use - don't install or start anything.
--enable-default-cni Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with "--network-plugin=cni"
--extra-config ExtraOption 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.
Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
Valid kubeadm parameters: ignore-preflight-errors, dry-run, kubeconfig, kubeconfig-dir, node-name, cri-socket, experimental-upload-certs, certificate-key, rootfs, pod-network-cidr
--feature-gates string A set of key=value pairs that describe feature gates for alpha/experimental features.
--gpu Enable experimental NVIDIA GPU support in minikube (works only with kvm2 driver on Linux)
-h, --help help for start
--hidden Hide the hypervisor signature from the guest in minikube (works only with kvm2 driver on Linux)
--host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24")
--hyperkit-vpnkit-sock string Location of the VPNKit socket used for networking. If empty, disables Hyperkit VPNKitSock, if 'auto' uses Docker for Mac VPNKit connection, otherwise uses the specified VSock.
--hyperkit-vsock-ports strings List of guest VSock ports that should be exposed as sockets on the host (Only supported on with hyperkit now).
--hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)
--image-mirror-country string Country code of the image mirror to be used. Leave empty to use the global one. For Chinese mainland users, set it to cn
--image-repository string Alternative image repository to pull docker images from. This can be used when you have limited access to gcr.io. Set it to "auto" to let minikube decide one for you. For Chinese mainland users, you may use local gcr.io mirrors such as registry.cn-hangzhou.aliyuncs.com/google_containers
--insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.
--iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso")
--keep-context This will keep the existing kubectl context and will create a minikube context.
--kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3) (default "v1.15.0")
--kvm-network string The KVM network name. (only supported with KVM driver) (default "default")
--memory string Amount of RAM allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g) (default "2000mb")
--mount This will start the mount daemon and automatically mount files into minikube
--mount-string string The argument to pass the minikube mount command on start (default "C:\\Users\\Pranav.Jituri:/minikube-host")
--network-plugin string The name of the network plugin
--nfs-share strings Local folders to share with Guest via NFS mounts (Only supported on with hyperkit now)
--nfs-shares-root string Where to root the NFS Shares (defaults to /nfsshares, only supported with hyperkit now) (default "/nfsshares")
--no-vtx-check Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)
--registry-mirror strings Registry mirrors to pass to the Docker daemon
--service-cluster-ip-range string The CIDR to be used for service cluster IPs. (default "10.96.0.0/12")
--uuid string Provide VM UUID to restore MAC address (only supported with Hyperkit driver).
--vm-driver string VM driver is one of: [virtualbox parallels vmwarefusion kvm xhyve hyperv hyperkit kvm2 vmware none] (default "virtualbox")
--xhyve-disk-driver string The disk driver to use [ahci-hd|virtio-blk] (only supported with xhyve driver) (default "ahci-hd")
```
---
### status
**Description -** 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)
**Usage -** `minikube status [flags]`
**Available Flags -**
```
--format string Go template format string for the status output. The format for Go templates can be found here: https://golang.org/pkg/text/template/
For the list accessible variables for the template, see the struct values here: https://godoc.org/k8s.io/minikube/cmd/minikube/cmd#Status (default "host: {{.Host}}\nkubelet: {{.Kubelet}}\napiserver: {{.APIServer}}\nkubectl: {{.Kubeconfig}}\n")
```
---
### stop
**Description -** Stops a local kubernetes cluster running in Virtualbox. This command stops the VM
itself, leaving all files intact. The cluster can be started again with the `start` command.
**Usage -** `minikube stop`
---
### tunnel
**Description -** Creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP
**Usage -** `minikube tunnel [flags]`
**Available Flags -**
```
-c, --cleanup call with cleanup=true to remove old tunnels
```
---
### update-check
**Description -** Print current and latest version number.
**Usage -** `minikube update-check`
---
### update-context
**Description -** Retrieves the IP address of the running cluster, checks it with IP in kubeconfig, and corrects kubeconfig if incorrect.
**Usage -** `minikube update-context`
---
### version
**Description -** Print the version of minikube.
**Usage -** `minikube version`

View File

@ -194,15 +194,15 @@ func (d *Driver) deleteNetwork() error {
func (d *Driver) checkDomains(conn *libvirt.Connect) error {
type source struct {
//XMLName xml.Name `xml:"source"`
// XMLName xml.Name `xml:"source"`
Network string `xml:"network,attr"`
}
type iface struct {
//XMLName xml.Name `xml:"interface"`
// XMLName xml.Name `xml:"interface"`
Source source `xml:"source"`
}
type result struct {
//XMLName xml.Name `xml:"domain"`
// XMLName xml.Name `xml:"domain"`
Name string `xml:"name"`
Interfaces []iface `xml:"devices>interface"`
}

View File

@ -231,7 +231,7 @@ func (k *Bootstrapper) StartCluster(k8s config.KubernetesConfig) error {
}
if version.LT(semver.MustParse("1.10.0-alpha.0")) {
//TODO(r2d4): get rid of global here
// TODO(r2d4): get rid of global here
master = k8s.NodeName
if err := util.RetryAfter(200, unmarkMaster, time.Second*1); err != nil {
return errors.Wrap(err, "timed out waiting to unmark master")

View File

@ -58,9 +58,9 @@ var (
maxClockDesyncSeconds = 2.1
)
//This init function is used to set the logtostderr variable to false so that INFO level log info does not clutter the CLI
//INFO lvl logging is displayed due to the kubernetes api calling flag.Set("logtostderr", "true") in its init()
//see: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/util/logs/logs.go#L32-L34
// This init function is used to set the logtostderr variable to false so that INFO level log info does not clutter the CLI
// INFO lvl logging is displayed due to the kubernetes api calling flag.Set("logtostderr", "true") in its init()
// see: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/util/logs/logs.go#L32-L34
func init() {
if err := flag.Set("logtostderr", "false"); err != nil {
exit.WithError("unable to set logtostderr", err)

View File

@ -26,8 +26,6 @@ import (
"github.com/golang/glog"
isatty "github.com/mattn/go-isatty"
"golang.org/x/text/message"
"k8s.io/minikube/pkg/minikube/translate"
)
// By design, this package uses global references to language and output objects, in preference
@ -59,24 +57,27 @@ type fdWriter interface {
Fd() uintptr
}
// Arg is a convenience wrapper for templating
type Arg map[string]interface{}
// OutStyle writes a stylized and formatted message to stdout
func OutStyle(style StyleEnum, format string, a ...interface{}) {
outStyled := applyStyle(style, useColor, format, a...)
outStyled := applyStyle(style, useColor, format)
Out(outStyled, a...)
}
// escape any outstanding '%' signs so that they don't get interpreted
// as a formatting directive down the line
outStyled = strings.Replace(outStyled, "%", "%%", -1)
func OutT(style StyleEnum, format string, a map[string]interface{}) {
outStyled := applyTemplateFormatting(style, useColor, format, a)
Out(outStyled)
}
// Out writes a basic formatted string to stdout
func Out(format string, a ...interface{}) {
p := message.NewPrinter(translate.GetPreferredLanguage())
if outFile == nil {
glog.Warningf("[unset outFile]: %s", fmt.Sprintf(format, a...))
return
}
_, err := p.Fprintf(outFile, format, a...)
_, err := fmt.Fprintf(outFile, format, a...)
if err != nil {
glog.Errorf("Fprintf failed: %v", err)
}
@ -89,22 +90,22 @@ func OutLn(format string, a ...interface{}) {
// ErrStyle writes a stylized and formatted error message to stderr
func ErrStyle(style StyleEnum, format string, a ...interface{}) {
format = applyStyle(style, useColor, format, a...)
errStyled := applyStyle(style, useColor, format)
Err(errStyled, a...)
}
// escape any outstanding '%' signs so that they don't get interpreted
// as a formatting directive down the line
format = strings.Replace(format, "%", "%%", -1)
Err(format)
func ErrT(style StyleEnum, format string, a map[string]interface{}) {
errStyled := applyTemplateFormatting(style, useColor, format, a)
Err(errStyled)
}
// Err writes a basic formatted string to stderr
func Err(format string, a ...interface{}) {
p := message.NewPrinter(translate.GetPreferredLanguage())
if errFile == nil {
glog.Errorf("[unset errFile]: %s", fmt.Sprintf(format, a...))
return
}
_, err := p.Fprintf(errFile, format, a...)
_, err := fmt.Fprintf(errFile, format, a...)
if err != nil {
glog.Errorf("Fprint failed: %v", err)
}

View File

@ -22,13 +22,18 @@ import (
"strconv"
"testing"
"golang.org/x/text/language"
"golang.org/x/text/message"
"k8s.io/minikube/pkg/minikube/tests"
"k8s.io/minikube/pkg/minikube/translate"
)
func TestOutStyle(t *testing.T) {
// Set the system locale to Arabic and define a dummy translation file.
if err := translate.SetPreferredLanguage("ar"); err != nil {
t.Fatalf("SetPreferredLanguage: %v", err)
}
translate.Translations = map[string]interface{}{
"Installing Kubernetes version %s ...": "... %s تثبيت Kubernetes الإصدار",
}
var testCases = []struct {
style StyleEnum
@ -44,6 +49,7 @@ func TestOutStyle(t *testing.T) {
{WaitingPods, "wait", nil, "⌛ wait", "* wait"},
{Issue, "http://i/%d", []interface{}{10000}, " ▪ http://i/10000\n", " - http://i/10000\n"},
{Usage, "raw: %s %s", []interface{}{"'%'", "%d"}, "💡 raw: '%' %d\n", "* raw: '%' %d\n"},
{Running, "Installing Kubernetes version %s ...", []interface{}{"v1.13"}, "🏃 ... v1.13 تثبيت Kubernetes الإصدار\n", "* ... v1.13 تثبيت Kubernetes الإصدار\n"},
}
for _, tc := range testCases {
for _, override := range []bool{true, false} {
@ -66,34 +72,74 @@ func TestOutStyle(t *testing.T) {
}
}
func TestOut(t *testing.T) {
os.Setenv(OverrideEnv, "")
// An example translation just to assert that this code path is executed.
err := message.SetString(language.Arabic, "Installing Kubernetes version %s ...", "... %s تثبيت Kubernetes الإصدار")
if err != nil {
t.Fatalf("setstring: %v", err)
func TestOutT(t *testing.T) {
// Set the system locale to Arabic and define a dummy translation file.
if err := translate.SetPreferredLanguage("ar"); err != nil {
t.Fatalf("SetPreferredLanguage: %v", err)
}
translate.Translations = map[string]interface{}{
"Installing Kubernetes version {{.version}} ...": "... {{.version}} تثبيت Kubernetes الإصدار",
}
var testCases = []struct {
style StyleEnum
message string
params Arg
want string
wantASCII string
}{
{Happy, "Happy", nil, "😄 Happy\n", "* Happy\n"},
{Option, "Option", nil, " ▪ Option\n", " - Option\n"},
{WarningType, "Warning", nil, "⚠️ Warning\n", "! Warning\n"},
{FatalType, "Fatal: {{.error}}", Arg{"error": "ugh"}, "💣 Fatal: ugh\n", "X Fatal: ugh\n"},
{WaitingPods, "wait", nil, "⌛ wait", "* wait"},
{Issue, "http://i/{{.number}}", Arg{"number": 10000}, " ▪ http://i/10000\n", " - http://i/10000\n"},
{Usage, "raw: {{.one}} {{.two}}", Arg{"one": "'%'", "two": "%d"}, "💡 raw: '%' %d\n", "* raw: '%' %d\n"},
{Running, "Installing Kubernetes version {{.version}} ...", Arg{"version": "v1.13"}, "🏃 ... v1.13 تثبيت Kubernetes الإصدار\n", "* ... v1.13 تثبيت Kubernetes الإصدار\n"},
}
for _, tc := range testCases {
for _, override := range []bool{true, false} {
t.Run(fmt.Sprintf("%s-override-%v", tc.message, override), func(t *testing.T) {
// Set MINIKUBE_IN_STYLE=<override>
os.Setenv(OverrideEnv, strconv.FormatBool(override))
f := tests.NewFakeFile()
SetOutFile(f)
OutT(tc.style, tc.message, tc.params)
got := f.String()
want := tc.wantASCII
if override {
want = tc.want
}
if got != want {
t.Errorf("OutStyle() = %q (%d runes), want %q (%d runes)", got, len(got), want, len(want))
}
})
}
}
}
func TestOut(t *testing.T) {
os.Setenv(OverrideEnv, "")
var testCases = []struct {
format string
lang string
arg interface{}
want string
}{
{format: "xyz123", want: "xyz123"},
{format: "Installing Kubernetes version %s ...", lang: "ar", arg: "v1.13", want: "... v1.13 تثبيت Kubernetes الإصدار"},
{format: "Installing Kubernetes version %s ...", lang: "en-us", arg: "v1.13", want: "Installing Kubernetes version v1.13 ..."},
{format: "Installing Kubernetes version %s ...", arg: "v1.13", want: "Installing Kubernetes version v1.13 ..."},
{format: "Parameter encoding: %s", arg: "%s%%%d", want: "Parameter encoding: %s%%%d"},
}
for _, tc := range testCases {
t.Run(tc.format, func(t *testing.T) {
if err := translate.SetPreferredLanguage(tc.lang); err != nil {
t.Errorf("unexpected error: %q", err)
}
f := tests.NewFakeFile()
SetOutFile(f)
ErrLn("unrelated message")
Out(tc.format, tc.arg)
if tc.arg == nil {
Out(tc.format)
} else {
Out(tc.format, tc.arg)
}
got := f.String()
if got != tc.want {
t.Errorf("Out(%s, %s) = %q, want %q", tc.format, tc.arg, got, tc.want)
@ -127,34 +173,3 @@ func TestErrStyle(t *testing.T) {
t.Errorf("ErrStyle() = %q, want %q", got, want)
}
}
func TestSetPreferredLanguage(t *testing.T) {
os.Setenv(OverrideEnv, "0")
var tests = []struct {
input string
want language.Tag
}{
{"", language.AmericanEnglish},
{"C", language.AmericanEnglish},
{"zh", language.Chinese},
{"fr_FR.utf8", language.French},
}
for _, tc := range tests {
t.Run(tc.input, func(t *testing.T) {
// Set something so that we can assert change.
if err := translate.SetPreferredLanguage("is"); err != nil {
t.Errorf("unexpected error: %q", err)
}
if err := translate.SetPreferredLanguage(tc.input); err != nil {
t.Errorf("unexpected error: %q", err)
}
want, _ := tc.want.Base()
got, _ := translate.GetPreferredLanguage().Base()
if got != want {
t.Errorf("SetPreferredLanguage(%s) = %q, want %q", tc.input, got, want)
}
})
}
}

View File

@ -17,10 +17,11 @@ limitations under the License.
package console
import (
"bytes"
"strings"
"text/template"
"golang.org/x/text/message"
"golang.org/x/text/number"
"github.com/golang/glog"
"k8s.io/minikube/pkg/minikube/translate"
)
@ -130,29 +131,46 @@ func lowPrefix(s style) string {
return lowBullet
}
// Apply styling to a format string
func applyStyle(style StyleEnum, useColor bool, format string, a ...interface{}) string {
p := message.NewPrinter(translate.GetPreferredLanguage())
for i, x := range a {
if _, ok := x.(int); ok {
a[i] = number.Decimal(x, number.NoSeparator())
}
}
// applyStyle translates the given string if necessary then adds any appropriate style prefix.
func applyStyle(style StyleEnum, useColor bool, format string) string {
format = translate.T(format)
out := p.Sprintf(format, a...)
s, ok := styles[style]
if !s.OmitNewline {
out += "\n"
format += "\n"
}
// Similar to CSS styles, if no style matches, output an unformatted string.
if !ok {
return p.Sprintf(format, a...)
return format
}
if !useColor {
return applyPrefix(lowPrefix(s), out)
return applyPrefix(lowPrefix(s), format)
}
return applyPrefix(s.Prefix, out)
return applyPrefix(s.Prefix, format)
}
func applyTemplateFormatting(style StyleEnum, useColor bool, format string, a map[string]interface{}) string {
format = applyStyle(style, useColor, format)
var buf bytes.Buffer
t, err := template.New(format).Parse(format)
if err != nil {
glog.Infof("Initializing template failed. Returning raw string.")
return format
}
err = t.Execute(&buf, a)
if err != nil {
glog.Infof("Executing template failed. Returning raw string.")
return format
}
outStyled := buf.String()
// escape any outstanding '%' signs so that they don't get interpreted
// as a formatting directive down the line
outStyled = strings.Replace(outStyled, "%", "%%", -1)
return outStyled
}

View File

@ -153,7 +153,7 @@ const (
SHASuffix = ".sha256"
// DefaultMemorySize is the default memory which will be allocated to minikube, in megabytes
DefaultMemorySize = "2000mb"
//MinimumMemorySize is the minimum memory size, in megabytes
// MinimumMemorySize is the minimum memory size, in megabytes
MinimumMemorySize = "1024mb"
// DefaultCPUS is the default number of cpus of a host
DefaultCPUS = 2
@ -163,12 +163,6 @@ const (
MinimumDiskSize = "2000mb"
// DefaultVMDriver is the default virtual machine driver name
DefaultVMDriver = DriverVirtualbox
// DefaultStatusFormat is the default format of a host
DefaultStatusFormat = `host: {{.Host}}
kubelet: {{.Kubelet}}
apiserver: {{.APIServer}}
kubectl: {{.Kubeconfig}}
`
// DefaultAddonListFormat is the default format of addon list
DefaultAddonListFormat = "- {{.AddonName}}: {{.AddonStatus}}\n"
// DefaultConfigViewFormat is the default format of config view
@ -421,7 +415,7 @@ const (
// StoredContainerdConfigTomlPath is the path where the default config.toml will be stored
StoredContainerdConfigTomlPath = "/tmp/config.toml"
//GvisorConfigTomlTargetName is the go-bindata target name for the gvisor config.toml
// GvisorConfigTomlTargetName is the go-bindata target name for the gvisor config.toml
GvisorConfigTomlTargetName = "gvisor-config.toml"
// GvisorContainerdShimTargetName is the go-bindata target name for gvisor-containerd-shim
GvisorContainerdShimTargetName = "gvisor-containerd-shim.toml"

View File

@ -80,9 +80,11 @@ func (r *Containerd) Available() error {
}
// Enable idempotently enables containerd on a host
func (r *Containerd) Enable() error {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
func (r *Containerd) Enable(disOthers bool) error {
if disOthers {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
}
}
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
return err

View File

@ -78,9 +78,11 @@ func (r *CRIO) Active() bool {
}
// Enable idempotently enables CRIO on a host
func (r *CRIO) Enable() error {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
func (r *CRIO) Enable(disOthers bool) error {
if disOthers {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
}
}
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
return err

View File

@ -38,7 +38,7 @@ type Manager interface {
// Version retrieves the current version of this runtime
Version() (string, error)
// Enable idempotently enables this runtime on a host
Enable() error
Enable(bool) error
// Disable idempotently disables this runtime on a host
Disable() error
// Active returns whether or not a runtime is active on a host

View File

@ -406,7 +406,7 @@ func TestEnable(t *testing.T) {
if err != nil {
t.Fatalf("New(%s): %v", tc.runtime, err)
}
err = cr.Enable()
err = cr.Enable(true)
if err != nil {
t.Errorf("%s disable unexpected error: %v", tc.runtime, err)
}

View File

@ -25,6 +25,9 @@ import (
"k8s.io/minikube/pkg/minikube/console"
)
// KubernetesContainerPrefix is the prefix of each kubernetes container
const KubernetesContainerPrefix = "k8s_"
// Docker contains Docker runtime state
type Docker struct {
Socket string
@ -75,9 +78,11 @@ func (r *Docker) Active() bool {
}
// Enable idempotently enables Docker on a host
func (r *Docker) Enable() error {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
func (r *Docker) Enable(disOthers bool) error {
if disOthers {
if err := disableOthers(r, r.Runner); err != nil {
glog.Warningf("disableOthers: %v", err)
}
}
return r.Runner.Run("sudo systemctl start docker")
}
@ -102,6 +107,7 @@ func (r *Docker) KubeletOptions() map[string]string {
// ListContainers returns a list of containers
func (r *Docker) ListContainers(filter string) ([]string, error) {
filter = KubernetesContainerPrefix + filter
content, err := r.Runner.CombinedOutput(fmt.Sprintf(`docker ps -a --filter="name=%s" --format="{{.ID}}"`, filter))
if err != nil {
return nil, err

View File

@ -46,7 +46,7 @@ func createHypervHost(config cfg.MachineConfig) interface{} {
d.CPU = config.CPUs
d.DiskSize = int(config.DiskSize)
d.SSHUser = "docker"
d.DisableDynamicMemory = true //default to disable dynamic memory as minikube is unlikely to work properly with dynamic memory
d.DisableDynamicMemory = true // default to disable dynamic memory as minikube is unlikely to work properly with dynamic memory
return d
}

View File

@ -40,6 +40,11 @@ var blacklist = []string{
"%s/%d",
"%s=%s",
"%v",
"GID: %s",
"MSize: %d",
"UID: %s",
"env %s",
"opt %s",
}
// state is a struct that represent the current state of the extraction process

View File

@ -19,13 +19,16 @@ package service
import (
"bytes"
"fmt"
"io"
"net/url"
"os"
"strings"
"text/template"
"time"
"github.com/docker/machine/libmachine"
"github.com/golang/glog"
"github.com/olekukonko/tablewriter"
"github.com/pkg/browser"
"github.com/pkg/errors"
"github.com/spf13/viper"
@ -242,6 +245,17 @@ func OptionallyHTTPSFormattedURLString(bareURLString string, https bool) (string
return httpsFormattedString, isHTTPSchemedURL
}
// PrintServiceList prints a list of services as a table which has
// "Namespace", "Name" and "URL" columns to a writer
func PrintServiceList(writer io.Writer, data [][]string) {
table := tablewriter.NewWriter(writer)
table.SetHeader([]string{"Namespace", "Name", "URL"})
table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true})
table.SetCenterSeparator("|")
table.AppendBulk(data)
table.Render()
}
// WaitAndMaybeOpenService waits for a service, and opens it when running
func WaitAndMaybeOpenService(api libmachine.API, namespace string, service string, urlTemplate *template.Template, urlMode bool, https bool,
wait int, interval int) error {
@ -258,6 +272,22 @@ func WaitAndMaybeOpenService(api libmachine.API, namespace string, service strin
if err != nil {
return errors.Wrap(err, "Check that minikube is running and that you have specified the correct namespace")
}
if !urlMode {
var data [][]string
if len(urls) == 0 {
data = append(data, []string{namespace, service, "No node port"})
} else {
data = append(data, []string{namespace, service, strings.Join(urls, "\n")})
}
PrintServiceList(os.Stdout, data)
}
if len(urls) == 0 {
console.OutStyle(console.Sad, "service %s/%s has no node port", namespace, service)
return nil
}
for _, bareURLString := range urls {
urlString, isHTTPSchemedURL := OptionallyHTTPSFormattedURLString(bareURLString, https)

View File

@ -0,0 +1,53 @@
/*
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 translate
import (
"testing"
"golang.org/x/text/language"
)
func TestSetPreferredLanguage(t *testing.T) {
var tests = []struct {
input string
want language.Tag
}{
{"", language.AmericanEnglish},
{"C", language.AmericanEnglish},
{"zh", language.Chinese},
{"fr_FR.utf8", language.French},
}
for _, tc := range tests {
t.Run(tc.input, func(t *testing.T) {
// Set something so that we can assert change.
if err := SetPreferredLanguage("is"); err != nil {
t.Errorf("unexpected error: %q", err)
}
if err := SetPreferredLanguage(tc.input); err != nil {
t.Errorf("unexpected error: %q", err)
}
want, _ := tc.want.Base()
got, _ := GetPreferredLanguage().Base()
if got != want {
t.Errorf("SetPreferredLanguage(%s) = %q, want %q", tc.input, got, want)
}
})
}
}

View File

@ -27,17 +27,17 @@ import (
"k8s.io/client-go/rest"
)
//requestSender is an interface exposed for testing what requests are sent through the k8s REST client
// requestSender is an interface exposed for testing what requests are sent through the k8s REST client
type requestSender interface {
send(request *rest.Request) ([]byte, error)
}
//patchConverter is an interface exposed for testing what patches are sent through the k8s REST client
// patchConverter is an interface exposed for testing what patches are sent through the k8s REST client
type patchConverter interface {
convert(restClient rest.Interface, patch *Patch) *rest.Request
}
//loadBalancerEmulator is the main struct for emulating the loadbalancer behavior. it sets the ingress to the cluster IP
// loadBalancerEmulator is the main struct for emulating the loadbalancer behavior. it sets the ingress to the cluster IP
type loadBalancerEmulator struct {
coreV1Client typed_core.CoreV1Interface
requestSender requestSender

View File

@ -35,13 +35,13 @@ func osGetPid() int {
return os.Getpid()
}
//TODO(balintp): this is vulnerable to pid reuse we should include process name in the check
// TODO(balintp): this is vulnerable to pid reuse we should include process name in the check
func osCheckIfRunning(pid int) (bool, error) {
p, err := os.FindProcess(pid)
if runtime.GOOS == "windows" {
return err == nil, nil
}
//on unix systems further checking is required, as findProcess is noop
// on unix systems further checking is required, as findProcess is noop
if err != nil {
return false, fmt.Errorf("error finding process %d: %s", pid, err)
}

View File

@ -31,9 +31,9 @@ import (
// ID represents a registry ID
type ID struct {
//Route is the key
// Route is the key
Route *Route
//the rest is metadata
// the rest is metadata
MachineName string
Pid int
}

View File

@ -25,7 +25,7 @@ import (
"github.com/golang/glog"
)
//reporter that reports the status of a tunnel
// reporter that reports the status of a tunnel
type reporter interface {
Report(tunnelState *Status)
}

View File

@ -100,7 +100,7 @@ Got: "%s"`, tc.name, tc.expectedOutput, out.output)
})
}
//testing deduplication
// testing deduplication
out := &recordingWriter{}
reporter := newReporter(out)
reporter.Report(testCases[0].tunnelState)

View File

@ -23,19 +23,19 @@ import (
"github.com/golang/glog"
)
//router manages the routing table on the host, implementations should cater for OS specific methods
// router manages the routing table on the host, implementations should cater for OS specific methods
type router interface {
//Inspect checks if the given route exists or not in the routing table
//conflict is defined as: same destination CIDR, different Gateway
//overlaps are defined as: routes that have overlapping but not exactly matching destination CIDR
// Inspect checks if the given route exists or not in the routing table
// conflict is defined as: same destination CIDR, different Gateway
// overlaps are defined as: routes that have overlapping but not exactly matching destination CIDR
Inspect(route *Route) (exists bool, conflict string, overlaps []string, err error)
//EnsureRouteIsAdded is an idempotent way to add a route to the routing table
//it fails if there is a conflict
// EnsureRouteIsAdded is an idempotent way to add a route to the routing table
// it fails if there is a conflict
EnsureRouteIsAdded(route *Route) error
//Cleanup is an idempotent way to remove a route from the routing table
//it fails if there is a conflict
// Cleanup is an idempotent way to remove a route from the routing table
// it fails if there is a conflict
Cleanup(route *Route) error
}
@ -67,8 +67,8 @@ func isValidToAddOrDelete(router router, r *Route) (bool, error) {
return false, nil
}
//a partial representation of the routing table on the host
//tunnel only requires the destination CIDR, the gateway and the actual textual representation per line
// a partial representation of the routing table on the host
// tunnel only requires the destination CIDR, the gateway and the actual textual representation per line
type routingTable []routingTableLine
func (t *routingTable) Check(route *Route) (exists bool, conflict string, overlaps []string) {

View File

@ -77,12 +77,12 @@ func (router *osRouter) parseTable(table []byte) routingTable {
t := routingTable{}
skip := true
for _, line := range strings.Split(string(table), "\n") {
//header
// header
if strings.HasPrefix(line, "Destination") {
skip = false
continue
}
//don't care about the 0.0.0.0 routes
// don't care about the 0.0.0.0 routes
if skip || strings.HasPrefix(line, "default") {
continue
}

View File

@ -74,7 +74,7 @@ func (router *osRouter) parseTable(table []byte) routingTable {
fields := strings.Fields(line)
//don't care about the routes that 0.0.0.0
// don't care about the routes that 0.0.0.0
if len(fields) == 0 ||
len(fields) > 0 && (fields[0] == "default" || fields[0] == "0.0.0.0") {
continue
@ -82,12 +82,12 @@ func (router *osRouter) parseTable(table []byte) routingTable {
if len(fields) > 2 {
//assuming "10.96.0.0/12 via 192.168.39.47 dev virbr1"
// assuming "10.96.0.0/12 via 192.168.39.47 dev virbr1"
dstCIDRString := fields[0]
gatewayIPString := fields[2]
gatewayIP := net.ParseIP(gatewayIPString)
//if not via format, then gateway is assumed to be 0.0.0.0
// if not via format, then gateway is assumed to be 0.0.0.0
// "1.2.3.0/24 dev eno1 proto kernel scope link src 1.2.3.54 metric 100"
if fields[1] != "via" {
gatewayIP = net.ParseIP("0.0.0.0")

View File

@ -64,14 +64,14 @@ func (router *osRouter) parseTable(table []byte) routingTable {
t := routingTable{}
skip := true
for _, line := range strings.Split(string(table), "\n") {
//after first line of header we can start consuming
// after first line of header we can start consuming
if strings.HasPrefix(line, "Network Destination") {
skip = false
continue
}
fields := strings.Fields(line)
//don't care about the 0.0.0.0 routes
// don't care about the 0.0.0.0 routes
if skip || len(fields) == 0 || len(fields) > 0 && (fields[0] == "default" || fields[0] == "0.0.0.0") {
continue
}

View File

@ -32,8 +32,8 @@ func (r *recordingReporter) Report(tunnelState *Status) {
r.statesRecorded = append(r.statesRecorded, tunnelState)
}
//simulating idempotent router behavior
//without checking for conflicting routes
// simulating idempotent router behavior
// without checking for conflicting routes
type fakeRouter struct {
rt routingTable
errorResponse error

View File

@ -32,9 +32,9 @@ import (
"k8s.io/minikube/pkg/minikube/constants"
)
//tunnel represents the basic API for a tunnel: periodically the state of the tunnel
//can be updated and when the tunnel is not needed, it can be cleaned up
//It was mostly introduced for testability.
// tunnel represents the basic API for a tunnel: periodically the state of the tunnel
// can be updated and when the tunnel is not needed, it can be cleaned up
// It was mostly introduced for testability.
type controller interface {
cleanup() *Status
update() *Status
@ -85,7 +85,7 @@ func newTunnel(machineName string, machineAPI libmachine.API, configLoader confi
}
type tunnel struct {
//collaborators
// collaborators
clusterInspector *clusterInspector
router router
loadBalancerEmulator loadBalancerEmulator
@ -142,8 +142,8 @@ func setupRoute(t *tunnel, h *host.Host) {
if t.status.RouteError != nil {
return
}
//the route was added successfully, we need to make sure the registry has it too
//this might fail in race conditions, when another process created this tunnel
// the route was added successfully, we need to make sure the registry has it too
// this might fail in race conditions, when another process created this tunnel
if err := t.registry.Register(&t.status.TunnelID); err != nil {
glog.Errorf("failed to register tunnel: %s", err)
t.status.RouteError = err
@ -151,7 +151,7 @@ func setupRoute(t *tunnel, h *host.Host) {
}
if h.DriverName == constants.DriverHyperkit {
//the virtio-net interface acts up with ip tunnels :(
// the virtio-net interface acts up with ip tunnels :(
setupBridge(t)
if t.status.RouteError != nil {
return
@ -166,7 +166,7 @@ func setupRoute(t *tunnel, h *host.Host) {
return
}
//the route exists, make sure that this process owns it in the registry
// the route exists, make sure that this process owns it in the registry
existingTunnel, err := t.registry.IsAlreadyDefinedAndRunning(&t.status.TunnelID)
if err != nil {
glog.Errorf("failed to check for other tunnels: %s", err)
@ -175,7 +175,7 @@ func setupRoute(t *tunnel, h *host.Host) {
}
if existingTunnel == nil {
//the route exists, but "orphaned", this process will "own it" in the registry
// the route exists, but "orphaned", this process will "own it" in the registry
if err := t.registry.Register(&t.status.TunnelID); err != nil {
glog.Errorf("failed to register tunnel: %s", err)
t.status.RouteError = err
@ -184,7 +184,7 @@ func setupRoute(t *tunnel, h *host.Host) {
}
if existingTunnel.Pid != getPid() {
//another running process owns the tunnel
// another running process owns the tunnel
t.status.RouteError = errorTunnelAlreadyExists(existingTunnel)
return
}

View File

@ -38,7 +38,7 @@ type Manager struct {
router router
}
//stateCheckInterval defines how frequently the cluster and route states are checked
// stateCheckInterval defines how frequently the cluster and route states are checked
const stateCheckInterval = 5 * time.Second
// NewManager creates a new Manager
@ -68,7 +68,7 @@ func (mgr *Manager) startTunnel(ctx context.Context, tunnel controller) (done ch
check := make(chan bool, 1)
done = make(chan bool, 1)
//simulating Ctrl+C so that we can cancel the tunnel programmatically too
// simulating Ctrl+C so that we can cancel the tunnel programmatically too
go mgr.timerLoop(ready, check)
go mgr.run(ctx, tunnel, ready, check, done)

View File

@ -29,7 +29,7 @@ import (
func TestTunnelManagerEventHandling(t *testing.T) {
tcs := []struct {
//tunnel inputs
// tunnel inputs
name string
repeat int
test func(tunnel *tunnelStub, cancel context.CancelFunc, ready, check, done chan bool) error
@ -120,7 +120,7 @@ func TestTunnelManagerEventHandling(t *testing.T) {
},
}
//t.Parallel()
// t.Parallel()
for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
var err error

View File

@ -69,7 +69,7 @@ func TestCacheMinikubeISOFromURL(t *testing.T) {
t.Fatalf("File not copied. Could not open file at path: %s", isoPath)
}
//test that the ISO is transferred properly
// test that the ISO is transferred properly
contents := []byte(testISOString)
if !bytes.Contains(transferred, contents) {
t.Fatalf("Expected transfers to contain: %s. It was: %s", contents, transferred)

View File

@ -313,7 +313,7 @@ func GetPortFromKubeConfig(filename, machineName string) (int, error) {
return port, err
}
//UnsetCurrentContext unsets the current-context from minikube to "" on minikube stop
// UnsetCurrentContext unsets the current-context from minikube to "" on minikube stop
func UnsetCurrentContext(filename, machineName string) error {
confg, err := ReadConfigOrNew(filename)
if err != nil {
@ -332,7 +332,7 @@ func UnsetCurrentContext(filename, machineName string) error {
return nil
}
//SetCurrentContext sets the kubectl's current-context
// SetCurrentContext sets the kubectl's current-context
func SetCurrentContext(kubeCfgPath, name string) error {
kcfg, err := ReadConfigOrNew(kubeCfgPath)
if err != nil {

View File

@ -266,7 +266,7 @@ func WaitForService(c kubernetes.Interface, namespace, name string, exist bool,
return nil
}
//WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum.
// WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum.
func WaitForServiceEndpointsNum(c kubernetes.Interface, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error {
return wait.Poll(interval, timeout, func() (bool, error) {
glog.Infof("Waiting for amount of service:%s endpoints to be %d", serviceName, expectNum)

View File

@ -29,7 +29,7 @@ func testClusterLogs(t *testing.T) {
minikubeRunner.EnsureRunning()
logsCmdOutput := minikubeRunner.GetLogs()
//check for # of lines or check for strings
// check for # of lines or check for strings
logWords := []string{"minikube", ".go"}
for _, logWord := range logWords {
if !strings.Contains(logsCmdOutput, logWord) {

View File

@ -21,7 +21,7 @@ func StartServer(addrVal string, debugVal int, rootVal string) {
fmt.Print("ufs starting\n")
// determined by build tags
//extraFuncs()
// extraFuncs()
err := ufs.StartNetListener("tcp", addrVal)
if err != nil {
log.Println(err)

View File

@ -225,7 +225,7 @@ func (u *Ufs) Wstat(req *SrvReq) {
case true:
mt = st.ModTime()
default:
//at = time.Time(0)//atime(st.Sys().(*syscall.Stat_t))
// at = time.Time(0)//atime(st.Sys().(*syscall.Stat_t))
}
}
// macOS filesystem st_mtime values are only accurate to the second

View File

@ -219,7 +219,7 @@ func (u *Ufs) Wstat(req *SrvReq) {
case true:
mt = st.ModTime()
default:
//at = time.Time(0)//atime(st.Sys().(*syscall.Stat_t))
// at = time.Time(0)//atime(st.Sys().(*syscall.Stat_t))
}
}
e := os.Chtimes(fid.path, at, mt)

View File

@ -20,13 +20,13 @@
"Alternatively, you may delete the existing VM using `minikube delete -p %s`": "",
"Cannot find directory %s for mount": "",
"Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "",
"Configuring environment for Kubernetes %s on %s %s": "Configurant l'environment pour Kubernetes %s sur %s %s",
"Configuring environment for Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}}": "Configurant l'environment pour Kubernetes {{.k8sVersion}} sur {{.runtime}} {{.runtimeVersion}}",
"Configuring local host environment ...": "",
"Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...": "Créant un VM %s (CPUs=%d, Mémoire=%dMB, Disque=%dMB)",
"Creating mount %s ...": "",
"Creating mount {{.name}} ...": "",
"Deleting %q from %s ...": "",
"Documentation: %s": "",
"Done! kubectl is now configured to use %q": "Fini! kubectl est maintenant configuré pour utiliser %s.",
"Done! kubectl is now configured to use {{.name}}": "Fini! kubectl est maintenant configuré pour utiliser {{.name}}.",
"Download complete!": "",
"Downloading %s %s": "",
"Downloading Minikube ISO ...": "",
@ -93,7 +93,7 @@
"Failed to list cached images": "",
"Failed to remove profile": "",
"Failed to save config": "",
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,%s`.": "",
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,{{.ip}}`.": "",
"Failed to setup certs": "",
"Failed to setup kubeconfig": "",
"Failed to update cluster": "",
@ -103,14 +103,13 @@
"For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "",
"For more information, see:": "",
"Found network options:": "",
"GID: %s": "",
"If the above advice does not help, please let us know: ": "",
"Ignoring --vm-driver=%s, as the existing %q VM was created using the %s driver.": "",
"Invalid size passed in argument: %v": "",
"IsEnabled failed": "",
"Kubernetes downgrade is not supported, will continue to use %v": "",
"Kubernetes downgrade is not supported, will continue to use {{.version}}": "",
"Launching Kubernetes ... ": "Lançant Kubernetes ...",
"Launching proxy ...": "",
"MSize: %d": "",
"Mode: %o (%s)": "",
"Mount options:": "",
"Mounting host path %s into VM as %s ...": "",
@ -120,25 +119,27 @@
"Opening %s in your default browser...": "",
"Opening kubernetes service %s/%s in default browser...": "",
"Options: %s": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary.": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with {{.driver}} driver.": "",
"Please enter a value:": "",
"Please run with sudo. the vm-driver %q requires sudo.": "",
"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (example: \"/host-home:/vm-home\")": "",
"Powering off %q via SSH ...": "",
"Problems detected in %q:": "",
"Pulling images ...": "Extrayant les images ... ",
"Re-using the currently running %s VM for %q ...": "",
"Related issues:": "",
"Relaunching Kubernetes %s using %s ... ": "",
"Requested disk size (%dMB) is less than minimum of %dMB": "",
"Relaunching Kubernetes {{.version}} using {{.bootstrapper}} ... ": "",
"Requested disk size (%dMB) is less than minimum of (%dMB)": "",
"Requested memory allocation (%dMB) is less than the minimum allowed of %dMB": "",
"Requested memory allocation ({{.memory}}MB) is less than the default memory allocation of {{.default}}MB. Beware that minikube might not work correctly or crash unexpectedly.": "",
"Restarting existing %s VM for %q ...": "",
"Set failed": "",
"Setting profile failed": "",
"Skipped switching kubectl context for %s , because --keep-context": "",
"Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": "",
"Sorry, completion support is not yet implemented for %q": "",
"Sorry, the --gpu feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the kubeadm.%s parameter is currently not supported by --extra-config": "",
"Sorry, url provided with --registry-mirror flag is invalid %q": "",
"Stopping %q in %s ...": "",
"Successfully mounted %s to %s": "",
"Target directory %q must be an absolute path": "",
@ -157,10 +158,10 @@
"This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true": "",
"Tip: Use 'minikube start -p \u003cname\u003e' to create a new cluster, or 'minikube delete' to delete this one.": "",
"To connect to this cluster, use: kubectl --context=%s": "",
"To connect to this cluster, use: kubectl --context={{.name}}": "",
"To switch drivers, you may create a new VM using `minikube start -p \u003cname\u003e --vm-driver=%s`": "",
"To use kubectl or minikube commands as your own user, you may": "",
"Type: %s": "",
"UID: %s": "",
"Unable to bind flags": "",
"Unable to enable dashboard": "",
"Unable to fetch latest version info": "",
@ -171,7 +172,7 @@
"Unable to load cached images: %v": "",
"Unable to load config: %v": "",
"Unable to parse %q: %v": "",
"Unable to pull images, which may be OK: %v": "",
"Unable to pull images, which may be OK: {{.error}}": "",
"Unable to start VM": "",
"Unable to stop VM": "",
"Uninstalling Kubernetes %s using %s ...": "",
@ -180,6 +181,7 @@
"Usage: minikube completion SHELL": "",
"Userspace file server is shutdown": "",
"Userspace file server: ": "",
"Using image repository {{.name}}": "",
"Verifying dashboard health ...": "",
"Verifying proxy health ...": "",
"Verifying:": "Vérifiant:",
@ -198,7 +200,6 @@
"config view failed": "",
"disable failed": "",
"enable failed: %v": "",
"env %s": "",
"error creating clientset": "",
"error creating machine client": "",
"error getting driver": "",
@ -209,14 +210,13 @@
"kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "",
"kubectl proxy": "",
"logdir set failed": "",
"minikube %s on %s (%s)": "minikube %s sur %s (%s)",
"minikube is not running, so the service cannot be accessed": "",
"minikube profile was successfully set to %s": "",
"minikube will upgrade the local cluster from Kubernetes %s to %s": "",
"minikube will upgrade the local cluster from Kubernetes {{.old}} to {{.new}}": "",
"minikube {{.version}} on {{.os}} ({{.arch}})": "minikube {{.version}} sur {{.os}} ({{.arch}})",
"mount argument %q must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "",
"mount failed": "",
"need to relocate them. For example, to overwrite your own settings:": "",
"opt %s": "",
"stat failed": "",
"unable to bind flags": "",
"unable to set logtostderr": "",
@ -232,6 +232,5 @@
"usage: minikube config unset PROPERTY_NAME": "",
"usage: minikube delete": "",
"usage: minikube profile [MINIKUBE_PROFILE_NAME]": "",
"using image repository %s": "",
"zsh completion failed": ""
}

View File

@ -20,13 +20,13 @@
"Alternatively, you may delete the existing VM using `minikube delete -p %s`": "",
"Cannot find directory %s for mount": "",
"Check that minikube is running and that you have specified the correct namespace (-n flag) if required.": "",
"Configuring environment for Kubernetes %s on %s %s": "开始为Kubernetes %s%s %s 配置环境变量",
"Configuring environment for Kubernetes {{.k8sVersion}} on {{.runtime}} {{.runtimeVersion}}": "开始为Kubernetes {{.k8sVersion}}{{.runtime}} {{.runtimeVersion}} 配置环境变量",
"Configuring local host environment ...": "",
"Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...": "正在创建%s虚拟机CPU=%d内存=%dMB磁盘=%dMB...",
"Creating mount %s ...": "",
"Creating mount {{.name}} ...": "",
"Deleting %q from %s ...": "",
"Documentation: %s": "",
"Done! kubectl is now configured to use %q": "完成kubectl已经配置至%q",
"Done! kubectl is now configured to use {{.name}}": "完成kubectl已经配置至{{.name}}",
"Download complete!": "",
"Downloading %s %s": "",
"Downloading Minikube ISO ...": "",
@ -93,7 +93,7 @@
"Failed to list cached images": "",
"Failed to remove profile": "",
"Failed to save config": "",
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,%s`.": "",
"Failed to set NO_PROXY Env. Please use `export NO_PROXY=$NO_PROXY,{{.ip}}`.": "",
"Failed to setup certs": "",
"Failed to setup kubeconfig": "",
"Failed to update cluster": "",
@ -103,14 +103,13 @@
"For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "",
"For more information, see:": "",
"Found network options:": "",
"GID: %s": "",
"If the above advice does not help, please let us know: ": "",
"Ignoring --vm-driver=%s, as the existing %q VM was created using the %s driver.": "",
"Invalid size passed in argument: %v": "",
"IsEnabled failed": "",
"Kubernetes downgrade is not supported, will continue to use %v": "",
"Kubernetes downgrade is not supported, will continue to use {{.version}}": "",
"Launching Kubernetes ... ": "正在启动 Kubernetes ... ",
"Launching proxy ...": "",
"MSize: %d": "",
"Mode: %o (%s)": "",
"Mount options:": "",
"Mounting host path %s into VM as %s ...": "",
@ -120,25 +119,27 @@
"Opening %s in your default browser...": "",
"Opening kubernetes service %s/%s in default browser...": "",
"Options: %s": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary.": "",
"Please don't run minikube as root or with 'sudo' privileges. It isn't necessary with {{.driver}} driver.": "",
"Please enter a value:": "",
"Please run with sudo. the vm-driver %q requires sudo.": "",
"Please specify the directory to be mounted: \n\tminikube mount \u003csource directory\u003e:\u003ctarget directory\u003e (example: \"/host-home:/vm-home\")": "",
"Powering off %q via SSH ...": "",
"Problems detected in %q:": "",
"Pulling images ...": "拉取镜像 ...",
"Re-using the currently running %s VM for %q ...": "",
"Related issues:": "",
"Relaunching Kubernetes %s using %s ... ": "",
"Requested disk size (%dMB) is less than minimum of %dMB": "",
"Relaunching Kubernetes {{.version}} using {{.bootstrapper}} ... ": "",
"Requested disk size (%dMB) is less than minimum of (%dMB)": "",
"Requested memory allocation (%dMB) is less than the minimum allowed of %dMB": "",
"Requested memory allocation ({{.memory}}MB) is less than the default memory allocation of {{.default}}MB. Beware that minikube might not work correctly or crash unexpectedly.": "",
"Restarting existing %s VM for %q ...": "",
"Set failed": "",
"Setting profile failed": "",
"Skipped switching kubectl context for %s , because --keep-context": "",
"Sorry that minikube crashed. If this was unexpected, we would love to hear from you:": "",
"Sorry, completion support is not yet implemented for %q": "",
"Sorry, the --gpu feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the --hidden feature is currently only supported with --vm-driver=kvm2": "",
"Sorry, the kubeadm.%s parameter is currently not supported by --extra-config": "",
"Sorry, url provided with --registry-mirror flag is invalid %q": "",
"Stopping %q in %s ...": "",
"Successfully mounted %s to %s": "",
"Target directory %q must be an absolute path": "",
@ -157,10 +158,10 @@
"This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true": "",
"Tip: Use 'minikube start -p \u003cname\u003e' to create a new cluster, or 'minikube delete' to delete this one.": "",
"To connect to this cluster, use: kubectl --context=%s": "",
"To connect to this cluster, use: kubectl --context={{.name}}": "",
"To switch drivers, you may create a new VM using `minikube start -p \u003cname\u003e --vm-driver=%s`": "",
"To use kubectl or minikube commands as your own user, you may": "",
"Type: %s": "",
"UID: %s": "",
"Unable to bind flags": "",
"Unable to enable dashboard": "",
"Unable to fetch latest version info": "",
@ -171,7 +172,7 @@
"Unable to load cached images: %v": "",
"Unable to load config: %v": "",
"Unable to parse %q: %v": "",
"Unable to pull images, which may be OK: %v": "",
"Unable to pull images, which may be OK: {{.error}}": "",
"Unable to start VM": "",
"Unable to stop VM": "",
"Uninstalling Kubernetes %s using %s ...": "",
@ -180,6 +181,7 @@
"Usage: minikube completion SHELL": "",
"Userspace file server is shutdown": "",
"Userspace file server: ": "",
"Using image repository {{.name}}": "",
"Verifying dashboard health ...": "",
"Verifying proxy health ...": "",
"Verifying:": "正在验证:",
@ -198,7 +200,6 @@
"config view failed": "",
"disable failed": "",
"enable failed: %v": "",
"env %s": "",
"error creating clientset": "",
"error creating machine client": "",
"error getting driver": "",
@ -209,14 +210,13 @@
"kubectl not found in PATH, but is required for the dashboard. Installation guide: https://kubernetes.io/docs/tasks/tools/install-kubectl/": "",
"kubectl proxy": "",
"logdir set failed": "",
"minikube %s on %s (%s)": "您正在使用minikube %s 运行平台:%s (%s)",
"minikube is not running, so the service cannot be accessed": "",
"minikube profile was successfully set to %s": "",
"minikube will upgrade the local cluster from Kubernetes %s to %s": "",
"minikube will upgrade the local cluster from Kubernetes {{.old}} to {{.new}}": "",
"minikube {{.version}} on {{.os}} ({{.arch}})": "您正在使用minikube {{.version}} 运行平台:{{.os}} ({{.arch}})",
"mount argument %q must be in form: \u003csource directory\u003e:\u003ctarget directory\u003e": "",
"mount failed": "",
"need to relocate them. For example, to overwrite your own settings:": "",
"opt %s": "",
"stat failed": "",
"unable to bind flags": "",
"unable to set logtostderr": "",
@ -232,6 +232,5 @@
"usage: minikube config unset PROPERTY_NAME": "",
"usage: minikube delete": "",
"usage: minikube profile [MINIKUBE_PROFILE_NAME]": "",
"using image repository %s": "",
"zsh completion failed": ""
}