Skip to content

Commit

Permalink
added instruction for app deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiikryshtop committed Apr 20, 2018
1 parent c16fb51 commit f5ddcf7
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 5 deletions.
85 changes: 85 additions & 0 deletions DeployApp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Deploy Demo Application

Demo application is taken from (https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app)

## Building docker image

1. SSH to Linix VM

2. Clone application from GitHub

git clone https://github.com/Azure-Samples/azure-voting-app-redis.git
cd azure-voting-app-redis

3. Start locally

docker-compose up -d

4. Test locally in browser

(http://localhost:8080)


5. Stop containers

docker-compose stop
docker-compose down


## Create Azure Registry

Replace <ACR_NAME> with unique registry name (i.e. gab18acr).


az acr create -n <ACR_NAME> -g gab2018 --sku Basic --admin-enabled true

LOGIN_SERVER=$(az acr list -g gab2018 --query "[].{acrLoginServer:loginServer}" --output tsv)
echo $LOGIN_SERVER


## Pubish docker image to registry

1. Login to registry

Replace <ACR_SECRET> with secret key from portal, for example jPmD8Uhd0mmbL7Ogpv/dbwYwr9W6Nqpl

az acr create -n <ACR_NAME> -g gab2018 --sku Basic
LOGIN_SERVER=$(az acr list -g gab2018 --query "[].{acrLoginServer:loginServer}" --output tsv)
echo $LOGIN_SERVER

echo "<ACR_SECRET>"| docker login -u gab18lab --password-stdin $LOGIN_SERVER



2. Tag and Push image

docker tag azure-vote-front $LOGIN_SERVER/azure-vote-front:v1
docker push $LOGIN_SERVER/azure-vote-front:v1


3. List images in registry

az acr repository list --name gab18lab --output table

4. Test pull command

docker pull $LOGIN_SERVER/azure-vote-front:v1


## Grant read access for AKS cluster to access registry

Replace <AKS_NAME> with cluster name, for example: gab18aks

CLIENT_ID=$(az aks show -g gab18aks --name gab18aks --query "servicePrincipalProfile.clientId" --output tsv)

echo $CLIENT_ID

ACR_ID=$(az acr show -n <ACR_NAME> -g gab2018 --query "id" --output tsv)

echo $ACR_ID

az role assignment create --assignee $CLIENT_ID --role Reader --scope $ACR_ID




10 changes: 5 additions & 5 deletions SetupLinuxVM.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ az group create --name gab2018 --location "westeurope"

2. Create Linux VM with DNS name

Replace <vm_name> with your unique name, for example: gablabskr
Username: gab18usr
Password: 'pa$$w0rd!.12345'

Replace <vm_name> with your unique name, for example: gablabskr
Username: gab18usr
Password: 'pa$$w0rd!.12345'
az vm create --name <vm_name> --resource-group gab2018 --admin-username gab18usr --admin-password 'pa$$w0rd!.12345' --generate-ssh-keys --storage-sku Standard_LRS --image UbuntuLTS --size Standard_D1_v2 --public-ip-address-dns-name <vm_name>


3. SSH to VM: gab18usr@<vm_name>.westeurope.cloudapp.azure.com
For Windows use Putty.
For Windows use Putty.



Expand Down

0 comments on commit f5ddcf7

Please sign in to comment.