Coder Social home page Coder Social logo

aks-demo's Introduction

This contains my demo for the MLSA Azure Episodes.

237cdd68-2bcb-40fd-8c10-7a104d6fbdc5

In the demo, I will walk through the following:

  • creating a docker image,
  • pushing the image to Azure Container Registry
  • deploying the image to Azure Kubernetes serices.

Steps

  • Test the app locally
$ python main.py
  • Create a Docker image
$ docker login
$ docker build -t hub-username/image-name .
  • Push the image to Azure Container Registry
$ az group create --name myResourceGroup --location eastus
$ az acr create --resource-group myResourceGroup --name <acrName> --sku Basic
$ az acr login --name <acrName>
$ docker tag docker-image:tag <acrLoginServer>/image-name:tag
$ docker images
$ docker push <acrLoginServer>/image-name:tag
  • Get your image name and tag
$ az acr repository list --name <ACRname>    
$ az acr repository show-tags --name <ACRname> --repository <repo> --output table

Connect to the AKS CLI

Guide

$ az aks install-cli
$ az account set --subscription xxxx-xxx-xx-xx-xxxx
$ az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
$ kubectl get nodes
  • Create a K8s cluster and deployment files.

Create Deployments

$ kubectl apply -f aks/demo-ip.yml
$ kubectl apply -f aks/demo-service.yml

Test the application

$ kubectl get service

Navigate to the IP provided under External-IP

image

Debugging

$ kubectl get pods
$ kubectl get logs <pod-name>
$ kubectl describe pod <pod-name>
$ kubectl describe service <service-name>
$ kubectl describe deployment <deployment>

Clean up

$ az group delete --name myResourceGroup --yes --no-wait

aks-demo's People

Contributors

mbaoma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.