Skip to content

Commit

Permalink
Merge pull request #3840 from afbjorklund/mdlint
Browse files Browse the repository at this point in the history
Markdown Lint (for docs)
  • Loading branch information
tstromberg authored Mar 20, 2019
2 parents 177ce65 + 667c88d commit da2b1b0
Show file tree
Hide file tree
Showing 32 changed files with 315 additions and 227 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.

9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,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 @@ -227,6 +232,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
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
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
47 changes: 23 additions & 24 deletions docs/contributors/adding_driver.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Adding new driver (Deprecated)

New drivers should be added into https://github.com/machine-drivers
New drivers should be added into <https://github.com/machine-drivers>

Minikube relies on docker machine drivers to manage machines. This document talks about how to
add an existing docker machine driver into minikube registry, so that minikube can use the driver
Expand All @@ -26,7 +26,7 @@ Registry is what minikube uses to register all the supported drivers. The driver
their drivers in registry, and minikube runtime will look at the registry to find a driver and use the
driver metadata to determine what workflow to apply while those drivers are being used.

The godoc of registry is available here: https://godoc.org/k8s.io/minikube/pkg/minikube/registry
The godoc of registry is available here: <https://godoc.org/k8s.io/minikube/pkg/minikube/registry>

[DriverDef](https://godoc.org/k8s.io/minikube/pkg/minikube/registry#DriverDef) is the main
struct to define a driver metadata. Essentially, you need to define 4 things at most, which is
Expand All @@ -52,33 +52,33 @@ All drivers are located in `k8s.io/minikube/pkg/minikube/drivers`. Take `vmwaref
package vmwarefusion

import (
"github.com/docker/machine/drivers/vmwarefusion"
"github.com/docker/machine/libmachine/drivers"
cfg "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/registry"
"github.com/docker/machine/drivers/vmwarefusion"
"github.com/docker/machine/libmachine/drivers"
cfg "k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/registry"
)

func init() {
registry.Register(registry.DriverDef{
Name: "vmwarefusion",
Builtin: true,
ConfigCreator: createVMwareFusionHost,
DriverCreator: func() drivers.Driver {
return vmwarefusion.NewDriver("", "")
},
})
registry.Register(registry.DriverDef{
Name: "vmwarefusion",
Builtin: true,
ConfigCreator: createVMwareFusionHost,
DriverCreator: func() drivers.Driver {
return vmwarefusion.NewDriver("", "")
},
})
}

func createVMwareFusionHost(config cfg.MachineConfig) interface{} {
d := vmwarefusion.NewDriver(cfg.GetMachineName(), constants.GetMinipath()).(*vmwarefusion.Driver)
d.Boot2DockerURL = config.Downloader.GetISOFileURI(config.MinikubeISO)
d.Memory = config.Memory
d.CPU = config.CPUs
d.DiskSize = config.DiskSize
d.SSHPort = 22
d.ISO = d.ResolveStorePath("boot2docker.iso")
return d
d := vmwarefusion.NewDriver(cfg.GetMachineName(), constants.GetMinipath()).(*vmwarefusion.Driver)
d.Boot2DockerURL = config.Downloader.GetISOFileURI(config.MinikubeISO)
d.Memory = config.Memory
d.CPU = config.CPUs
d.DiskSize = config.DiskSize
d.SSHPort = 22
d.ISO = d.ResolveStorePath("boot2docker.iso")
return d
}
```

Expand All @@ -98,4 +98,3 @@ In summary, the process includes the following steps:
2. Add import in `pkg/minikube/cluster/default_drivers.go`

Any Questions: please ping your friend [@anfernee](https://github.com/anfernee)

23 changes: 16 additions & 7 deletions docs/contributors/build_guide.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
### Build Requirements
# Build Guide

## Build Requirements

* A recent Go distribution (>=1.12)
* If you're not on Linux, you'll need a Docker installation
* minikube requires at least 4GB of RAM to compile, which can be problematic when using docker-machine

#### Prerequisites for different GNU/Linux distributions
### Prerequisites for different GNU/Linux distributions

##### Fedora
On Fedora you need to install _glibc-static_
#### Fedora

On Fedora you need to install _glibc-static_
```shell
$ sudo dnf install -y glibc-static
```

### Building from Source
Clone minikube into your go path under `$GOPATH/src/k8s.io`

Clone minikube into your go path under `$GOPATH/src/k8s.io`
```shell
$ git clone https://github.com/kubernetes/minikube.git $GOPATH/src/k8s.io/minikube
$ cd $GOPATH/src/k8s.io/minikube
Expand All @@ -25,20 +28,23 @@ Note: Make sure that you uninstall any previous versions of minikube before buil
from the source.

### Building from Source in Docker (using Debian stretch image with golang)

Clone minikube:
```shell
$ git clone https://github.com/kubernetes/minikube.git
```

Build (cross compile for linux / OS X and Windows) using make:
```shell
$ cd minikube
$ docker run --rm -v "$PWD":/go/src/k8s.io/minikube -w /go/src/k8s.io/minikube golang:stretch make cross
```

Check "out" directory:
```shell
$ ls out/
docker-machine-driver-hyperkit.d minikube minikube.d test.d
docker-machine-driver-kvm2.d minikube-linux-amd64 storage-provisioner.d
docker-machine-driver-hyperkit.d minikube minikube.d test.d
docker-machine-driver-kvm2.d minikube-linux-amd64 storage-provisioner.d
```

### Run Instructions
Expand Down Expand Up @@ -77,11 +83,14 @@ You can run these against minikube by following these steps:
* Run `make quick-release` in the k8s repo.
* Start up a minikube cluster with: `minikube start`.
* Set following two environment variables:

```shell
export KUBECONFIG=$HOME/.kube/config
export KUBERNETES_CONFORMANCE_TEST=y
```

* Run the tests (from the k8s repo):

```shell
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]" --check-version-skew=false
```
Expand Down
Loading

0 comments on commit da2b1b0

Please sign in to comment.