Skip to content

Commit 4a72df0

Browse files
committed
[Dev Spaces] refactored connect and PR flow docs to link to README
1 parent cb45218 commit 4a72df0

File tree

7 files changed

+58
-260
lines changed

7 files changed

+58
-260
lines changed

articles/dev-spaces/how-to/connect.md

Lines changed: 37 additions & 146 deletions
Large diffs are not rendered by default.

articles/dev-spaces/how-to/github-actions.md

Lines changed: 19 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: zr-msft
55
services: azure-dev-spaces
66
ms.service: azure-dev-spaces
77
ms.author: zarhoads
8-
ms.date: 10/24/2019
8+
ms.date: 11/04/2019
99
ms.topic: conceptual
1010
description: "Review and test changes from a pull request directly in Azure Kubernetes Service using GitHub Actions and Azure Dev Spaces."
1111
keywords: "Docker, Kubernetes, Azure, AKS, Azure Kubernetes Service, containers, GitHub Actions, Helm, service mesh, service mesh routing, kubectl, k8s"
@@ -17,40 +17,21 @@ Azure Dev Spaces provides a workflow using GitHub Actions that allows you to tes
1717

1818
In this guide, you will learn how to:
1919

20-
- Set up Azure Dev Spaces on a managed Kubernetes cluster in Azure.
21-
- Deploy a large application with multiple microservices to a dev space.
22-
- Set up CI/CD with GitHub actions.
23-
- Test a single microservice in an isolated dev space within the context of the full application.
20+
* Set up Azure Dev Spaces on a managed Kubernetes cluster in Azure.
21+
* Deploy a large application with multiple microservices to a dev space.
22+
* Set up CI/CD with GitHub actions.
23+
* Test a single microservice in an isolated dev space within the context of the full application.
2424

2525
> [!IMPORTANT]
2626
> This feature is currently in preview. Previews are made available to you on the condition that you agree to the [supplemental terms of use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Some aspects of this feature may change prior to general availability (GA).
2727
2828
## Prerequisites
2929

30-
- An Azure subscription. If you don't have an Azure subscription, you can create a [free account](https://azure.microsoft.com/free).
31-
- [Azure CLI installed][azure-cli-installed].
32-
- [Helm 2.13 or greater installed][helm-installed].
33-
- A GitHub Account with [GitHub Actions enabled][github-actions-beta-signup].
34-
35-
## Create an Azure Kubernetes Service cluster
36-
37-
You must create an AKS cluster in a [supported region][supported-regions]. The below commands create a resource group called *MyResourceGroup* and an AKS cluster called *MyAKS*.
38-
39-
```cmd
40-
az group create --name MyResourceGroup --location eastus
41-
az aks create -g MyResourceGroup -n MyAKS --location eastus --disable-rbac --generate-ssh-keys
42-
```
43-
44-
## Enable Azure Dev Spaces on your AKS cluster
45-
46-
Use the `use-dev-spaces` command to enable Dev Spaces on your AKS cluster and follow the prompts. The below command enables Dev Spaces on the *MyAKS* cluster in the *MyResourceGroup* group and creates a dev space called *dev*.
47-
48-
> [!NOTE]
49-
> The `use-dev-spaces` command will also install the Azure Dev Spaces CLI if its not already installed. You cannot install the Azure Dev Spaces CLI in the Azure Cloud Shell.
50-
51-
```cmd
52-
az aks use-dev-spaces -g MyResourceGroup -n MyAKS --space dev --yes
53-
```
30+
* An Azure subscription. If you don't have an Azure subscription, you can create a [free account](https://azure.microsoft.com/free).
31+
* [Azure CLI installed][azure-cli-installed].
32+
* [Helm 2.13 or greater installed][helm-installed].
33+
* A GitHub Account with [GitHub Actions enabled][github-actions-beta-signup].
34+
* The [Azure Dev Spaces Bike Sharing sample application](https://github.com/Azure/dev-spaces/tree/master/samples/BikeSharingApp/README.md) running on an AKS cluster.
5435

5536
## Create an Azure Container Registry
5637

@@ -98,95 +79,19 @@ az role assignment create --assignee <ClientId> --scope <ACRId> --role AcrPush
9879
> [!IMPORTANT]
9980
> You must be the owner of both your AKS cluster and ACR in order to give your service principal access to those resources.
10081
101-
## Get sample application code
102-
103-
In this article, you use the [Azure Dev Spaces Bike Sharing sample application][bike-sharing-gh] to demonstrate using Azure Dev Spaces with GitHub actions.
104-
105-
Fork the Azure Dev Spaces sample repository then navigate to your forked repository. Click on the *Actions* tab and choose to enable actions for this repository.
106-
107-
Clone your forked repository and navigate into its directory:
108-
109-
```cmd
110-
git clone https://github.com/USERNAME/dev-spaces
111-
cd dev-spaces/samples/BikeSharingApp/
112-
```
113-
114-
## Retrieve the HostSuffix for *dev*
115-
116-
Use the `azds show-context` command to show the HostSuffix for *dev*.
117-
118-
```cmd
119-
$ azds show-context
120-
121-
Name ResourceGroup DevSpace HostSuffix
122-
------------------ ---------------- -------- -----------------------
123-
MyAKS MyResourceGroup dev fedcab0987.eus.azds.io
124-
```
125-
126-
## Update the Helm chart with your HostSuffix
127-
128-
Open [charts/values.yaml][bike-sharing-values-yaml] and replace all instances of `<REPLACE_ME_WITH_HOST_SUFFIX>` with the HostSuffix value you retrieved earlier. Save your changes and close the file.
129-
130-
## Run the sample application in Kubernetes
131-
132-
The commands for running the sample application on Kubernetes are part of an existing process and have no dependency on Azure Dev Spaces tooling. In this case, Helm is the tooling used to run this sample application but other tooling could be used to run your entire application in a namespace within a cluster. The Helm commands are targeting the dev space named *dev* you created earlier, but this dev space is also a Kubernetes namespace. As a result, dev spaces can be targeted by other tooling the same as other namespaces.
133-
134-
You can use Azure Dev Spaces for development after an application is running in a cluster regardless of the tooling used to deploy it.
135-
136-
Use the `helm init` and `helm install` commands to set up and install the sample application on your cluster.
137-
138-
```cmd
139-
cd charts/
140-
helm init --wait
141-
helm install -n bikesharing . --dep-up --namespace dev --atomic
142-
```
143-
144-
> [!Note]
145-
> **If you are using an RBAC-enabled cluster**, be sure to configure [a service account for Tiller][tiller-rbac]. Otherwise, `helm` commands will fail.
146-
147-
The `helm install` command may take several minutes to complete. The output of the command shows the status of all the services it deployed to the cluster when completed:
148-
149-
```cmd
150-
$ cd charts/
151-
$ helm init --wait
152-
...
153-
Happy Helming!
154-
155-
$ helm install -n bikesharing . --dep-up --namespace dev --atomic
156-
157-
Hang tight while we grab the latest from your chart repositories...
158-
...
159-
NAME READY UP-TO-DATE AVAILABLE AGE
160-
bikes 1/1 1 1 4m32s
161-
bikesharingweb 1/1 1 1 4m32s
162-
billing 1/1 1 1 4m32s
163-
gateway 1/1 1 1 4m32s
164-
reservation 1/1 1 1 4m32s
165-
reservationengine 1/1 1 1 4m32s
166-
users 1/1 1 1 4m32s
167-
```
168-
169-
After the sample application is installed on your cluster and since you have Dev Spaces enabled on your cluster, use the `azds list-uris` command to display the URLs for the sample application in *dev* that is currently selected.
170-
171-
```cmd
172-
$ azds list-uris
173-
Uri Status
174-
-------------------------------------------------- ---------
175-
http://dev.bikesharingweb.fedcab0987.eus.azds.io/ Available
176-
http://dev.gateway.fedcab0987.eus.azds.io/ Available
177-
```
178-
179-
Navigate to the *bikesharingweb* service by opening the public URL from the `azds list-uris` command. In the above example, the public URL for the *bikesharingweb* service is `http://dev.bikesharingweb.fedcab0987.eus.azds.io/`. Select *Aurelia Briggs (customer)* as the user, then select a bike to rent. Verify you see a placeholder image for the bike.
180-
18182
## Configure your GitHub action
18283

84+
> [!IMPORTANT]
85+
> You must have GitHub Actions enabled for your repository. To enable GitHub Actions for your repository, navigate to your repository on GitHub, click on the Actions tab, and choose to enable actions for this repository.
86+
18387
Navigate to your forked repository and click *Settings*. Click on *Secrets* in the left sidebar. Click *Add a new secret* to add each new secret below:
18488

18589
1. *AZURE_CREDENTIALS*: the entire output from the service principal creation.
18690
1. *RESOURCE_GROUP*: the resource group for your AKS cluster, which in this example is *MyResourceGroup*.
18791
1. *CLUSTER_NAME*: the name of your AKS cluster, which in this example is *MyAKS*.
18892
1. *CONTAINER_REGISTRY*: the *loginServer* for the ACR.
18993
1. *HOST*: the host for your Dev Space, which takes the form *<MASTER_SPACE>.<APP_NAME>.<HOST_SUFFIX>*, which in this example is *dev.bikesharingweb.fedcab0987.eus.azds.io*.
94+
1. *HOST_SUFFIX*: the host suffix for your Dev Space, which in this example is *fedcab0987.eus.azds.io*.
19095
1. *IMAGE_PULL_SECRET*: the name of the secret you wish to use, for example *demo-secret*.
19196
1. *MASTER_SPACE*: the name of your parent Dev Space, which in this example is *dev*.
19297
1. *REGISTRY_USERNAME*: the *clientId* from the JSON output from the service principal creation.
@@ -197,10 +102,10 @@ Navigate to your forked repository and click *Settings*. Click on *Secrets* in t
197102
198103
## Create a new branch for code changes
199104

200-
Navigate back to `BikeSharingApp/` and create a new branch called *bike-images*.
105+
Navigate to `BikeSharingApp/` and create a new branch called *bike-images*.
201106

202107
```cmd
203-
cd ..
108+
cd dev-spaces/samples/BikeSharingApp/
204109
git checkout -b bike-images
205110
```
206111

@@ -234,7 +139,7 @@ Use `git push` to push your new branch to your forked repository:
234139
git push origin bike-images
235140
```
236141

237-
After the push is complete, navigate to your forked repository on GitHub create a pull request with the *master* in your forked repository as the base branch compared to the *bike-images* branch.
142+
After the push is complete, navigate to your forked repository on GitHub create a pull request with the *dev* in your forked repository as the base branch compared to the *bike-images* branch.
238143

239144
After your pull request is opened, navigate to the *Actions* tab. Verify a new action has started and is building the *Bikes* service.
240145

@@ -247,6 +152,8 @@ After the action has completed, you will see a comment with a URL to your new ch
247152
248153
Navigate to the *bikesharingweb* service by opening the URL from the comment. Select *Aurelia Briggs (customer)* as the user, then select a bike to rent. Verify you no longer see the placeholder image for the bike.
249154

155+
If you merge your changes into the *dev* branch, another action will run to rebuild and run your entire application in the parent dev space. This requires In this example, the parent space is *dev*. This action is configured in [.github/workflows/bikesharing.yml][github-action-bikesharing-yaml].
156+
250157
## Clean up your Azure resources
251158

252159
```cmd

articles/dev-spaces/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ landingContent:
7272
links:
7373
- text: Use GitHub Actions with Azure Dev Spaces
7474
url: how-to/github-actions.md
75-
- text: Use Azure Dev Spaces Connect
75+
- text: Connect your development machine to an AKS cluster
7676
url: how-to/connect.md
-484 Bytes
Loading
892 Bytes
Loading
-244 Bytes
Loading

articles/dev-spaces/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
href: how-to/run-dev-spaces-windows-containers.md
9292
- name: Use traefik for custom ingress and HTTPS
9393
href: how-to/ingress-https-traefik.md
94-
- name: Use Azure Dev Spaces Connect (preview)
94+
- name: Connect your development machine to an AKS cluster (preview)
9595
href: how-to/connect.md
9696
- name: Troubleshooting
9797
href: troubleshooting.md

0 commit comments

Comments
 (0)