Merge branch 'master' into w/upgrade-linter

pull/5572/head
Thomas Strömberg 2019-10-10 09:37:56 -07:00 committed by GitHub
commit d591d81bad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 459 additions and 74 deletions

View File

@ -99,6 +99,7 @@ const (
imageMirrorCountry = "image-mirror-country" imageMirrorCountry = "image-mirror-country"
mountString = "mount-string" mountString = "mount-string"
disableDriverMounts = "disable-driver-mounts" disableDriverMounts = "disable-driver-mounts"
addons = "addons"
cacheImages = "cache-images" cacheImages = "cache-images"
uuid = "uuid" uuid = "uuid"
vpnkitSock = "hyperkit-vpnkit-sock" vpnkitSock = "hyperkit-vpnkit-sock"
@ -124,8 +125,10 @@ var (
dockerOpt []string dockerOpt []string
insecureRegistry []string insecureRegistry []string
apiServerNames []string apiServerNames []string
addonList []string
apiServerIPs []net.IP apiServerIPs []net.IP
extraOptions cfg.ExtraOptionSlice extraOptions cfg.ExtraOptionSlice
enableUpdateNotification = true
) )
func init() { func init() {
@ -161,6 +164,7 @@ func initMinikubeFlags() {
startCmd.Flags().String(containerRuntime, "docker", "The container runtime to be used (docker, crio, containerd).") startCmd.Flags().String(containerRuntime, "docker", "The container runtime to be used (docker, crio, containerd).")
startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.") startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube.")
startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start.") startCmd.Flags().String(mountString, constants.DefaultMountDir+":/minikube-host", "The argument to pass the minikube mount command on start.")
startCmd.Flags().StringArrayVar(&addonList, addons, nil, "Enable addons. see `minikube addons list` for a list of valid addon names.")
startCmd.Flags().String(criSocket, "", "The cri socket path to be used.") startCmd.Flags().String(criSocket, "", "The cri socket path to be used.")
startCmd.Flags().String(networkPlugin, "", "The name of the network plugin.") startCmd.Flags().String(networkPlugin, "", "The name of the network plugin.")
startCmd.Flags().Bool(enableDefaultCNI, false, "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \"--network-plugin=cni\".") startCmd.Flags().Bool(enableDefaultCNI, false, "Enable the default CNI plugin (/etc/cni/net.d/k8s.conf). Used in conjunction with \"--network-plugin=cni\".")
@ -341,6 +345,15 @@ func runStart(cmd *cobra.Command, args []string) {
// pull images or restart cluster // pull images or restart cluster
bootstrapCluster(bs, cr, mRunner, config.KubernetesConfig, preExists, isUpgrade) bootstrapCluster(bs, cr, mRunner, config.KubernetesConfig, preExists, isUpgrade)
configureMounts() configureMounts()
// enable addons with start command
for _, a := range addonList {
err = cmdcfg.Set(a, "true")
if err != nil {
exit.WithError("addon enable failed", err)
}
}
if err = loadCachedImagesInConfigFile(); err != nil { if err = loadCachedImagesInConfigFile(); err != nil {
out.T(out.FailureType, "Unable to load cached images from config file.") out.T(out.FailureType, "Unable to load cached images from config file.")
} }

View File

@ -42,7 +42,9 @@ import (
const minikubeEnableProfile = "MINIKUBE_ENABLE_PROFILING" const minikubeEnableProfile = "MINIKUBE_ENABLE_PROFILING"
var ( var (
machineLogErrorRe = regexp.MustCompile(`(?i) (failed|error|fatal)`) // This regex is intentionally very specific, it's supposed to surface
// unexpected errors from libmachine to the user.
machineLogErrorRe = regexp.MustCompile(`VirtualizationException`)
machineLogWarningRe = regexp.MustCompile(`(?i)warning`) machineLogWarningRe = regexp.MustCompile(`(?i)warning`)
) )
@ -67,6 +69,7 @@ func bridgeLogMessages() {
log.SetOutput(stdLogBridge{}) log.SetOutput(stdLogBridge{})
mlog.SetErrWriter(machineLogBridge{}) mlog.SetErrWriter(machineLogBridge{})
mlog.SetOutWriter(machineLogBridge{}) mlog.SetOutWriter(machineLogBridge{})
mlog.SetDebug(true)
} }
type stdLogBridge struct{} type stdLogBridge struct{}

View File

@ -6,7 +6,7 @@
define AUTOMOUNT_INSTALL_INIT_SYSTEMD define AUTOMOUNT_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/automount/minikube-automount.service \ $(AUTOMOUNT_PKGDIR)/minikube-automount.service \
$(TARGET_DIR)/usr/lib/systemd/system/minikube-automount.service $(TARGET_DIR)/usr/lib/systemd/system/minikube-automount.service
ln -fs /usr/lib/systemd/system/minikube-automount.service \ ln -fs /usr/lib/systemd/system/minikube-automount.service \
@ -15,7 +15,7 @@ endef
define AUTOMOUNT_INSTALL_TARGET_CMDS define AUTOMOUNT_INSTALL_TARGET_CMDS
$(INSTALL) -Dm755 \ $(INSTALL) -Dm755 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/automount/minikube-automount \ $(AUTOMOUNT_PKGDIR)/minikube-automount \
$(TARGET_DIR)/usr/sbin/minikube-automount $(TARGET_DIR)/usr/sbin/minikube-automount
endef endef

View File

@ -42,13 +42,13 @@ define CONTAINERD_BIN_INSTALL_TARGET_CMDS
$(@D)/bin/ctr \ $(@D)/bin/ctr \
$(TARGET_DIR)/usr/bin $(TARGET_DIR)/usr/bin
$(INSTALL) -Dm644 \ $(INSTALL) -Dm644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/containerd-bin/config.toml \ $(CONTAINERD_BIN_PKGDIR)/config.toml \
$(TARGET_DIR)/etc/containerd/config.toml $(TARGET_DIR)/etc/containerd/config.toml
endef endef
define CONTAINERD_BIN_INSTALL_INIT_SYSTEMD define CONTAINERD_BIN_INSTALL_INIT_SYSTEMD
$(INSTALL) -Dm755 \ $(INSTALL) -Dm755 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/containerd-bin/containerd.service \ $(CONTAINERD_BIN_PKGDIR)/containerd.service \
$(TARGET_DIR)/usr/lib/systemd/system/containerd.service $(TARGET_DIR)/usr/lib/systemd/system/containerd.service
$(call link-service,containerd.service) $(call link-service,containerd.service)
$(call link-service,containerd-shutdown.service) $(call link-service,containerd-shutdown.service)

View File

@ -26,7 +26,7 @@ define CRIO_BIN_CONFIGURE_CMDS
mkdir -p $(CRIO_BIN_GOPATH)/src/github.com/cri-o mkdir -p $(CRIO_BIN_GOPATH)/src/github.com/cri-o
ln -sf $(@D) $(CRIO_BIN_GOPATH)/src/github.com/cri-o/cri-o ln -sf $(@D) $(CRIO_BIN_GOPATH)/src/github.com/cri-o/cri-o
# Copy pre-generated conmon/config.h - see <https://github.com/cri-o/cri-o/issues/2575> # Copy pre-generated conmon/config.h - see <https://github.com/cri-o/cri-o/issues/2575>
cp $(BR2_EXTERNAL_MINIKUBE_PATH)/package/crio-bin/conmon-config.h $(@D)/conmon/config.h cp $(CRIO_BIN_PKGDIR)/conmon-config.h $(@D)/conmon/config.h
endef endef
define CRIO_BIN_BUILD_CMDS define CRIO_BIN_BUILD_CMDS
@ -48,13 +48,13 @@ define CRIO_BIN_INSTALL_TARGET_CMDS
$(@D)/bin/pause \ $(@D)/bin/pause \
$(TARGET_DIR)/usr/libexec/crio/pause $(TARGET_DIR)/usr/libexec/crio/pause
$(INSTALL) -Dm644 \ $(INSTALL) -Dm644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/crio-bin/crio.conf \ $(CRIO_BIN_PKGDIR)/crio.conf \
$(TARGET_DIR)/etc/crio/crio.conf $(TARGET_DIR)/etc/crio/crio.conf
$(INSTALL) -Dm644 \ $(INSTALL) -Dm644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/crio-bin/policy.json \ $(CRIO_BIN_PKGDIR)/policy.json \
$(TARGET_DIR)/etc/containers/policy.json $(TARGET_DIR)/etc/containers/policy.json
$(INSTALL) -Dm644 \ $(INSTALL) -Dm644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/crio-bin/registries.conf \ $(CRIO_BIN_PKGDIR)/registries.conf \
$(TARGET_DIR)/etc/containers/registries.conf $(TARGET_DIR)/etc/containers/registries.conf
mkdir -p $(TARGET_DIR)/etc/sysconfig mkdir -p $(TARGET_DIR)/etc/sysconfig
@ -64,7 +64,7 @@ endef
define CRIO_BIN_INSTALL_INIT_SYSTEMD define CRIO_BIN_INSTALL_INIT_SYSTEMD
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install.systemd DESTDIR=$(TARGET_DIR) PREFIX=$(TARGET_DIR)/usr $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install.systemd DESTDIR=$(TARGET_DIR) PREFIX=$(TARGET_DIR)/usr
$(INSTALL) -Dm644 \ $(INSTALL) -Dm644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/crio-bin/crio.service \ $(CRIO_BIN_PKGDIR)/crio.service \
$(TARGET_DIR)/usr/lib/systemd/system/crio.service $(TARGET_DIR)/usr/lib/systemd/system/crio.service
$(call link-service,crio.service) $(call link-service,crio.service)
$(call link-service,crio-shutdown.service) $(call link-service,crio-shutdown.service)

View File

@ -38,7 +38,7 @@ define DOCKER_BIN_INSTALL_INIT_SYSTEMD
$(TARGET_DIR)/usr/lib/systemd/system/docker.socket $(TARGET_DIR)/usr/lib/systemd/system/docker.socket
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/docker-bin/forward.conf \ $(DOCKER_BIN_PKGDIR)/forward.conf \
$(TARGET_DIR)/etc/sysctl.d/forward.conf $(TARGET_DIR)/etc/sysctl.d/forward.conf
endef endef

View File

@ -37,23 +37,23 @@ endef
define HYPERV_DAEMONS_INSTALL_INIT_SYSTEMD define HYPERV_DAEMONS_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/hyperv-daemons/70-hv_fcopy.rules \ $(HYPERV_DAEMONS_PKGDIR)/70-hv_fcopy.rules \
$(TARGET_DIR)/etc/udev/rules.d/70-hv_fcopy.rules $(TARGET_DIR)/etc/udev/rules.d/70-hv_fcopy.rules
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/hyperv-daemons/70-hv_kvp.rules \ $(HYPERV_DAEMONS_PKGDIR)/70-hv_kvp.rules \
$(TARGET_DIR)/etc/udev/rules.d/70-hv_kvp.rules $(TARGET_DIR)/etc/udev/rules.d/70-hv_kvp.rules
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/hyperv-daemons/70-hv_vss.rules \ $(HYPERV_DAEMONS_PKGDIR)/70-hv_vss.rules \
$(TARGET_DIR)/etc/udev/rules.d/70-hv_vss.rules $(TARGET_DIR)/etc/udev/rules.d/70-hv_vss.rules
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/hyperv-daemons/hv_fcopy_daemon.service \ $(HYPERV_DAEMONS_PKGDIR)/hv_fcopy_daemon.service \
$(TARGET_DIR)/usr/lib/systemd/system/hv_fcopy_daemon.service $(TARGET_DIR)/usr/lib/systemd/system/hv_fcopy_daemon.service
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/hyperv-daemons/hv_kvp_daemon.service \ $(HYPERV_DAEMONS_PKGDIR)/hv_kvp_daemon.service \
$(TARGET_DIR)/usr/lib/systemd/system/hv_kvp_daemon.service $(TARGET_DIR)/usr/lib/systemd/system/hv_kvp_daemon.service
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/hyperv-daemons/hv_vss_daemon.service \ $(HYPERV_DAEMONS_PKGDIR)/hv_vss_daemon.service \
$(TARGET_DIR)/usr/lib/systemd/system/hv_vss_daemon.service $(TARGET_DIR)/usr/lib/systemd/system/hv_vss_daemon.service
ln -fs /usr/lib/systemd/system/hv_fcopy_daemon.service \ ln -fs /usr/lib/systemd/system/hv_fcopy_daemon.service \

View File

@ -28,7 +28,7 @@ endef
define VBOX_GUEST_INSTALL_INIT_SYSTEMD define VBOX_GUEST_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 \ $(INSTALL) -D -m 644 \
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/vbox-guest/vboxservice.service \ $(VBOX_GUEST_PKGDIR)/vboxservice.service \
$(TARGET_DIR)/usr/lib/systemd/system/vboxservice.service $(TARGET_DIR)/usr/lib/systemd/system/vboxservice.service
ln -fs /usr/lib/systemd/system/vboxservice.service \ ln -fs /usr/lib/systemd/system/vboxservice.service \

View File

@ -91,28 +91,34 @@ if [[ "${procs}" != "" ]]; then
kill -9 ${procs} || true kill -9 ${procs} || true
fi fi
# Quickly notice misconfigured test roots
mkdir -p "${TEST_ROOT}"
# Cleanup stale test outputs. # Cleanup stale test outputs.
echo "" echo ""
echo ">> Cleaning up after previous test runs ..." echo ">> Cleaning up after previous test runs ..."
for entry in $(ls ${TEST_ROOT}); do
for stale_dir in ${TEST_ROOT}/*; do echo "* Cleaning stale test path: ${entry}"
echo "* Cleaning stale test root: ${stale_dir}" for tunnel in $(find ${entry} -name tunnels.json -type f); do
for tunnel in $(find ${stale_dir} -name tunnels.json -type f); do
env MINIKUBE_HOME="$(dirname ${tunnel})" ${MINIKUBE_BIN} tunnel --cleanup || true env MINIKUBE_HOME="$(dirname ${tunnel})" ${MINIKUBE_BIN} tunnel --cleanup || true
done done
for home in $(find ${stale_dir} -name .minikube -type d); do for home in $(find ${entry} -name .minikube -type d); do
env MINIKUBE_HOME="$(dirname ${home})" ${MINIKUBE_BIN} delete || true env MINIKUBE_HOME="$(dirname ${home})" ${MINIKUBE_BIN} delete || true
sudo rm -Rf "${home}" sudo rm -Rf "${home}"
done done
for kconfig in $(find ${stale_dir} -name kubeconfig -type f); do for kconfig in $(find ${entry} -name kubeconfig -type f); do
sudo rm -f "${kconfig}" sudo rm -f "${kconfig}"
done done
rm -f "${stale_dir}/*" || true # Be very specific to avoid accidentally deleting other items, like wildcards or devices
rmdir "${stale_dir}" || ls "${stale_dir}" if [[ -d "${entry}" ]]; then
rm -Rf "${entry}" || true
elif [[ -f "${entry}" ]]; then
rm -f "${entry}" || true
fi
done done
# sometimes tests left over zombie procs that won't exit # sometimes tests left over zombie procs that won't exit
@ -133,19 +139,17 @@ if type -P virsh; then
virsh -c qemu:///system list --all || true virsh -c qemu:///system list --all || true
fi fi
if type -P vboxmanage; then if type -P vboxmanage; then
vboxmanage list vms || true for guid in $(vboxmanage list vms | egrep -Eo '\{[-a-Z0-9]+\}'); do
# remove inaccessible stale VMs https://github.com/kubernetes/minikube/issues/4872 echo "- Removing stale VirtualBox VM: $guid"
vboxmanage list vms \ vboxmanage startvm $guid --type emergencystop || true
| grep inaccessible \ vboxmanage unregistervm $guid || true
| cut -d'"' -f3 \ done
| xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
|| true vboxmanage list hostonlyifs \
vboxmanage list vms \ | grep "^Name:" \
| egrep -o '{.*?}' \ | awk '{ print $2 }' \
| xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \ | xargs -n1 vboxmanage hostonlyif remove || true
|| true
echo ">> VirtualBox VM list after clean up (should be empty):" echo ">> VirtualBox VM list after clean up (should be empty):"
vboxmanage list vms || true vboxmanage list vms || true
@ -254,7 +258,7 @@ cleanup_stale_routes || true
${SUDO_PREFIX} rm -Rf "${MINIKUBE_HOME}" || true ${SUDO_PREFIX} rm -Rf "${MINIKUBE_HOME}" || true
${SUDO_PREFIX} rm -f "${KUBECONFIG}" || true ${SUDO_PREFIX} rm -f "${KUBECONFIG}" || true
${SUDO_PREFIX} rmdir "${TEST_HOME}" || true rmdir "${TEST_HOME}"
echo ">> ${TEST_HOME} completed at $(date)" echo ">> ${TEST_HOME} completed at $(date)"
if [[ "${MINIKUBE_LOCATION}" != "master" ]]; then if [[ "${MINIKUBE_LOCATION}" != "master" ]]; then

View File

@ -698,6 +698,7 @@ func generateConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, er
KubernetesVersion string KubernetesVersion string
EtcdDataDir string EtcdDataDir string
NodeName string NodeName string
DNSDomain string
CRISocket string CRISocket string
ImageRepository string ImageRepository string
ExtraArgs []ComponentExtraArgs ExtraArgs []ComponentExtraArgs
@ -717,6 +718,7 @@ func generateConfig(k8s config.KubernetesConfig, r cruntime.Manager) ([]byte, er
ExtraArgs: extraComponentConfig, ExtraArgs: extraComponentConfig,
FeatureArgs: kubeadmFeatureArgs, FeatureArgs: kubeadmFeatureArgs,
NoTaintMaster: false, // That does not work with k8s 1.12+ NoTaintMaster: false, // That does not work with k8s 1.12+
DNSDomain: k8s.DNSDomain,
} }
if k8s.ServiceCIDR != "" { if k8s.ServiceCIDR != "" {

View File

@ -235,6 +235,67 @@ func recentReleases() ([]string, error) {
return versions, nil return versions, nil
} }
/**
Need a separate test function to test the DNS server IP
as v1.11 yaml file is very different compared to v1.12+.
This test case has only 1 thing to test and that is the
nnetworking/dnsDomain value
*/
func TestGenerateConfigDNS(t *testing.T) {
versions := []string{"v1.16", "v1.15", "v1.14", "v1.13", "v1.12"}
tests := []struct {
name string
runtime string
shouldErr bool
cfg config.KubernetesConfig
}{
{"dns", "docker", false, config.KubernetesConfig{DNSDomain: "1.1.1.1"}},
}
for _, version := range versions {
for _, tc := range tests {
runtime, err := cruntime.New(cruntime.Config{Type: tc.runtime})
if err != nil {
t.Fatalf("runtime: %v", err)
}
tname := tc.name + "_" + version
t.Run(tname, func(t *testing.T) {
cfg := tc.cfg
cfg.NodeIP = "1.1.1.1"
cfg.NodeName = "mk"
cfg.KubernetesVersion = version + ".0"
got, err := generateConfig(cfg, runtime)
if err != nil && !tc.shouldErr {
t.Fatalf("got unexpected error generating config: %v", err)
}
if err == nil && tc.shouldErr {
t.Fatalf("expected error but got none, config: %s", got)
}
if tc.shouldErr {
return
}
expected, err := ioutil.ReadFile(fmt.Sprintf("testdata/%s/%s.yaml", version, tc.name))
if err != nil {
t.Fatalf("unable to read testdata: %v", err)
}
diff, err := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
A: difflib.SplitLines(string(expected)),
B: difflib.SplitLines(string(got)),
FromFile: "Expected",
ToFile: "Got",
Context: 1,
})
if err != nil {
t.Fatalf("diff error: %v", err)
}
if diff != "" {
t.Errorf("unexpected diff:\n%s\n===== [RAW OUTPUT] =====\n%s", diff, got)
}
})
}
}
}
func TestGenerateConfig(t *testing.T) { func TestGenerateConfig(t *testing.T) {
extraOpts := getExtraOpts() extraOpts := getExtraOpts()
extraOptsPodCidr := getExtraOptsPodCidr() extraOptsPodCidr := getExtraOptsPodCidr()

View File

@ -84,7 +84,7 @@ etcd:
dataDir: {{.EtcdDataDir}} dataDir: {{.EtcdDataDir}}
kubernetesVersion: {{.KubernetesVersion}} kubernetesVersion: {{.KubernetesVersion}}
networking: networking:
dnsDomain: cluster.local dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}
podSubnet: {{if .PodSubnet}}{{.PodSubnet}}{{else}}""{{end}} podSubnet: {{if .PodSubnet}}{{.PodSubnet}}{{else}}""{{end}}
serviceSubnet: {{.ServiceCIDR}} serviceSubnet: {{.ServiceCIDR}}
--- ---
@ -138,7 +138,7 @@ etcd:
dataDir: {{.EtcdDataDir}} dataDir: {{.EtcdDataDir}}
kubernetesVersion: {{.KubernetesVersion}} kubernetesVersion: {{.KubernetesVersion}}
networking: networking:
dnsDomain: cluster.local dnsDomain: {{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}
podSubnet: "" podSubnet: ""
serviceSubnet: {{.ServiceCIDR}} serviceSubnet: {{.ServiceCIDR}}
--- ---

View File

@ -0,0 +1,39 @@
apiVersion: kubeadm.k8s.io/v1alpha3
kind: InitConfiguration
apiEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd
kubernetesVersion: v1.12.0
networking:
dnsDomain: 1.1.1.1
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,39 @@
apiVersion: kubeadm.k8s.io/v1alpha3
kind: InitConfiguration
apiEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
apiServerExtraArgs:
enable-admission-plugins: "Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
etcd:
local:
dataDir: /var/lib/minikube/etcd
kubernetesVersion: v1.13.0
networking:
dnsDomain: 1.1.1.1
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /var/lib/minikube/etcd
kubernetesVersion: v1.14.0
networking:
dnsDomain: 1.1.1.1
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /var/lib/minikube/etcd
kubernetesVersion: v1.15.0
networking:
dnsDomain: 1.1.1.1
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -0,0 +1,43 @@
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 1.1.1.1
bindPort: 8443
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: mk
taints: []
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
apiServer:
extraArgs:
enable-admission-plugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota"
certificatesDir: /var/lib/minikube/certs
clusterName: kubernetes
controlPlaneEndpoint: localhost:8443
dns:
type: CoreDNS
etcd:
local:
dataDir: /var/lib/minikube/etcd
kubernetesVersion: v1.16.0
networking:
dnsDomain: 1.1.1.1
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
imageGCHighThresholdPercent: 100
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"

View File

@ -161,9 +161,10 @@ func wantsColor(fd uintptr) bool {
} }
term := os.Getenv("TERM") term := os.Getenv("TERM")
colorTerm := os.Getenv("COLORTERM")
// Example: term-256color // Example: term-256color
if !strings.Contains(term, "color") { if !strings.Contains(term, "color") && !strings.Contains(colorTerm, "truecolor") && !strings.Contains(colorTerm, "24bit") && !strings.Contains(colorTerm, "yes") {
glog.Infof("TERM=%s, which probably does not support color", term) glog.Infof("TERM=%s,COLORTERM=%s, which probably does not support color", term, colorTerm)
return false return false
} }

View File

@ -8,6 +8,18 @@ resources:
title: "start" title: "start"
--- ---
<style>
.imagesizing {
width:auto;
text-align:center;
padding:10px;
}
img {
max-width:100%;
height:auto;
}
</style>
<!-- Welcome to minikube --> <!-- Welcome to minikube -->
<section class="row td-box td-box--white position-relative td-box--gradient td-box--height-auto"> <section class="row td-box td-box--white position-relative td-box--gradient td-box--height-auto">
<div class="container td-arrow-down"> <div class="container td-arrow-down">
@ -37,10 +49,10 @@ resources:
<h2>Instantly productive.</h2> <h2>Instantly productive.</h2>
A single command away from reproducing your production environment, from the comfort of localhost. A single command away from reproducing your production environment, from the comfort of localhost.
<div class = "imagesizing">
{{< imgproc "start" Fit "730x239" >}}{{< /imgproc >}} <img src="start.png"/>
</div>
<h3>Highlights</h3> <h3>Highlights</h3>
<ul class="fa-ul"> <ul class="fa-ul">
<li><i class="fas fa-check"></i> Always supports the latest Kubernetes release (as well as previous versions)</li> <li><i class="fas fa-check"></i> Always supports the latest Kubernetes release (as well as previous versions)</li>
<li><i class="fas fa-check"></i> Cross-platform (Linux, macOS, Windows)</li> <li><i class="fas fa-check"></i> Cross-platform (Linux, macOS, Windows)</li>

View File

@ -1,6 +1,6 @@
--- ---
linkTitle: "gvisor" linkTitle: "gVisor"
title: "Releasing a gvisor image" title: "Releasing a gVisor image"
date: 2019-09-25 date: 2019-09-25
weight: 10 weight: 10
--- ---
@ -13,7 +13,7 @@ weight: 10
## Background ## Background
gvisor support within minikube requires a special Docker image to be generated. After merging changes to `cmd/gvisor` or `pkg/gvisor`, this image will need to be updated. gVisor support within minikube requires a special Docker image to be generated. After merging changes to `cmd/gvisor` or `pkg/gvisor`, this image will need to be updated.
The image is located at `gcr.io/k8s-minikube/gvisor-addon` The image is located at `gcr.io/k8s-minikube/gvisor-addon`
@ -28,6 +28,6 @@ The image is located at `gcr.io/k8s-minikube/gvisor-addon`
- Updates the containerd configuration - Updates the containerd configuration
- Restarts containerd and rpc-statd - Restarts containerd and rpc-statd
## Updating the gvisor image ## Updating the gVisor image
`make push-gvisor-addon-image` `make push-gvisor-addon-image`

View File

@ -0,0 +1,21 @@
---
title: "Translations"
date: 2019-09-30
weight: 3
description: >
How to add translations
---
All translations are stored in the top-level `translations` directory.
### Adding Translations To an Existing Language
* Run `make extract` to make sure all strings are up to date
* Add translated strings to the appropriate json files in the 'translations'
directory.
### Adding a New Language
* Add a new json file with the locale code of the language you want to add
translations for, e.g. en for English.
* Run `make extract` to populate that file with the strings to translate in json
form.
* Add translations to as many strings as you'd like.

View File

@ -39,6 +39,12 @@ Enables the addon w/ADDON_NAME within minikube (example: minikube addons enable
minikube addons enable ADDON_NAME [flags] minikube addons enable ADDON_NAME [flags]
``` ```
or
```
minikube start --addons ADDON_NAME [flags]
```
## minikube addons list ## minikube addons list
Lists all available minikube addons as well as their current statuses (enabled/disabled) Lists all available minikube addons as well as their current statuses (enabled/disabled)

View File

@ -16,6 +16,7 @@ minikube start [flags]
### Options ### Options
``` ```
--addons Enable addons. see `minikube addons list` for a list of valid addon names.
--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-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-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-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

View File

@ -0,0 +1,58 @@
---
title: "DNS Domain"
linkTitle: "DNS Domain"
weight: 6
date: 2019-10-09
description: >
Use configured DNS domain in bootstrapper kubeadm
---
minikube by default uses **cluster.local** if none is specified via the start flag --dns-domain. The configuration file used by kubeadm are found inside **/var/tmp/minikube/kubeadm.yaml** directory inside minikube.
Default DNS configuration will look like below
```
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
......
......
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
.....
.....
kubernetesVersion: v1.16.0
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
```
To change the dns pass the value when starting minikube
```
minikube start --dns-domain bla.blah.blah
```
the dns now changed to bla.blah.blah
```
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
localAPIEndpoint:
......
......
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
.....
.....
kubernetesVersion: v1.16.0
networking:
dnsDomain: bla.blah.blah
podSubnet: ""
serviceSubnet: 10.96.0.0/12
---
```

View File

@ -55,6 +55,12 @@ Example output:
minikube addons enable <name> minikube addons enable <name>
``` ```
or
```shell
minikube start --addons <name>
```
## Interacting with an addon ## Interacting with an addon
For addons that expose a browser endpoint, use: For addons that expose a browser endpoint, use:

View File

@ -42,7 +42,7 @@ func TestAddons(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 40*time.Minute) ctx, cancel := context.WithTimeout(context.Background(), 40*time.Minute)
defer CleanupWithLogs(t, profile, cancel) defer CleanupWithLogs(t, profile, cancel)
args := append([]string{"start", "-p", profile, "--wait=false", "--memory=2600", "--alsologtostderr", "-v=1"}, StartArgs()...) args := append([]string{"start", "-p", profile, "--wait=false", "--memory=2600", "--alsologtostderr", "-v=1", "--addons=ingress", "--addons=registry"}, StartArgs()...)
rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) rr, err := Run(t, exec.CommandContext(ctx, Target(), args...))
if err != nil { if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err) t.Fatalf("%s failed: %v", rr.Args, err)
@ -72,11 +72,6 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
t.Skipf("skipping: ssh unsupported by none") t.Skipf("skipping: ssh unsupported by none")
} }
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "enable", "ingress"))
if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err)
}
client, err := kapi.Client(profile) client, err := kapi.Client(profile)
if err != nil { if err != nil {
t.Fatalf("kubernetes client: %v", client) t.Fatalf("kubernetes client: %v", client)
@ -89,7 +84,7 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
t.Fatalf("wait: %v", err) t.Fatalf("wait: %v", err)
} }
rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "replace", "--force", "-f", filepath.Join(*testdataDir, "nginx-ing.yaml"))) rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "replace", "--force", "-f", filepath.Join(*testdataDir, "nginx-ing.yaml")))
if err != nil { if err != nil {
t.Errorf("%s failed: %v", rr.Args, err) t.Errorf("%s failed: %v", rr.Args, err)
} }
@ -131,11 +126,6 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
} }
func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) { func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) {
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "enable", "registry"))
if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err)
}
client, err := kapi.Client(profile) client, err := kapi.Client(profile)
if err != nil { if err != nil {
t.Fatalf("kubernetes client: %v", client) t.Fatalf("kubernetes client: %v", client)
@ -155,7 +145,7 @@ func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) {
} }
// Test from inside the cluster (no curl available on busybox) // Test from inside the cluster (no curl available on busybox)
rr, err = Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "delete", "po", "-l", "run=registry-test", "--now")) rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "delete", "po", "-l", "run=registry-test", "--now"))
if err != nil { if err != nil {
t.Logf("pre-cleanup %s failed: %v (not a problem)", rr.Args, err) t.Logf("pre-cleanup %s failed: %v (not a problem)", rr.Args, err)
} }