constants.go 4.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
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.
*/

D
Dan Lorenc 已提交
17 18 19
package constants

import (
20
	"errors"
D
Dan Lorenc 已提交
21
	"path/filepath"
J
Jimmi Dyson 已提交
22

23 24
	"k8s.io/client-go/tools/clientcmd"
	"k8s.io/client-go/util/homedir"
25
	"k8s.io/minikube/pkg/minikube/localpath"
D
Dan Lorenc 已提交
26 27
)

28
const (
29
	// DefaultKubernetesVersion is the default Kubernetes version
M
Medya Gh 已提交
30
	DefaultKubernetesVersion = "v1.18.3"
M
Medya Ghazizadeh 已提交
31
	// NewestKubernetesVersion is the newest Kubernetes version to test against
M
Medya Gh 已提交
32
	NewestKubernetesVersion = "v1.18.4-rc.0"
M
Medya Ghazizadeh 已提交
33
	// OldestKubernetesVersion is the oldest Kubernetes version to test against
P
Priya Wadhwa 已提交
34
	OldestKubernetesVersion = "v1.13.0"
S
Sharif Elgamal 已提交
35 36
	// DefaultClusterName is the default nane for the k8s cluster
	DefaultClusterName = "minikube"
37 38
	// DockerDaemonPort is the port Docker daemon listening inside a minikube node (vm or container).
	DockerDaemonPort = 2376
39 40
	// APIServerPort is the default API server port
	APIServerPort = 8443
M
Medya Ghazizadeh 已提交
41 42
	// SSHPort is the SSH serviceport on the node vm and container
	SSHPort = 22
A
Alonyb 已提交
43 44
	// RegistryAddonPort os the default registry addon port
	RegistryAddonPort = 5000
M
Medya Ghazizadeh 已提交
45

46 47 48
	// APIServerName is the default API server name
	APIServerName = "minikubeCA"
	// ClusterDNSDomain is the default DNS domain
49
	ClusterDNSDomain = "cluster.local"
M
Medya Gh 已提交
50 51
	// DefaultServiceCIDR is The CIDR to be used for service cluster IPs
	DefaultServiceCIDR = "10.96.0.0/12"
52 53
	// HostAlias is a DNS alias to the the container/VM host IP
	HostAlias = "host.minikube.internal"
54
	// ControlPlaneAlias is a DNS alias pointing to the apiserver frontend
T
Thomas Stromberg 已提交
55
	ControlPlaneAlias = "control-plane.minikube.internal"
M
Medya Ghazizadeh 已提交
56

57 58 59 60
	// DockerHostEnv is used for docker daemon settings
	DockerHostEnv = "DOCKER_HOST"
	// DockerCertPathEnv is used for docker daemon settings
	DockerCertPathEnv = "DOCKER_CERT_PATH"
M
Medya Ghazizadeh 已提交
61 62
	// DockerTLSVerifyEnv is used for docker daemon settings
	DockerTLSVerifyEnv = "DOCKER_TLS_VERIFY"
63 64 65
	// MinikubeActiveDockerdEnv holds the docker daemon which user's shell is pointing at
	// value would be profile or empty if pointing to the user's host daemon.
	MinikubeActiveDockerdEnv = "MINIKUBE_ACTIVE_DOCKERD"
66 67
	// PodmanVarlinkBridgeEnv is used for podman settings
	PodmanVarlinkBridgeEnv = "PODMAN_VARLINK_BRIDGE"
68 69 70
	// MinikubeActivePodmanEnv holds the podman service that the user's shell is pointing at
	// value would be profile or empty if pointing to the user's host.
	MinikubeActivePodmanEnv = "MINIKUBE_ACTIVE_PODMAN"
71 72
	// MinikubeForceSystemdEnv is used to force systemd as cgroup manager for the container runtime
	MinikubeForceSystemdEnv = "MINIKUBE_FORCE_SYSTEMD"
73
)
J
Jimmi Dyson 已提交
74

M
Medya Ghazizadeh 已提交
75
var (
76 77
	// IsMinikubeChildProcess is the name of "is minikube child process" variable
	IsMinikubeChildProcess = "IS_MINIKUBE_CHILD_PROCESS"
K
Kyle Bai 已提交
78
	// GvisorConfigTomlTargetName is the go-bindata target name for the gvisor config.toml
79
	GvisorConfigTomlTargetName = "gvisor-config.toml"
M
Medya Ghazizadeh 已提交
80 81 82
	// MountProcessFileName is the filename of the mount process
	MountProcessFileName = ".mount-process"

83
	// SHASuffix is the suffix of a SHA-256 checksum file
M
Medya Ghazizadeh 已提交
84 85 86 87
	SHASuffix = ".sha256"

	// DockerDaemonEnvs is list of docker-daemon related environment variables.
	DockerDaemonEnvs = [3]string{DockerHostEnv, DockerTLSVerifyEnv, DockerCertPathEnv}
88 89
	// PodmanRemoteEnvs is list of podman-remote related environment variables.
	PodmanRemoteEnvs = [1]string{PodmanVarlinkBridgeEnv}
M
Medya Ghazizadeh 已提交
90

91
	// DefaultMinipath is the default minikube path (under the home directory)
M
Medya Ghazizadeh 已提交
92 93
	DefaultMinipath = filepath.Join(homedir.HomeDir(), ".minikube")

94
	// KubeconfigEnvVar is the env var to check for the Kubernetes client config
M
Medya Ghazizadeh 已提交
95 96 97 98
	KubeconfigEnvVar = clientcmd.RecommendedConfigPathEnvVar
	// KubeconfigPath is the path to the Kubernetes client config
	KubeconfigPath = clientcmd.RecommendedHomeFile

99
	// ImageRepositories contains all known image repositories
M
Medya Ghazizadeh 已提交
100 101 102 103 104 105 106 107 108
	ImageRepositories = map[string][]string{
		"global": {""},
		"cn":     {"registry.cn-hangzhou.aliyuncs.com/google_containers"},
	}
	// KubernetesReleaseBinaries are Kubernetes release binaries required for
	// kubeadm (kubelet, kubeadm) and the addon manager (kubectl)
	KubernetesReleaseBinaries = []string{"kubelet", "kubeadm", "kubectl"}
	// ImageCacheDir is the path to the image cache directory
	ImageCacheDir = localpath.MakeMiniPath("cache", "images")
M
Medya Gh 已提交
109

110
	// DefaultNamespaces are Kubernetes namespaces used by minikube, including addons
M
Medya Gh 已提交
111 112 113 114 115 116
	DefaultNamespaces = []string{
		"kube-system",
		"kubernetes-dashboard",
		"storage-gluster",
		"istio-operator",
	}
117 118 119

	// ErrMachineMissing is returned when virtual machine does not exist due to user interrupt cancel(i.e. Ctrl + C)
	ErrMachineMissing = errors.New("machine does not exist")
120
)