Kubernetes, GitHub, and DevOps: Putting it all together to increase confidence in PR reviews.

Nick Greenfield
May 29 · 8 min read

In this guide you will learn how to:

Prerequisites


Set up your AKS cluster

$ az group create --name MyResourceGroup --location eastus$ az aks create -g MyResourceGroup -n MyAKS --location eastus --node-vm-size Standard_DS2_v2 --node-count 1 --disable-rbac --generate-ssh-keys

Enable Azure Dev Spaces on your AKS cluster

$ az aks use-dev-spaces -g MyResourceGroup -n MyAKS --space dev --yes

Get the sample application

$ git clone https://github.com/USERNAME/dev-spaces
$ cd dev-spaces/samples/BikeSharingApp/

Retrieve the HostSuffix for dev

$ azds show-context

Name ResourceGroup DevSpace HostSuffix
---------- ------------- -------- -----------
MyAKS MyResourceGroup dev fedcab0987.eus.azds.io

Update the Helm chart with your HostSuffix

Run the sample application in Kubernetes

$ cd charts/
$ helm init --wait
$ helm install -n bikesharing . --dep-up --namespace dev --atomic
$ cd charts/
$ helm init --wait
...
Happy Helming!
$ helm install -n bikesharing . --dep-up --namespace dev --atomic Hang tight while we grab the latest from your chart repositories...NAME READY UP-TO-DATE AVAILABLE AGE
bikes 1/1 1 1 4m32s
bikesharingweb 1/1 1 1 4m32s
billing 1/1 1 1 4m32s
gateway 1/1 1 1 4m32s
reservation 1/1 1 1 4m32s
reservationengine 1/1 1 1 4m32s
users 1/1 1 1 4m32s
$ azds list-urisUri                                                       Status
-------------------------------------- -------
http://dev.bikesharingweb.<random suffix>.eus.azds.io/ Available
http://dev.gateway.<random suffix>.eus.azds.io/ Available

Configure your CI/CD pipeline


Work in a feature branch and update the code

$ git checkout -b bike-images
$ git status
On branch bike-images
nothing to commit, working tree clean
// Hard code image url *FIX ME*
theBike.imageUrl = "/static/logo.svg";
...
var theBike = result;
theBike.id = theBike._id;
delete theBike._id;
res.send(theBike);
...
$ git add Bikes/server.js
$ git commit -m "Removing hard coded imageUrl from /bikes/:id route"
$ git push origin bike-images

Pull Request Flow


Test and interact with your pull request changes


Microsoft Azure

Any language. Any platform. Our team is focused on making the world more amazing for developers and IT operations communities with the best that Microsoft Azure can provide. If you want to contribute in this journey with us, contact us at medium@microsoft.com

Thanks to John Stallo.

Nick Greenfield

Written by

Microsoft Azure

Any language. Any platform. Our team is focused on making the world more amazing for developers and IT operations communities with the best that Microsoft Azure can provide. If you want to contribute in this journey with us, contact us at medium@microsoft.com