Skip to content

1mb4dr/pipeline-app-azure-kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-app-with-azure-kubernetes

This repo is used to Trace an Application Deployed with Azure Kubernetes Service and Azure Pipelines

Steps

Create a resource group in Azure Subscription
az group create -l eastus -n aks-rg

Create Azure k8s cluster
az aks create -g aks-rg -n myAKSCluster --node-vm-size Standard_B2s --node-count 1 --generate-ssh-keys

Create Azure Container Registry
az acr create -g aks-rg -n youruniquename --sku Standard

Create Azure Pipelines
Here you need to create an organization in Azure DevOps and link your Github

Authenticate your k8s cluster with cloud-shell
az aks get-credentials -g aks-rg -n myAKSCluster

Get deployments
kubectl -n dev get deployments

Get pods
kubectl -n dev get pods

Get services
kubectl -n dev get svc

Get Horizontal Pod Autoscaler
kubectl -n dev get hpa

To check the app
curl http://[external-ip]:5000

To describe pods specification and check logs
kubectl -n dev describe pods [pod-name] kubectl -n dev logs [pod-name]

We can scale our deployment manually as well as automatically. For automatic scaling, we have defined HPA in YAML which increases one replica of pod whenever the average traffic on the running pod goes beyond 80%. It will increase replica up to the max number we defined in YAML manifest that’s 3 in our case.

To manual scale
kubectl -n dev scale deployment python-app --replicas=3 kubectl -n dev get deployment python-app

For interactive UI console of k8s cluster
az aks browse -g aks-rg -n myAKSCluster

For entering into pods
kubectl -n dev exec -it [pod-name] -- /bin/bash

Releases

No releases published

Packages

No packages published