Skip to content

Commit

Permalink
Merge pull request #10221 from MicrosoftDocs/main638497840165631391sy…
Browse files Browse the repository at this point in the history
…nc_temp

For protected branch, push strategy should use PR and merge to target branch method to work around git push error
  • Loading branch information
learn-build-service-prod[bot] authored Apr 27, 2024
2 parents 3d0e37f + f0ddfcb commit 326f716
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions bridge/articles/bridge-to-kubernetes-aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ az aks create \
Download the code and install dependencies

```azurecli-interactive
git clone https://github.com/Azure/Bridge-To-Kubernetes
cd Bridge-To-Kubernetes/samples/todo-app
git clone https://github.com/hsubramanianaks/b2k-samples
cd b2k-samples/todo-app
npm install stats-api\
```

Expand Down
16 changes: 8 additions & 8 deletions bridge/articles/bridge-to-kubernetes-sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switc

## Deploy the application

Clone the [Bridge to Kubernetes repo](https://github.com/Azure/Bridge-To-Kubernetes) and open a command window with the current working folder to *samples/todo-app*.
Clone the [Bridge to Kubernetes repo](https://github.com/hsubramanianaks/b2k-samples) and open a command window with the current working folder to *todo-app*.

Create a namespace for the sample.

Expand All @@ -59,7 +59,7 @@ kubectl apply -n todo-app -f deployment.yaml

This is a simple deployment that exposes the frontend using a service of type `LoadBalancer`. Wait for all the pods to be running and for the external IP of the `frontend` service to become available.

If you are testing with MiniKube, you will need to use `minikube tunnel` to resolve an external IP.
If you're testing with MiniKube, you need to use `minikube tunnel` to resolve an external IP.

```output
kubectl get services -n todo-app
Expand Down Expand Up @@ -106,34 +106,34 @@ Open the Command Palette (**CTRL**+**SHIFT**+**P** or **Cmd**+**Shift**+**P** on

![Bridge to Kubernetes: Configure command](media/bridge-to-kubernetes-sample/bridge-configure.png)

You are prompted to configure the service you want to replace, the port to forward from your development computer, and the launch task to use.
You're prompted to configure the service you want to replace, the port to forward from your development computer, and the launch task to use.

Choose the `stats-api` service.

![Select the service to connect to](media/bridge-to-kubernetes-sample/select-service.png)

After you select your service, you are prompted to enter the TCP port for your local application. For this example, enter 3001.
After you select your service, you're prompted to enter the TCP port for your local application. For this example, enter 3001.

![Enter the port number](media/bridge-to-kubernetes-sample/enter-port.png)

Choose **Run Script: dev** as the launch task.

![Choose the debugger launch task](media/bridge-to-kubernetes-sample/launch-task.png)

You have the option of running isolated or not isolated. If you run isolated, only your requests are routed to your local process; other developers can use the cluster without being affected. If you don't run isolated, all traffic is redirected to your local process. For more information on this option, see [Using routing capabilities for developing in isolation](overview-bridge-to-kubernetes.md#using-routing-capabilities-for-developing-in-isolation). For this example, we will proceed with non-isolated.
You have the option of running isolated or not isolated. If you run isolated, only your requests are routed to your local process; other developers can use the cluster without being affected. If you don't run isolated, all traffic is redirected to your local process. For more information on this option, see [Using routing capabilities for developing in isolation](overview-bridge-to-kubernetes.md#using-routing-capabilities-for-developing-in-isolation). For this example, let's use nonisolated.

![Choose isolation](media/bridge-to-kubernetes-sample/isolation.png)

> [!NOTE]
> You will be prompted to allow the EndpointManager to run elevated and modify your hosts file.
> VS Code prompts you to allow the EndpointManager to run elevated and modify your hosts file.
The Bridge to Kubernetes debugging profile has been successfully configured.

Select the Debug icon on the left and select **Run Script: dev with Kubernetes**. Click the start button next to **Run Script: dev with Kubernetes**.

![Choose debug launch profile](media/bridge-to-kubernetes-sample/debug-profile.png)

Your development computer is connected when the VS Code status bar turns orange and the Kubernetes extension shows you are connected. Once your development computer is connected, traffic starts redirecting to your development computer for the stats-api you are replacing.
Your development computer is connected when the VS Code status bar turns orange and the Kubernetes extension shows you're connected. Once your development computer is connected, traffic starts redirecting to your development computer for the stats-api you're replacing.

![Debugging with Bridge to Kubernetes](media/bridge-to-kubernetes-sample/debugging.png)

Expand All @@ -147,7 +147,7 @@ Notice the traffic that initially started in your cluster was redirected to your

Press play and let the request continue complete transparently.

This is just one example on how to use Bridge to Kubernetes on non-AKS clusters. Try it on your own project next!
This example is just one illustration of how to use Bridge to Kubernetes on non-AKS clusters. Try it on your own project next!

## Clean up

Expand Down
2 changes: 1 addition & 1 deletion bridge/articles/bridge-to-kubernetes-vs-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var response = await client.SendAsync(request);
> [!NOTE]
> To avoid affecting code at every request, you can create a class that inherits from [System.Net.Http.DelegatingHandler](/dotnet/api/system.net.http.delegatinghandler) and override the `SendAsync` method with code similar to the preceding example. You can find code using this technique on the web; one example is [Properly Propagating "kubernetes-route-as" in Bridge to Kubernetes](https://blogs.u2u.be/lander/post/2020/11/25/properly-propagating-kubernetes-route-as-in-bridge-to-kubernetes).
For Node.js services, you can use code similar to the following, taken from the todo-app sample in the [Bridge to Kubernetes repo](https://github.com/Azure/Bridge-To-Kubernetes):
For Node.js services, you can use code similar to the following, taken from the todo-app sample in the [Bridge to Kubernetes repo](https://github.com/hsubramanianaks/b2k-samples):

```js
server.get("/api/stats", function (req, res) {
Expand Down
6 changes: 3 additions & 3 deletions bridge/articles/bridge-to-kubernetes-vs.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ The sample application has a frontend to interact and a backend that provides pe
1. Clone the sample repo.

```bash
git clone https://github.com/Azure/Bridge-To-Kubernetes
git clone https://github.com/hsubramanianaks/b2k-samples
```

1. Change directory to *samples/todo-app* and then create a namespace for the sample.
1. Change directory to *todo-app* and then create a namespace for the sample.

```cmd
kubectl create namespace todo-app
Expand Down Expand Up @@ -83,7 +83,7 @@ The sample application has a frontend to interact and a backend that provides pe

1. Open Visual Studio. In the **Get started** window, select **Continue without code**.

1. Select **Open** > **Project/Solution**, then find the *samples\todo-app\database-api\databaseApi.csproj* project and select **Open**.
1. Select **Open** > **Project/Solution**, then find the *todo-app\database-api\databaseApi.csproj* project and select **Open**.

1. In the project, select **Bridge to Kubernetes** from the launch settings as shown here:

Expand Down

0 comments on commit 326f716

Please sign in to comment.