Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add missing language to code blocks
  • Loading branch information
edtrist committed Dec 1, 2020
1 parent 2c6dc34 commit f6a770e
Show file tree
Hide file tree
Showing 21 changed files with 179 additions and 75 deletions.
20 changes: 15 additions & 5 deletions site/content/en/docs/contrib/addons.en.md
Expand Up @@ -9,23 +9,33 @@ description: >

To create an addon, first fork the minikube repository, and check out your fork:

`git clone git@github.com:<username>/minikube.git`
```shell
git clone git@github.com:<username>/minikube.git
```

Then go into the source directory:

`cd minikube`
```shell
cd minikube
```

Create a subdirectory:

`mkdir deploy/addons/<addon name>`
```shell
mkdir deploy/addons/<addon name>
```

Add your manifest YAML's to the directory you have created:

`cp *.yaml deploy/addons/<addon name>`
```shell
cp *.yaml deploy/addons/<addon name>
```

Note: If the addon never needs authentication to GCP, then consider adding the following label to the pod's yaml:

`gcp-auth-skip-secret: "true"`
```yaml
gcp-auth-skip-secret: "true"
```

To make the addon appear in `minikube addons list`, add it to `pkg/addons/config.go`. Here is the entry used by the `registry` addon, which will work for any addon which does not require custom code:

Expand Down
8 changes: 6 additions & 2 deletions site/content/en/docs/contrib/documentation.en.md
Expand Up @@ -22,7 +22,9 @@ Use Github's repositories and markdown editor as described by [Kubernetes's gene

To serve documentation pages locally, clone the `minikube` repository and run:

`make site`
```shell
make site
```

Notes :

Expand All @@ -33,7 +35,9 @@ Notes :

We recommend installing [markdownlint](https://github.com/markdownlint/markdownlint) to find issues with your markdown file. Once installed, you can use this handy target:

`make mdlint`
```shell
make mdlint
```

## Style Guidelines

Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/contrib/json_output.en.md
Expand Up @@ -12,7 +12,7 @@ You may need to add logs to the registry if the `TestJSONOutput` integration tes
### Background
minikube provides JSON output for `minikube start`, accesible via the `--output` flag:

```
```shell
minikube start --output json
```

Expand Down Expand Up @@ -61,7 +61,7 @@ You will need to add your new log in two places:

Finally, set your new step in the cod by placing this line before you call `out.T`:

```
```go
register.Reg.SetStep(register.MyNewStep)
```

Expand Down
4 changes: 3 additions & 1 deletion site/content/en/docs/contrib/releasing/gvisor.md
Expand Up @@ -30,4 +30,6 @@ The image is located at `gcr.io/k8s-minikube/gvisor-addon`

## Updating the gVisor image

`make push-gvisor-addon-image`
```shell
make push-gvisor-addon-image
```
9 changes: 6 additions & 3 deletions site/content/en/docs/faq/_index.md
Expand Up @@ -22,15 +22,18 @@ Alternatively, configure `sudo` to never prompt for the commands issued by minik

minikube's bootstrapper, [Kubeadm](https://github.com/kubernetes/kubeadm) verifies a list of features on the host system before installing Kubernetes. in case you get this error, and you still want to try minikube anyways despite your system's limitation you can skip the verification by starting minikube with this extra option:

`minikube start --extra-config kubeadm.ignore-preflight-errors=SystemVerification`
```shell
minikube start --extra-config kubeadm.ignore-preflight-errors=SystemVerification
```

## what is the resource allocation for Knative Setup using minikube?

Please allocate sufficient resources for Knative setup using minikube, especially when you run a minikube cluster on your local machine. We recommend allocating at least 6 CPUs and 8G memory.

`minikube start --cpus 6 --memory 8000`
```shell
minikube start --cpus 6 --memory 8000
```

## Do I need to install kubectl locally?

No, minikube comes with built-in kubectl [see minikube's kubectl documentation]({{< ref "docs/handbook/kubectl.md" >}}).

20 changes: 13 additions & 7 deletions site/content/en/docs/handbook/accessing.md
Expand Up @@ -24,21 +24,27 @@ A NodePort service is the most basic way to get external traffic directly to you

We also have a shortcut for fetching the minikube IP and a service's `NodePort`:

`minikube service --url $SERVICE`
```shell
minikube service --url $SERVICE
```

## Getting the NodePort using kubectl

The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command. Any services of type `NodePort` can be accessed over that IP address, on the NodePort.

To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output):

`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'`
```shell
kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'
```

### Increasing the NodePort range

By default, minikube only exposes ports 30000-32767. If this does not work for you, you can adjust the range by using:

`minikube start --extra-config=apiserver.service-node-port-range=1-65535`
```shell
minikube start --extra-config=apiserver.service-node-port-range=1-65535
```

This flag also accepts a comma separated list of ports and port ranges.

Expand All @@ -57,7 +63,7 @@ Services of type `LoadBalancer` can be exposed via the `minikube tunnel` command
#### Run tunnel in a separate terminal
it will ask for password.

```
```shell
minikube tunnel
```

Expand Down Expand Up @@ -88,16 +94,16 @@ Status:


#### Create a kubernetes deployment
```
```shell
kubectl create deployment hello-minikube1 --image=k8s.gcr.io/echoserver:1.4
```
#### Create a kubernetes service type LoadBalancer
```
```shell
kubectl expose deployment hello-minikube1 --type=LoadBalancer --port=8080
```

### Check external IP
```
```shell
kubectl get svc
```
<pre>
Expand Down
17 changes: 13 additions & 4 deletions site/content/en/docs/handbook/addons/gcp-auth.md
Expand Up @@ -8,8 +8,11 @@ date: 2020-07-15
If you have a containerized GCP app with a Kubernetes yaml, you can automatically add your credentials to all your deployed pods dynamically with this minikube addon. You just need to have a credentials file, which can be generated with `gcloud auth application-default login`. If you already have a json credentials file you want specify, use the GOOGLE_APPLICATION_CREDENTIALS environment variable.

- Start a cluster:
```
```shell
minikube start
```

```
😄 minikube v1.12.0 on Darwin 10.15.5
✨ Automatically selected the docker driver. Other choices: hyperkit, virtualbox
👍 Starting control plane node minikube in cluster minikube
Expand All @@ -21,23 +24,29 @@ minikube start
```

- Enable the `gcp-auth` addon:
```
```shell
minikube addons enable gcp-auth
```

```
🔎 Verifying gcp-auth addon...
📌 Your GCP credentials will now be mounted into every pod created in the minikube cluster.
📌 If you don't want credential mounted into a specific pod, add a label with the `gcp-auth-skip-secret` key to your pod configuration.
🌟 The 'gcp-auth' addon is enabled
```

- For credentials in an arbitrary path:
```
```shell
export GOOGLE_APPLICATION_CREDENTIALS=<creds-path>.json
minikube addons enable gcp-auth
```

- Deploy your GCP app as normal:
```
```shell
kubectl apply -f test.yaml
```

```
deployment.apps/pytest created
```

Expand Down
4 changes: 3 additions & 1 deletion site/content/en/docs/handbook/config.md
Expand Up @@ -49,7 +49,9 @@ This flag is repeated, so you can pass it several times with several different v

By default, minikube installs the latest stable version of Kubernetes that was available at the time of the minikube release. You may select a different Kubernetes release by using the `--kubernetes-version` flag, for example:

`minikube start --kubernetes-version=v1.11.10`
```shell
minikube start --kubernetes-version=v1.11.10
```

minikube follows the [Kubernetes Version and Version Skew Support Policy](https://kubernetes.io/docs/setup/version-skew-policy/), so we guarantee support for the latest build for the last 3 minor Kubernetes releases. When practical, minikube aims to support older releases as well so that users can emulate legacy environments.

Expand Down
40 changes: 30 additions & 10 deletions site/content/en/docs/handbook/controls.md
Expand Up @@ -10,40 +10,60 @@ aliases:

Start a cluster by running:

`minikube start`
```shell
minikube start
```

Access the Kubernetes Dashboard running within the minikube cluster:

`minikube dashboard`
```shell
minikube dashboard
```

Once started, you can interact with your cluster using `kubectl`, just like any other Kubernetes cluster. For instance, starting a server:

`kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4`
```shell
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
```

Exposing a service as a NodePort

`kubectl expose deployment hello-minikube --type=NodePort --port=8080`
```shell
kubectl expose deployment hello-minikube --type=NodePort --port=8080
```

minikube makes it easy to open this exposed endpoint in your browser:

`minikube service hello-minikube`
```shell
minikube service hello-minikube
```

Upgrade your cluster:

`minikube start --kubernetes-version=latest`
```shell
minikube start --kubernetes-version=latest
```

Start a second local cluster (_note: This will not work if minikube is using the bare-metal/none driver_):

`minikube start -p cluster2`
```shell
minikube start -p cluster2
```

Stop your local cluster:

`minikube stop`
```shell
minikube stop
```

Delete your local cluster:

`minikube delete`
```shell
minikube delete
```

Delete all local clusters and profiles

`minikube delete --all`
```shell
minikube delete --all
```
2 changes: 1 addition & 1 deletion site/content/en/docs/handbook/deploying.md
Expand Up @@ -10,7 +10,7 @@ aliases:

## kubectl

```
```shell
kubectl create deployment hello-minikube1 --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-minikube1 --type=LoadBalancer --port=8080
```
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/handbook/filesync.md
Expand Up @@ -22,7 +22,7 @@ Place files to be synced in `$MINIKUBE_HOME/files`

For example, running the following will result in the deployment of a custom /etc/resolv.conf:

```
```shell
mkdir -p ~/.minikube/files/etc
echo nameserver 8.8.8.8 > ~/.minikube/files/etc/resolv.conf
minikube start
Expand Down
24 changes: 18 additions & 6 deletions site/content/en/docs/handbook/kubectl.md
Expand Up @@ -12,29 +12,41 @@ inside minikube when the `minikube start` command is executed.

However if `kubectl` is not installed locally, minikube already includes kubectl which can be used like this:

`minikube kubectl -- <kubectl commands>`
```shell
minikube kubectl -- <kubectl commands>
```

You can also `alias kubectl="minikube kubectl --"` for easier usage.

Alternatively, you can create a symbolic link to minikube's binary named 'kubectl'.

`ln -s $(which minikube) /usr/local/bin/kubectl`
```shell
ln -s $(which minikube) /usr/local/bin/kubectl
```

Get pods

`minikube kubectl -- get pods`
```shell
minikube kubectl -- get pods
```

Creating a deployment inside kubernetes cluster

`minikube kubectl -- create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4`
```shell
minikube kubectl -- create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
```

Exposing the deployment with a NodePort service

`minikube kubectl -- expose deployment hello-minikube --type=NodePort --port=8080`
```shell
minikube kubectl -- expose deployment hello-minikube --type=NodePort --port=8080
```

For more help

`minikube kubectl -- --help`
```shell
minikube kubectl -- --help
```

### Shell autocompletion

Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/handbook/mount.md
Expand Up @@ -14,13 +14,13 @@ aliases:

To mount a directory from the host into the guest using the `mount` subcommand:

```
```shell
minikube mount <source directory>:<target directory>
```

For example, this would mount your home directory to appear as /host within the minikube VM:

```
```shell
minikube mount $HOME:/host
```

Expand Down

0 comments on commit f6a770e

Please sign in to comment.