Skip to content

Commit 78364f1

Browse files
authored
Update kubernetes-ingress.md
1 parent 13c94e8 commit 78364f1

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

aspnetcore/fundamentals/servers/yarp/kubernetes-ingress.md

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ms.topic: article
99
content_well_notification: AI-contribution
1010
ai-usage: ai-assisted
1111
---
12-
1312
# YARP Kubernetes Ingress Controller
1413

1514
Introduced: Future Preview
@@ -20,33 +19,36 @@ YARP can be integrated with Kubernetes as a reverse proxy managing HTTP/HTTPS tr
2019

2120
Before we continue with this tutorial, make sure you have the following ready...
2221

23-
1. Installing [docker](https://docs.docker.com/install/) based on your operating system.
22+
1. Installing [Docker](https://docs.docker.com/install/) based on your operating system.
23+
24+
1. A container registry. Docker by default will create a container registry on [DockerHub](https://hub.docker.com/). You could also use [Azure Container Registry](/en-us/azure/aks/tutorial-kubernetes-prepare-acr) or another container registry of your choice, like a [local registry](https://docs.docker.com/registry/deploying/#run-a-local-registry) for testing.
2425

25-
2. A container registry. Docker by default will create a container registry on [DockerHub](https://hub.docker.com/). You could also use [Azure Container Registry](/en-us/azure/aks/tutorial-kubernetes-prepare-acr) or another container registry of your choice, like a [local registry](https://docs.docker.com/registry/deploying/#run-a-local-registry) for testing.
26+
1. A Kubernetes Cluster. There are many different options here, including:
2627

27-
3. A Kubernetes Cluster. There are many different options here, including:
28-
- [Azure Kubernetes Service](/en-us/azure/aks/tutorial-kubernetes-deploy-cluster)
29-
- [Kubernetes in Docker Desktop](https://www.docker.com/blog/docker-windows-desktop-now-kubernetes/), however it does take up quite a bit of memory on your machine, so use with caution.
30-
- [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)
31-
- [K3s](https://k3s.io), a lightweight single-binary certified Kubernetes distribution from Rancher.
32-
- Another Kubernetes provider of your choice.
28+
* [Azure Kubernetes Service](/en-us/azure/aks/tutorial-kubernetes-deploy-cluster)
29+
* [Kubernetes in Docker Desktop](https://www.docker.com/blog/docker-windows-desktop-now-kubernetes/), however it does take up quite a bit of memory on your machine, so use with caution.
30+
* [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)
31+
* [K3s](https://k3s.io), a lightweight single-binary certified Kubernetes distribution from Rancher.
32+
* Another Kubernetes provider of your choice.
3333

34-
> :warning: If you choose a container registry provided by a cloud provider (other than Dockerhub), you will likely have to take some steps to configure your kubernetes cluster to allow access. Follow the instructions provided by your cloud provider.
34+
> [!NOTE]
35+
> If you choose a container registry provided by a cloud provider other than Dockerhub, you probably must take steps to configure your Kubernetes cluster to allow access. Follow the instructions provided by your cloud provider.
3536
36-
## Get Started
37+
## Get started
3738

38-
> :warning: For now there is no official docker image for the YARP ingress controller.
39+
> [!NOTE]
40+
> For now, there is no official Docker image for the YARP ingress controller.
3941
40-
So, in the meantime we need to build the YARP ingress controller locally and deploy it. In the root of the repository, run:
42+
In the meantime, the YARP ingress controller must be built locally and deploy it. In the root of the repository, run:
4143

4244
```
43-
docker build . -t <REGISTRY_NAME>/yarp-controller:<TAG> -f .\src\Kubernetes.Controller\Dockerfile
44-
docker push <REGISTRY_NAME>/yarp-controller:<TAG>
45+
docker build . -t {REGISTRY_NAME}/yarp-controller:{TAG} -f .\src\Kubernetes.Controller\Dockerfile
46+
docker push {REGISTRY_NAME}/yarp-controller:{TAG}
4547
```
4648

47-
where `REGISTRY_NAME` is the name of your docker registry and `TAG` is a tag for the image (for example 1.0.0).
49+
In the preceding commands, the `{REGISTRY_NAME}` placeholder is the name of the Docker registry, and the `{TAG}` placeholder is a tag for the image (for example, `1.0.0`).
4850

49-
Then the first step will be to deploy the YARP ingress controller to the Kubernetes cluster. This can be done by navigating to [Kubernetes Ingress sample](https://github.com/dotnet/yarp/tree/release/latest/samples/KubernetesIngress.Sample) `\samples\KubernetesIngress.Sample\Ingress`
51+
The first step is to deploy the YARP ingress controller to the Kubernetes cluster. This can be done by navigating to [Kubernetes Ingress sample](https://github.com/dotnet/yarp/tree/release/latest/samples/KubernetesIngress.Sample) `\samples\KubernetesIngress.Sample\Ingress`
5052
and running (after modifying `ingress-controller.yaml` with the same `REGISTRY_NAME` and `TAG`):
5153

5254
```
@@ -62,21 +64,21 @@ kubectl get pods -n yarp
6264
You can then check logs from the ingress controller by running:
6365

6466
```
65-
kubectl logs <POD NAME> -n yarp
67+
kubectl logs {POD NAME} -n yarp
6668
```
6769

68-
> :bulb: All services, deployments, and pods for YARP are in the namespace `yarp`. Make sure to include `-n yarp` if you want to check on the status of yarp.
70+
All services, deployments, and pods for YARP are in the namespace `yarp`. Make sure to include `-n yarp` if you want to check on the status of yarp.
6971

70-
Next, we need to build and deploy our ingress. In the root of the repository, run:
72+
Next, build and deploy the ingress. In the root of the repository, run:
7173

7274
```
73-
docker build . -t <REGISTRY_NAME>/yarp:<TAG> -f .\samples\KuberenetesIngress.Sample\Ingress\Dockerfile
74-
docker push <REGISTRY_NAME>/yarp:<TAG>
75+
docker build . -t {REGISTRY_NAME}/yarp:<TAG> -f .\samples\KuberenetesIngress.Sample\Ingress\Dockerfile
76+
docker push {REGISTRY_NAME}/yarp:{TAG}
7577
```
7678

77-
where `REGISTRY_NAME` is the name of your docker registry and `TAG` is a tag for the image (for example 1.0.0).
79+
In the preceding commands, the `{REGISTRY_NAME}` placeholder is the name of the Docker registry, and the `{TAG}` placeholder is a tag for the image (for example, `1.0.0`).
7880

79-
Finally, we need to deploy the ingress itself to Kubernetes. To do this navigate again to the `Ingress` directory, modify the `ingress.yaml` file for your registry and tag specified earlier and run:
81+
Finally, we need to deploy the ingress itself to Kubernetes. Navigate to the `Ingress` directory and modify the `ingress.yaml` file for your registry and tag specified earlier and run:
8082

8183
```
8284
kubectl apply -f .\ingress.yaml
@@ -89,11 +91,11 @@ At this point, your ingress and controller should be running.
8991
To use the ingress, we now need to deploy an application to Kubernetes. Navigate to `samples\KuberenetesIngress.Sample\backend` and run:
9092

9193
```
92-
docker build . -t <REGISTRY_NAME>/backend:<TAG>
93-
docker push <REGISTRY_NAME>/backend:<TAG>
94+
docker build . -t {REGISTRY_NAME}/backend:{TAG}
95+
docker push {REGISTRY_NAME}/backend:{TAG}
9496
```
9597

96-
And deploying it to kubernetes by running (after modifying `backend.yaml` with the same `REGISTRY_NAME` and `TAG`):
98+
And deploying it to Kubernetes by running, after modifying `backend.yaml` with the same registry name (`{REGISTRY_NAME}`) and tag (`{TAG}`):
9799

98100
```
99101
kubectl apply -f .\backend.yaml
@@ -107,15 +109,12 @@ Finally, once we have deployed the backend application, we need to route traffic
107109
kubectl apply -f .\ingress-sample.yaml
108110
```
109111

110-
And then run:
112+
And then execute the following command to get the external IP of the ingress, the name of the related service being `yarp-proxy`:
111113

112114
```
113-
kubectl get service -n yarp
115+
kubectl get service -n yarp
114116
```
115117

116-
to get the external IP of the ingress, the name of the related service being `yarp-proxy`.
117-
118-
> :bulb: If you are using a local K8s cluster and don't get an external IP, you may need to not use the default `port: 80` for the `yarp-proxy` service.
119-
If so, try to update again the `ingress.yaml` file to use another port e.g. `port: 8085` and then re-deploy the ingress to Kubernetes.
118+
If you're using a local K8s cluster and don't get an external IP, you may be able to avoid using the default `port: 80` for the `yarp-proxy` service. If so, try to update the `ingress.yaml` file again to use another port (for example, `port: 8085`) and redeploy the ingress to Kubernetes.
120119

121120
Navigate to the external IP, and you should see the backend information.

0 commit comments

Comments
 (0)