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

Change the host for the ingress tutorial, to mitigate a security risk. #46239

Merged
merged 1 commit into from
May 7, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ If you haven't already set up a cluster locally, run `minikube start` to create
## Create an Ingress

The following manifest defines an Ingress that sends traffic to your Service via
`hello-world.info`.
`hello-world.example`.

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

Expand Down Expand Up @@ -197,8 +197,8 @@ The following manifest defines an Ingress that sends traffic to your Service via
You should see an IPv4 address in the `ADDRESS` column; for example:

```none
NAME CLASS HOSTS ADDRESS PORTS AGE
example-ingress <none> hello-world.info 172.17.0.15 80 38s
NAME CLASS HOSTS ADDRESS PORTS AGE
example-ingress nginx hello-world.example 172.17.0.15 80 38s
```


Expand All @@ -214,7 +214,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
{{% tab name="Linux" %}}

```shell
curl --resolve "hello-world.info:80:$( minikube ip )" -i http://hello-world.info
curl --resolve "hello-world.example:80:$( minikube ip )" -i http://hello-world.example
```
{{% /tab %}}
{{% tab name="MacOS" %}}
Expand All @@ -236,7 +236,7 @@ The following manifest defines an Ingress that sends traffic to your Service via

From within a new terminal, invoke the following command:
```shell
curl --resolve "hello-world.info:80:127.0.0.1" -i http://hello-world.info
curl --resolve "hello-world.example:80:127.0.0.1" -i http://hello-world.example
```

{{% /tab %}}
Expand All @@ -250,7 +250,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
Hostname: web-55b8c6998d-8k564
```

1. Optionally, you can also visit `hello-world.info` from your browser.
1. Optionally, you can also visit `hello-world.example` from your browser.

Add a line to the bottom of the `/etc/hosts` file on
your computer (you will need administrator access):
Expand All @@ -264,7 +264,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
<br>

```none
172.17.0.15 hello-world.info
172.17.0.15 hello-world.example
```

{{< note >}}
Expand All @@ -273,15 +273,15 @@ The following manifest defines an Ingress that sends traffic to your Service via
{{% /tab %}}
{{% tab name="MacOS" %}}
```none
127.0.0.1 hello-world.info
127.0.0.1 hello-world.example
```
{{% /tab %}}
{{< /tabs >}}

<br>

After you make this change, your web browser sends requests for
`hello-world.info` URLs to Minikube.
`hello-world.example` URLs to Minikube.

## Create a second Deployment

Expand Down Expand Up @@ -356,7 +356,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
{{% tab name="Linux" %}}

```shell
curl --resolve "hello-world.info:80:$( minikube ip )" -i http://hello-world.info
curl --resolve "hello-world.example:80:$( minikube ip )" -i http://hello-world.example
```
{{% /tab %}}
{{% tab name="MacOS" %}}
Expand All @@ -378,7 +378,7 @@ The following manifest defines an Ingress that sends traffic to your Service via

From within a new terminal, invoke the following command:
```shell
curl --resolve "hello-world.info:80:127.0.0.1" -i http://hello-world.info
curl --resolve "hello-world.example:80:127.0.0.1" -i http://hello-world.example
```

{{% /tab %}}
Expand All @@ -399,7 +399,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
{{% tab name="Linux" %}}

```shell
curl --resolve "hello-world.info:80:$( minikube ip )" -i http://hello-world.info/v2
curl --resolve "hello-world.example:80:$( minikube ip )" -i http://hello-world.example/v2
```
{{% /tab %}}
{{% tab name="MacOS" %}}
Expand All @@ -421,7 +421,7 @@ The following manifest defines an Ingress that sends traffic to your Service via

From within a new terminal, invoke the following command:
```shell
curl --resolve "hello-world.info:80:127.0.0.1" -i http://hello-world.info/v2
curl --resolve "hello-world.example:80:127.0.0.1" -i http://hello-world.example/v2
```

{{% /tab %}}
Expand All @@ -436,8 +436,8 @@ The following manifest defines an Ingress that sends traffic to your Service via
```

{{< note >}}
If you did the optional step to update `/etc/hosts`, you can also visit `hello-world.info` and
`hello-world.info/v2` from your browser.
If you did the optional step to update `/etc/hosts`, you can also visit `hello-world.example` and
`hello-world.example/v2` from your browser.
{{< /note >}}

## {{% heading "whatsnext" %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: hello-world.info
- host: hello-world.example
http:
paths:
- path: /
Expand Down