Skip to content

Commit

Permalink
Another portion of instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiikryshtop committed Apr 20, 2018
1 parent f5ddcf7 commit 02837a3
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CopyFromLinuxVM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*How to copy SSH keys and K8s config from Azure Linux VM](./CopyFromLinuxVM.md)

Sample script for Windows using Putty tools

Replace <VM_IP> with VM fqdn or IP

pscp -r gab18usr@<VM_IP>:/home/gab18usr/.kube/ %USERPROFILE%/kube/
pscp -r gab18usr@<VM_IP>:/home/gab18usr/.ssh/ %USERPROFILE%/ssh/
pscp -r gab18usr@<VM_IP>:/home/gab18usr/.azure/ %USERPROFILE%/azure
66 changes: 66 additions & 0 deletions CreateAKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Provision AKS

## 1. Login to Linux VM via ssh

Use putty or ssh client.
You can enable port mapping and tunner from remote port 8001

## 2. Create resource group

*** This step helps to verify that only AKS service is created in the group and Azure put all related resources to aditional resource group

az group create --name gab18aks --location westeurope


## 3. Create AKS cluster

Replace <CLUSTER_NAME> with desired unique name, i.e. gab18aks

az aks create --resource-group gab18aks --name <CLUSTER_NAME> --node-count 1 --generate-ssh-keys --node-vm-size Standard_D1_v2 --dns-name-prefix <CLUSTER_NAME>


Verify cluster created and version of Kubernetes

az aks list -o table

## 4. Get K8s keys and config

az aks get-credentials --resource-group gab18aks --name <CLUSTER_NAME>

az aks get-versions --location westeurope --resource-group gab18aks --name <CLUSTER_NAME> -o table


## 5. Test connection to the management console

kubectl get nodes


## 6. Open Management Console

az aks browse -n <CLUSTER_NAME> -g gab18aks




## Upgrade Kubernetes cluster to version 1.9.2.
*** Execute later or in case of issue with credentials

* Get current version
az aks list -o table

* Upgrade

az aks upgrade --resource-group gab18aks --name gab18aks --kubernetes-version 1.9.2 --yes


* Verify

az aks list -o table


* Test

kubectl get nodes



12 changes: 7 additions & 5 deletions DeployApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ echo $LOGIN_SERVER

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
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

ACR_SECRET=$(az acr credential show -n <ACR_NAME> --query "passwords[0].value")

echo $ACR_SECRET

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


2. Tag and Push image
Expand Down
12 changes: 12 additions & 0 deletions DeployFromPrivateRegistry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Deploy image from Private Registry

## Creating Kubernetes secret to access private registry.

As example, connecting AKS to ACR using secret

$query="join(' ', ['docker login $RegistryName.azurecr.io', '-u', username, '-p', passwords[0].value])"

az acr credential show -n $RegistryName `
--query $query `
--output tsv `
| cmd
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,24 @@ Follow following instructions to provision and setup Linux VM in Azure
[Setup Linux VM in Azure](./SetupLinuxVM.md)


## Provisioning AKS Cluster
## [Provisioning AKS Cluster](./CreateAKS.md)


## [Deploying sample application](./DeployApp.md)


## Deploying sample application

## Scaling AKS Cluster

* Add another node to the cluster

## Scaling AKS Cluster
az aks scale -n gab18aks -g gab18aks --node-count 2

* Open K8s Dashboard

az aks browse -n gab18aks -g gab18aks

## Other

* [How to copy SSH keys and K8s config from Azure Linux VM](./CopyFromLinuxVM.md)
* Additional reading: (https://azure.microsoft.com/en-ca/solutions/architecture/container-cicd-using-jenkins-and-kubernetes-on-azure-container-service/)

0 comments on commit 02837a3

Please sign in to comment.