Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into custom-image-reposi…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
laozc committed Mar 21, 2019
2 parents 40caf83 + 2579c73 commit 859bf1c
Show file tree
Hide file tree
Showing 51 changed files with 723 additions and 283 deletions.
8 changes: 8 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"no-inline-html": false,
"no-trailing-punctuation": false,
"blanks-around-fences": false,
"commands-show-output": false,
"ul-style": false,
"line-length": false
}
128 changes: 85 additions & 43 deletions CHANGELOG.md

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ HYPERKIT_BUILD_IMAGE ?= karalabe/xgo-1.10.x
# NOTE: "latest" as of 2018-12-04. kube-cross images aren't updated as often as Kubernetes
BUILD_IMAGE ?= k8s.gcr.io/kube-cross:v1.11.1-1
ISO_BUILD_IMAGE ?= $(REGISTRY)/buildroot-image
KVM_BUILD_IMAGE ?= $(REGISTRY)/kvm-build-image

ISO_BUCKET ?= minikube/iso

MINIKUBE_VERSION ?= $(ISO_VERSION)
Expand All @@ -38,6 +40,8 @@ MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}

KERNEL_VERSION ?= 4.16.14

GO_VERSION ?= $(shell go version | cut -d' ' -f3 | sed -e 's/go//')

GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
GOPATH ?= $(shell go env GOPATH)
Expand Down Expand Up @@ -66,6 +70,11 @@ KVM_DRIVER_FILES := ./cmd/drivers/kvm/

MINIKUBE_TEST_FILES := ./cmd/... ./pkg/...

# npm install -g markdownlint-cli
MARKDOWNLINT ?= markdownlint

MINIKUBE_MARKDOWN_FILES := README.md docs CONTRIBUTING.md CHANGELOG.md

MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
SOURCE_DIRS = cmd pkg test
Expand Down Expand Up @@ -99,7 +108,7 @@ out/minikube.d: pkg/minikube/assets/assets.go
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $^ $(MINIKUBEFILES) > $@

-include out/minikube.d
out/minikube-%-$(GOARCH): pkg/minikube/assets/assets.go
out/minikube-%: pkg/minikube/assets/assets.go
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
Expand All @@ -114,7 +123,7 @@ ifneq ($(GOPATH)/src/$(REPOPATH),$(CURDIR))
$(warning https://github.com/kubernetes/minikube/blob/master/docs/contributors/build_guide.md)
$(warning ******************************************************************************)
endif
GOOS=$* GOARCH=$(GOARCH) go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
endif

.PHONY: e2e-%-amd64
Expand Down Expand Up @@ -227,6 +236,10 @@ gendocs: out/docs/minikube.md
fmt:
@gofmt -l -s -w $(SOURCE_DIRS)

.PHONY: mdlint
mdlint:
@$(MARKDOWNLINT) $(MINIKUBE_MARKDOWN_FILES)

out/docs/minikube.md: $(shell find cmd) $(shell find pkg/minikube/constants) pkg/minikube/assets/assets.go
cd $(GOPATH)/src/$(REPOPATH) && go run -ldflags="$(MINIKUBE_LDFLAGS)" hack/gen_help_text.go

Expand Down Expand Up @@ -256,7 +269,7 @@ out/minikube-%-amd64.tar.gz: $$(TAR_TARGETS_$$*) $(TAR_TARGETS_ALL)
tar -cvf $@ $^

.PHONY: cross-tars
cross-tars: out/minikube-windows-amd64.tar.gz out/minikube-linux-amd64.tar.gz out/minikube-darwin-amd64.tar.gz
cross-tars: kvm_in_docker out/minikube-windows-amd64.tar.gz out/minikube-linux-amd64.tar.gz out/minikube-darwin-amd64.tar.gz

out/minikube-installer.exe: out/minikube-windows-amd64.exe
rm -rf out/windows_tmp
Expand Down Expand Up @@ -349,10 +362,22 @@ out/docker-machine-driver-kvm2:
k8s.io/minikube/cmd/drivers/kvm
chmod +X $@

kvm-image: $(KVM_BUILD_IMAGE) # convenient alias to build the docker container
$(KVM_BUILD_IMAGE): installers/linux/kvm/Dockerfile
docker build --build-arg "GO_VERSION=$(GO_VERSION)" -t $@ -f $< $(dir $<)
@echo ""
@echo "$(@) successfully built"

kvm_in_docker:
docker inspect $(KVM_BUILD_IMAGE) || $(MAKE) $(KVM_BUILD_IMAGE)
rm -f out/docker-machine-driver-kvm2
docker run --rm -v $(PWD):/go/src/k8s.io/minikube $(KVM_BUILD_IMAGE) \
/usr/bin/make -C /go/src/k8s.io/minikube out/docker-machine-driver-kvm2

.PHONY: install-kvm
install-kvm: out/docker-machine-driver-kvm2
cp out/docker-machine-driver-kvm2 $(GOBIN)/docker-machine-driver-kvm2

.PHONY: release-kvm-driver
release-kvm-driver: install-kvm
release-kvm-driver: kvm_in_docker install-kvm
gsutil cp $(GOBIN)/docker-machine-driver-kvm2 gs://minikube/drivers/kvm/$(VERSION)/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## What is minikube?

minikube implements a local Kubernetes cluster on macOS, Linux, and Windows.
minikube implements a local Kubernetes cluster on macOS, Linux, and Windows.

<img src="https://github.com/kubernetes/minikube/raw/master/images/start.jpg" width="800">

Expand All @@ -31,7 +31,7 @@ Our [goal](https://github.com/kubernetes/minikube/blob/master/docs/contributors/

minikube runs the official stable release of Kubernetes, with support for standard Kubernetes features like:

* [LoadBalancer](https://github.com/kubernetes/minikube/blob/master/docs/tunnel.md) - using `minikube tunnel`
* [LoadBalancer](https://github.com/kubernetes/minikube/blob/master/docs/tunnel.md) - using `minikube tunnel`
* Multi-cluster - using `minikube start -p <name>`
* NodePorts - using `minikube service`
* [Persistent Volumes](https://github.com/kubernetes/minikube/blob/master/docs/persistent_volumes.md)
Expand All @@ -56,7 +56,7 @@ As well as developer-friendly features:

## Community

minikube is a Kubernetes [#sig-cluster-lifecycle](https://github.com/kubernetes/community/tree/master/sig-cluster-lifecycle) project.
minikube is a Kubernetes [#sig-cluster-lifecycle](https://github.com/kubernetes/community/tree/master/sig-cluster-lifecycle) project.

* [**#minikube on Kubernetes Slack**](https://kubernetes.slack.com) - Live chat with minikube developers!
* [minikube-users mailing list](https://groups.google.com/forum/#!forum/minikube-users)
Expand All @@ -81,7 +81,7 @@ See the [installation guide](https://kubernetes.io/docs/tasks/tools/install-mini
* using [chocolatey](https://chocolatey.org/) `choco install minikube`
* manually: Download and run the [installer](https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe)

* *Linux*
* *Linux*
* Requires either the [kvm2 driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver) (recommended), or VirtualBox
* VT-x/AMD-v virtualization must be enabled in BIOS
* manually: `curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && sudo install minikube-linux-amd64 /usr/local/bin/minikube`
Expand Down
13 changes: 9 additions & 4 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ func runStart(cmd *cobra.Command, args []string) {
console.Failure("Unable to load cached images from config file.")
}

if config.MachineConfig.VMDriver == constants.DriverNone {
console.OutStyle("starting-none", "Configuring local host environment ...")
prepareNone()
}

if kubeconfig.KeepContext {
console.OutStyle("kubectl", "To connect to this cluster, use: kubectl --context=%s", kubeconfig.ClusterName)
} else {
Expand Down Expand Up @@ -345,10 +350,6 @@ func startHost(api libmachine.API, mc cfg.MachineConfig) (*host.Host, bool) {
if err != nil {
exit.WithError("Failed to check if machine exists", err)
}
if mc.VMDriver == constants.DriverNone {
console.OutStyle("starting-none", "Configuring local host environment ...")
prepareNone()
}

var host *host.Host
start := func() (err error) {
Expand Down Expand Up @@ -482,6 +483,10 @@ func configureRuntimes(h *host.Host, runner bootstrapper.CommandRunner) cruntime
if err != nil {
exit.WithError("Failed to enable container runtime", err)
}
version, err := cr.Version()
if err == nil {
console.OutStyle(cr.Name(), "Version of container runtime is %s", version)
}
return cr
}

Expand Down
2 changes: 1 addition & 1 deletion deploy/addons/ingress/ingress-dp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
serviceAccountName: nginx-ingress
terminationGracePeriodSeconds: 60
containers:
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.21.0
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.23.0
name: nginx-ingress-controller
imagePullPolicy: IfNotPresent
readinessProbe:
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Advanced Topics and Tutorials
# Advanced Topics and Tutorials

### Cluster Configuration
## Cluster Configuration

* **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube with rkt as the container runtime

Expand Down
7 changes: 5 additions & 2 deletions docs/accessing_etcd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Accessing Host Resources From Inside A Pod
### When you have a VirtualBox driver
# Accessing Host Resources From Inside A Pod

## When you have a VirtualBox driver

In order to access host resources from inside a pod, run the following command to determine the host IP you can use:

```shell
ip addr
```
Expand Down
4 changes: 3 additions & 1 deletion docs/addons.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Add-ons
# Add-ons

Minikube has a set of built in addons that can be used enabled, disabled, and opened inside of the local k8s environment. Below is an example of this functionality for the `heapster` addon:

```shell
$ minikube addons list
- registry: disabled
Expand All @@ -26,6 +27,7 @@ Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Created new window in existing browser session.
```

The currently supported addons include:

* [Kubernetes Dashboard](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard)
Expand Down
9 changes: 5 additions & 4 deletions docs/alternative_runtimes.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
### Using rkt container engine
# Alternative runtimes

## Using rkt container engine

To use [rkt](https://github.com/coreos/rkt) as the container runtime run:

```shell
$ minikube start --container-runtime=rkt
```


### Using CRI-O
## Using CRI-O

To use [CRI-O](https://github.com/kubernetes-sigs/cri-o) as the container runtime, run:

Expand All @@ -27,7 +28,7 @@ $ minikube start --container-runtime=cri-o \
--extra-config=kubelet.image-service-endpoint=unix:///var/run/crio/crio.sock
```

### Using containerd
## Using containerd

To use [containerd](https://github.com/containerd/containerd) as the container runtime, run:

Expand Down
2 changes: 1 addition & 1 deletion docs/cache.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Caching Images
# Caching Images

Minikube supports caching non-minikube images using the `minikube cache` command. Images can be added to the cache by running `minikube cache add <img>`, and deleted by running `minikube cache delete <img>`.

Expand Down
4 changes: 2 additions & 2 deletions docs/configuring_kubernetes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Configuring Kubernetes
# Configuring Kubernetes

Minikube has a "configurator" feature that allows users to configure the Kubernetes components with arbitrary values.
To use this feature, you can use the `--extra-config` flag on the `minikube start` command.

This flag is repeated, so you can pass it several times with several different values to set multiple options.

### Kubeadm bootstrapper
## Kubeadm bootstrapper

The kubeadm bootstrapper can be configured by the `--extra-config` flag on the `minikube start` command. It takes a string of the form `component.key=value` where `component` is one of the strings

Expand Down
4 changes: 3 additions & 1 deletion docs/contributors/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
## Contributing
# Contributing

* **New contributors** ([contributors.md](https://github.com/kubernetes/minikube/blob/master/CONTRIBUTING.md)): Process for new contributors, CLA instructions

* **Roadmap** ([roadmap.md](roadmap.md)): The roadmap for future minikube development

## New Features and Dependencies

* **Adding a dependency** ([adding_a_dependency.md](adding_a_dependency.md)): How to add or update vendored code

* **Adding a new addon** ([adding_an_addon.md](adding_an_addon.md)): How to add a new addon to minikube for `minikube addons`

* **Adding a new driver** ([adding_driver.md](adding_driver.md)): How to add a new driver to minikube for `minikube create --vm-driver=<driver>`

## Building and Releasing

* **Build Guide** ([build_guide.md](build_guide.md)): How to build minikube from source

* **ISO Build Guide** ([minikube_iso.md](minikube_iso.md)): How to build and hack on the ISO image that minikube uses
Expand Down
3 changes: 2 additions & 1 deletion docs/contributors/adding_a_dependency.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#### Adding a New Dependency
# Adding a New Dependency

Minikube uses `dep` to manage vendored dependencies.

See the `dep` [documentation](https://golang.github.io/dep/docs/introduction.html) for installation and usage instructions.
Expand Down
47 changes: 24 additions & 23 deletions docs/contributors/adding_an_addon.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#### Adding a New Addon
# Adding a New Addon

To add a new addon to minikube the following steps are required:

* For the new addon's .yaml file(s):
Expand All @@ -15,12 +16,12 @@ To add a new addon to minikube the following steps are required:
var settings = []Setting{
...,
// add other addon setting
{
name: "efk",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "efk",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
}
```

Expand All @@ -32,22 +33,22 @@ To add a new addon to minikube the following steps are required:
...,
// add other addon asset
"efk": NewAddon([]*BinDataAsset{
NewBinDataAsset(
"deploy/addons/efk/efk-configmap.yaml",
constants.AddonsPath,
"efk-configmap.yaml",
"0640"),
NewBinDataAsset(
"deploy/addons/efk/efk-rc.yaml",
constants.AddonsPath,
"efk-rc.yaml",
"0640"),
NewBinDataAsset(
"deploy/addons/efk/efk-svc.yaml",
constants.AddonsPath,
"efk-svc.yaml",
"0640"),
}, false, "efk"),
NewBinDataAsset(
"deploy/addons/efk/efk-configmap.yaml",
constants.AddonsPath,
"efk-configmap.yaml",
"0640"),
NewBinDataAsset(
"deploy/addons/efk/efk-rc.yaml",
constants.AddonsPath,
"efk-rc.yaml",
"0640"),
NewBinDataAsset(
"deploy/addons/efk/efk-svc.yaml",
constants.AddonsPath,
"efk-svc.yaml",
"0640"),
}, false, "efk"),
}
```

Expand Down
Loading

0 comments on commit 859bf1c

Please sign in to comment.