Skip to content

Commit

Permalink
Fixed typo in k8s and added k8s readme (microsoft#1718)
Browse files Browse the repository at this point in the history
* Fixed typo in k8s and added k8s readme

* Fix docker_build GitHub action

Co-authored-by: Miha Zupan <[email protected]>
  • Loading branch information
dpbevin and MihaZupan authored May 17, 2022
1 parent f6a7d35 commit b09b9dc
Show file tree
Hide file tree
Showing 43 changed files with 231 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ jobs:
uses: docker/build-push-action@v2
with:
context: ./
file: ./samples/KuberenetesIngress.Sample/Combined/Dockerfile
file: ./samples/KubernetesIngress.Sample/Combined/Dockerfile
push: false
tags: microsoft/yarp-combined:latest
- name: Build Ingress
id: docker_ingress
uses: docker/build-push-action@v2
with:
context: ./
file: ./samples/KuberenetesIngress.Sample/Ingress/Dockerfile
file: ./samples/KubernetesIngress.Sample/Ingress/Dockerfile
push: false
tags: microsoft/yarp-ingress:latest
- name: Build Monitor
id: docker_monitor
uses: docker/build-push-action@v2
with:
context: ./
file: ./samples/KuberenetesIngress.Sample/Monitor/Dockerfile
file: ./samples/KubernetesIngress.Sample/Monitor/Dockerfile
push: false
tags: microsoft/yarp-monitor:latest
29 changes: 16 additions & 13 deletions reverse-proxy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,17 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReverseProxy.Metrics.Prometheus.Sample", "samples\Prometheus\ReverseProxy.Metrics-Prometheus.Sample\ReverseProxy.Metrics.Prometheus.Sample.csproj", "{31D7E62F-532B-4FAF-87A9-C1BB63AF222A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KubernetesIngress.Sample", "KubernetesIngress.Sample", "{0B4635FC-8B63-4408-8077-F1CFDA5AB6D7}"
ProjectSection(SolutionItems) = preProject
samples\KubernetesIngress.Sample\README.md = samples\KubernetesIngress.Sample\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{32B6B967-6EAF-42A1-9FD6-A59F752FF76B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ingress", "Ingress", "{04E87669-7E7B-4217-83A4-EF80B534D14B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yarp.Kubernetes.Ingress", "samples\KuberenetesIngress.Sample\Ingress\Yarp.Kubernetes.Ingress.csproj", "{84B920E2-A501-457D-8F1A-9CC7AF8B5F2D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yarp.Kubernetes.Ingress", "samples\KubernetesIngress.Sample\Ingress\Yarp.Kubernetes.Ingress.csproj", "{84B920E2-A501-457D-8F1A-9CC7AF8B5F2D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "backend", "samples\KuberenetesIngress.Sample\backend\backend.csproj", "{EB5663B9-31BA-4930-A302-4B87B8DEB74A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "backend", "samples\KubernetesIngress.Sample\backend\backend.csproj", "{EB5663B9-31BA-4930-A302-4B87B8DEB74A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReverseProxy.Minimal.Sample", "samples\ReverseProxy.Minimal.Sample\ReverseProxy.Minimal.Sample.csproj", "{AA34BE13-7193-4036-A886-A7EE6CD36940}"
EndProject
Expand All @@ -88,9 +91,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReverseProxy.HttpSysDelegat
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Combined", "Combined", "{A33589AF-B49F-47B1-8D37-C3332985B04C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yarp.Kubernetes.Monitor", "samples\KuberenetesIngress.Sample\Monitor\Yarp.Kubernetes.Monitor.csproj", "{FBA4F71A-2561-4AE1-9D6C-47769E6E161F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yarp.Kubernetes.Monitor", "samples\KubernetesIngress.Sample\Monitor\Yarp.Kubernetes.Monitor.csproj", "{FBA4F71A-2561-4AE1-9D6C-47769E6E161F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yarp.Kubernetes.IngressController", "samples\KuberenetesIngress.Sample\Combined\Yarp.Kubernetes.IngressController.csproj", "{99E0E09D-A6C7-4ECA-B7CE-2B7F26AE4C6B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yarp.Kubernetes.IngressController", "samples\KubernetesIngress.Sample\Combined\Yarp.Kubernetes.IngressController.csproj", "{99E0E09D-A6C7-4ECA-B7CE-2B7F26AE4C6B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReverseProxy.LetsEncrypt.Sample", "samples\ReverseProxy.LetsEncrypt.Sample\ReverseProxy.LetsEncrypt.Sample.csproj", "{AC0EF892-7D32-4EAF-BE99-3696181E889F}"
EndProject
Expand Down Expand Up @@ -334,14 +337,6 @@ Global
{7AA90031-4644-4F38-9790-60E7A7609F58}.Release|Any CPU.Build.0 = Release|Any CPU
{7AA90031-4644-4F38-9790-60E7A7609F58}.Release|x64.ActiveCfg = Release|Any CPU
{7AA90031-4644-4F38-9790-60E7A7609F58}.Release|x64.Build.0 = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|x64.ActiveCfg = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|x64.Build.0 = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|Any CPU.Build.0 = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|x64.ActiveCfg = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|x64.Build.0 = Release|Any CPU
{FBA4F71A-2561-4AE1-9D6C-47769E6E161F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBA4F71A-2561-4AE1-9D6C-47769E6E161F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBA4F71A-2561-4AE1-9D6C-47769E6E161F}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -358,6 +353,14 @@ Global
{99E0E09D-A6C7-4ECA-B7CE-2B7F26AE4C6B}.Release|Any CPU.Build.0 = Release|Any CPU
{99E0E09D-A6C7-4ECA-B7CE-2B7F26AE4C6B}.Release|x64.ActiveCfg = Release|Any CPU
{99E0E09D-A6C7-4ECA-B7CE-2B7F26AE4C6B}.Release|x64.Build.0 = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|x64.ActiveCfg = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Debug|x64.Build.0 = Debug|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|Any CPU.Build.0 = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|x64.ActiveCfg = Release|Any CPU
{AC0EF892-7D32-4EAF-BE99-3696181E889F}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -396,10 +399,10 @@ Global
{34CB3C61-2F42-49FB-ACDC-2B0EC9EE8746} = {149C61A2-D9F8-49B9-9F9B-3C953FEF53AA}
{4A298B67-E7B5-4010-A6F2-5CFBB82BFBB1} = {34CB3C61-2F42-49FB-ACDC-2B0EC9EE8746}
{7AA90031-4644-4F38-9790-60E7A7609F58} = {34CB3C61-2F42-49FB-ACDC-2B0EC9EE8746}
{AC0EF892-7D32-4EAF-BE99-3696181E889F} = {149C61A2-D9F8-49B9-9F9B-3C953FEF53AA}
{A33589AF-B49F-47B1-8D37-C3332985B04C} = {0B4635FC-8B63-4408-8077-F1CFDA5AB6D7}
{FBA4F71A-2561-4AE1-9D6C-47769E6E161F} = {04E87669-7E7B-4217-83A4-EF80B534D14B}
{99E0E09D-A6C7-4ECA-B7CE-2B7F26AE4C6B} = {A33589AF-B49F-47B1-8D37-C3332985B04C}
{AC0EF892-7D32-4EAF-BE99-3696181E889F} = {149C61A2-D9F8-49B9-9F9B-3C953FEF53AA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {31F6924A-E427-4830-96E9-B47CEB7BFE78}
Expand Down
3 changes: 0 additions & 3 deletions samples/KuberenetesIngress.Sample/backend/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0.100-preview.3 AS publish
WORKDIR /src

# Copy csproj files and other files needed for restoring (to build a nuget cache layer to speed up rebuilds)
COPY ["samples/KuberenetesIngress.Sample/Combined/Yarp.Kubernetes.IngressController.csproj", "samples/KuberenetesIngress.Sample/Combined/"]
COPY ["samples/KubernetesIngress.Sample/Combined/Yarp.Kubernetes.IngressController.csproj", "samples/KubernetesIngress.Sample/Combined/"]
COPY ["src/ReverseProxy/Yarp.ReverseProxy.csproj", "src/ReverseProxy/"]
COPY ["src/Kubernetes.Controller/Yarp.Kubernetes.Controller.csproj", "src/Kubernetes.Controller/"]
COPY ["src/Directory.Build.props", "src/"]
Expand All @@ -18,13 +18,13 @@ COPY ["global.json", ""]
COPY ["NuGet.config", ""]

# Build a cache layer with all of the nuget packages
RUN dotnet restore samples/KuberenetesIngress.Sample/Combined/Yarp.Kubernetes.IngressController.csproj
RUN dotnet restore samples/KubernetesIngress.Sample/Combined/Yarp.Kubernetes.IngressController.csproj

# Copy the remaining source files
WORKDIR /src
COPY . .

WORKDIR /src/samples/KuberenetesIngress.Sample/Combined/
WORKDIR /src/samples/KubernetesIngress.Sample/Combined/
RUN dotnet publish -c Release --no-restore -o /app/publish -f net6.0

FROM base AS final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ The sample ingress controller is a single deployable.
From the base directory for this repo (where the .sln file is), run the command:

```
docker build -t yarp-combined:latest -f .\samples\KuberenetesIngress.Sample\Combined\Dockerfile .
docker build -t yarp-combined:latest -f ./samples/KubernetesIngress.Sample/Combined/Dockerfile .
```

## Deploying the Sample Ingress Controller

1. Open the [ingress-controller.yaml](./ingress-controller.yaml) file
2. Modify the container image to match the name used when building the image, e.g. change `<REGISTRY_NAME>/yarp-combined:<TAG>` to `yarp-combined:latest`
3. From the root of this repo. run the command `kubectl apply -f .\samples\KuberenetesIngress.Sample\Combined\ingress-controller.yaml`
3. From the root of this repo. run the command `kubectl apply -f ./samples/KubernetesIngress.Sample/Combined/ingress-controller.yaml`

To undeploy the ingress controller, run the command `kubectl delete -f .\samples\KuberenetesIngress.Sample\Combined\ingress-controller.yaml`
To undeploy the ingress controller, run the command `kubectl delete -f ./samples/KubernetesIngress.Sample/Combined/ingress-controller.yaml`
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0.100-preview.3 AS publish
WORKDIR /src

# Copy csproj files and other files needed for restoring (to build a nuget cache layer to speed up rebuilds)
COPY ["samples/KuberenetesIngress.Sample/Ingress/Yarp.Kubernetes.Ingress.csproj", "samples/KuberenetesIngress.Sample/Ingress/"]
COPY ["samples/KubernetesIngress.Sample/Ingress/Yarp.Kubernetes.Ingress.csproj", "samples/KubernetesIngress.Sample/Ingress/"]
COPY ["src/ReverseProxy/Yarp.ReverseProxy.csproj", "src/ReverseProxy/"]
COPY ["src/Kubernetes.Controller/Yarp.Kubernetes.Controller.csproj", "src/Kubernetes.Controller/"]
COPY ["src/Directory.Build.props", "src/"]
Expand All @@ -18,13 +18,13 @@ COPY ["global.json", ""]
COPY ["NuGet.config", ""]

# Build a cache layer with all of the nuget packages
RUN dotnet restore samples/KuberenetesIngress.Sample/Ingress/Yarp.Kubernetes.Ingress.csproj
RUN dotnet restore samples/KubernetesIngress.Sample/Ingress/Yarp.Kubernetes.Ingress.csproj

# Copy the remaining source files
WORKDIR /src
COPY . .

WORKDIR /src/samples/KuberenetesIngress.Sample/Ingress/
WORKDIR /src/samples/KubernetesIngress.Sample/Ingress/
RUN dotnet publish -c Release --no-restore -o /app/publish -f net6.0

FROM base AS final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ NOTE: Yarp Kubernetes can also be configured as a combined (single) deployable.
From the base directory for this repo (where the .sln file is), run the commands:

```
docker build -t yarp-monitor:latest -f .\samples\KuberenetesIngress.Sample\Monitor\Dockerfile .
docker build -t yarp-ingress:latest -f .\samples\KuberenetesIngress.Sample\Ingress\Dockerfile .
docker build -t yarp-monitor:latest -f ./samples/KubernetesIngress.Sample/Monitor/Dockerfile .
docker build -t yarp-ingress:latest -f ./samples/KubernetesIngress.Sample/Ingress/Dockerfile .
```

## Deploying the Sample Ingress Controller

1. Open the [ingress-monitor.yaml](../Monitor/ingress-monitor.yaml) file
1. Modify the container image to match the name used when building the image, e.g. change `<REGISTRY_NAME>/yarp-monitor:<TAG>` to `yarp-monitor:latest`
1. Run the command `kubectl apply -f .\samples\KuberenetesIngress.Sample\Monitor\ingress-monitor.yaml`
1. Run the command `kubectl apply -f ./samples/KubernetesIngress.Sample/Monitor/ingress-monitor.yaml`
1. Open the [ingress.yaml](./ingress.yaml) file
1. Modify the container image to match the name used when building the image, e.g. change `<REGISTRY_NAME>/yarp-ingress:<TAG>` to `yarp-ingress:latest`
1. Run the command `kubectl apply -f .\samples\KuberenetesIngress.Sample\Ingress\ingress.yaml`
1. Run the command `kubectl apply -f ./samples/KubernetesIngress.Sample/Ingress/ingress.yaml`

To undeploy the ingress, run the commands
```
kubectl delete -f .\samples\KuberenetesIngress.Sample\Ingress\ingress.yaml
kubectl delete -f .\samples\KuberenetesIngress.Sample\Monitor\ingress-monitor.yaml
kubectl delete -f ./samples/KubernetesIngress.Sample/Ingress/ingress.yaml
kubectl delete -f ./samples/KubernetesIngress.Sample/Monitor/ingress-monitor.yaml
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0.100-preview.3 AS publish
WORKDIR /src

# Copy csproj files and other files needed for restoring (to build a nuget cache layer to speed up rebuilds)
COPY ["samples/KuberenetesIngress.Sample/Monitor/Yarp.Kubernetes.Monitor.csproj", "samples/KuberenetesIngress.Sample/Monitor/"]
COPY ["samples/KubernetesIngress.Sample/Monitor/Yarp.Kubernetes.Monitor.csproj", "samples/KubernetesIngress.Sample/Monitor/"]
COPY ["src/ReverseProxy/Yarp.ReverseProxy.csproj", "src/ReverseProxy/"]
COPY ["src/Kubernetes.Controller/Yarp.Kubernetes.Controller.csproj", "src/Kubernetes.Controller/"]
COPY ["src/Directory.Build.props", "src/"]
Expand All @@ -18,13 +18,13 @@ COPY ["global.json", ""]
COPY ["NuGet.config", ""]

# Build a cache layer with all of the nuget packages
RUN dotnet restore samples/KuberenetesIngress.Sample/Monitor/Yarp.Kubernetes.Monitor.csproj
RUN dotnet restore samples/KubernetesIngress.Sample/Monitor/Yarp.Kubernetes.Monitor.csproj

# Copy the remaining source files
WORKDIR /src
COPY . .

WORKDIR /src/samples/KuberenetesIngress.Sample/Monitor/
WORKDIR /src/samples/KubernetesIngress.Sample/Monitor/
RUN dotnet publish -c Release --no-restore -o /app/publish -f net6.0

FROM base AS final
Expand Down
Loading

0 comments on commit b09b9dc

Please sign in to comment.