Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12810 - Missing docs for ingress setup on minikube #12821

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/en/docs/concepts/services-networking/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ uses a service of type [Service.Type=NodePort](/docs/concepts/services-networkin

{{< feature-state for_k8s_version="v1.1" state="beta" >}}

Before you start using an Ingress, there are a few things you should understand. The Ingress is a beta resource.
Before you start using an Ingress, there are a few things you should understand. The Ingress is a beta resource.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that Ingress has left beta; we're long past v1.1. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be confirmed before it's updated in the document. Also, I don't think it is related to the current. We can open another bug to track it.


{{< note >}}
You must have an [Ingress controller](/docs/concepts/services-networking/ingress-controllers) to satisfy an Ingress. Only creating an Ingress resource has no effect.
Expand All @@ -56,7 +56,7 @@ GCE/Google Kubernetes Engine deploys an Ingress controller on the master. Review
of this controller if you are using GCE/GKE.

In environments other than GCE/Google Kubernetes Engine, you may need to
[deploy an ingress controller](https://kubernetes.github.io/ingress-nginx/deploy/). There are a number of
[deploy an ingress controller](https://kubernetes.github.io/ingress-nginx/deploy/). There are a number of
[ingress controllers](/docs/concepts/services-networking/ingress-controllers) you may choose from.

### Before you begin
Expand Down Expand Up @@ -261,7 +261,7 @@ spec:

If you create an Ingress resource without any hosts defined in the rules, then any
web traffic to the IP address of your Ingress controller can be matched without a name based
virtual host being required. For example, the following Ingress resource will route traffic
virtual host being required. For example, the following Ingress resource will route traffic
requested for `first.bar.com` to `service1`, `second.foo.com` to `service2`, and any traffic
to the IP address without a hostname defined in request (that is, without a request header being
presented) to `service3`.
Expand Down Expand Up @@ -317,7 +317,7 @@ type: kubernetes.io/tls

Referencing this secret in an Ingress will tell the Ingress controller to
secure the channel from the client to the loadbalancer using TLS. You need to make
sure the TLS secret you created came from a certificate that contains a CN
sure the TLS secret you created came from a certificate that contains a CN
for `sslexample.foo.com`.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ weight: 100

{{% capture overview %}}

An [Ingress](/docs/concepts/services-networking/ingress/) is an API object that defines rules which allow external access
to services in a cluster. An [Ingress controller](/docs/concepts/services-networking/ingress-controllers/) fulfills the rules set in the Ingress.
An [Ingress](/docs/concepts/services-networking/ingress/) is an API object that defines rules which allow external access
to services in a cluster. An [Ingress controller](#) fulfills the rules set in the Ingress.

{{< caution >}}
For the Ingress resource to work, the cluster **must** also have an Ingress controller running.
Expand Down Expand Up @@ -44,7 +44,7 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
```shell
minikube addons enable ingress
```

1. Verify that the NGINX Ingress controller is running

```shell
Expand Down Expand Up @@ -74,31 +74,31 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
```

Output:

```shell
deployment.apps/web created
```

1. Expose the Deployment:
1. Expose the Deployment:

```shell
kubectl expose deployment web --target-port=8080 --type=NodePort
```
Output:

Output:

```shell
service/web exposed
```

1. Verify the Service is created and is available on a node port:

```shell
kubectl get service web
```
```

Output:

```shell
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
web NodePort 10.104.133.249 <none> 8080:31637/TCP 12m
Expand All @@ -109,34 +109,33 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
```shell
minikube service web --url
```

Output:

```shell
http://172.17.0.15:31637
```

{{< note >}}Katacoda environment only: at the top of the terminal panel, click the plus sign, and then click **Select port to view on Host 1**. Enter the NodePort, in this case `31637`, and then click **Display Port**.{{< /note >}}

Output:

```shell
Hello, world!
Version: 1.0.0
Hostname: web-55b8c6998d-8k564
```

You can now access the sample app via the Minikube IP address and NodePort. The next step lets you access
the app using the Ingress resource.

## Create an Ingress resource

The following file is an Ingress resource that sends traffic to your Service via hello-world.info.
The following file is an Ingress resource that sends traffic to your Service via ```hello-world.info```.

1. Create `example-ingress.yaml` from the following file:

```yaml
---
```yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
Expand All @@ -159,16 +158,16 @@ The following file is an Ingress resource that sends traffic to your Service via
```shell
kubectl apply -f example-ingress.yaml
```

Output:

```shell
ingress.extensions/example-ingress created
```

1. Verify the IP address is set:
1. Verify the IP address is set:

```shell
```shell
kubectl get ingress
```

Expand All @@ -179,13 +178,13 @@ The following file is an Ingress resource that sends traffic to your Service via
example-ingress hello-world.info 172.17.0.15 80 38s
```

1. Add the following line to the bottom of the `/etc/hosts` file.
1. Add the following line to the bottom of the `/etc/hosts` file.

```
172.17.0.15 hello-world.info
```

This sends requests from hello-world.info to Minikube.
This sends requests from hello-world.info to Minikube.

1. Verify that the Ingress controller is directing traffic:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: line 195, correct spelling of controller
nit: should this be item number 5? Probably an extra line needs to be taken away or added.

Expand All @@ -211,41 +210,41 @@ The following file is an Ingress resource that sends traffic to your Service via
kubectl run web2 --image=gcr.io/google-samples/hello-app:2.0 --port=8080
```
Output:

```shell
deployment.apps/web2 created
```

1. Expose the Deployment:

```shell
kubectl expose deployment web2 --target-port=8080 --type=NodePort
```

Output:
Output:

```shell
service/web2 exposed
```

## Edit Ingress

1. Edit the existing `example-ingress.yaml` and add the following lines:

```yaml
- path: /v2/*
backend:
serviceName: web2
servicePort: 8080
```
```yaml
- path: /v2/*
backend:
serviceName: web2
servicePort: 8080
```

1. Apply the changes:

```shell
kubectl apply -f example-ingress.yaml
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: check item ordering (1, 2 vs 1, 1). May need to add/delete extra line.

Output:
Output:
```shell
ingress.extensions/example-ingress configured
```
Expand Down Expand Up @@ -289,4 +288,3 @@ The following file is an Ingress resource that sends traffic to your Service via
* Read more about [Services](/docs/concepts/services-networking/service/)

{{% /capture %}}