Microservices, Docker, .NET, Windows, Linux, Azure. Oh, My!

Slides:



Advertisements
Similar presentations
Andrew Hennessy Automating Server Application migrations to the Cloud – Goodbye Server INF21 3.
Advertisements

Creating highly available and resilient Microservices on Microsoft Azure Service Fabric
Building a Microservices solution using Docker,
Basil Apostolou & Craig Pringle The why and how of hybrid cloud CLD22 3.
A deep dive into Azure AD B2C
3 Ways to Integrate Business Systems to Partners
Microsoft Build /9/2017 5:00 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Azure ARM Templates CLD321 Aaron Saikovski
Serverless in Office 365 Build services with Azure Functions
Making of the Ignite Bot
What's New in System Center Configuration Manager, Current Branch and Intune INF324a Steven Hosking.
30 Tips and Tricks for Managing and Running Ubuntu/Bash/Windows Subsystem for Linux WIN321B Orin Thomas.
Fundamentals Sunny Sharma Microsoft
Introduction to ASP.NET Core
The Zen of Package Management
Microsoft Virtual Academy
Accelerate your DevOps with OpenShift by Red Hat
Conversation As a Platform - Part 1
Microsoft Virtual Academy
Windows Containers Taylor Brown Principal Lead Program Manager
Docker and Azure Container Service
Deploying Linux on Microsoft Public and Private cloud
Why Is My SQL DW Query Slow?
6/11/2018 8:14 AM THR2175 Building and deploying existing ASP.NET applications using VSTS and Docker on Windows Marcel de Vries CTO, Xpirit © Microsoft.
Microsoft Virtual Academy
In-Depth Introduction to Docker
Need for Speed: Why Applications With No Database and No Services are Fast ARC334 Nick Randolph – Built to Roam.
Deploying Dockerized Apps to the Azure Container Service
Mastering Connectivity to O365
Building a Continuous Delivery Pipeline for ASP.NET Core Apps
Jenkins and Azure OPEN322 Michael Friedrich.
Microsoft Virtual Academy
ASP.NET in Linux and Windows containers
Microsoft Virtual Academy
Microsoft Virtual Academy
Windows Server & Hyper-V Containers Vaggelis Kappas
Darren Neimke and Jonathan Ruckert
Azure Container Service - the most open container orchestration service yet Saurya Das Program Manager.
Using docker containers
Azure Container Instances
Build vNext in VSO and TFS 2015
What’s new in Visual Studio in 2015?
Microsoft Virtual Academy
Intro to Docker Containers and Orchestration in the Cloud
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Rob Farley, LobsterPot Solutions
11/27/2018 4:20 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
11/27/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
Developing for the cloud with Visual Studio
Application Insights:
12/5/ :36 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Microsoft Virtual Academy
Modern cloud PaaS for mobile apps, web sites, API's and business logic apps
Learn. Imagine. Build. .NET Conf
Microsoft Virtual Academy
M318.
The Power of a Great API Damian Brady
MDC-B203 Deploying Applications in Microsoft System Center Virtual Machine Manager Using Services John Messec Program Manager Microsoft.
What is Visual Studio Code?
Deep Dive into Azure API Apps and Logic Apps
Jonathan Ruckert & Darren Neimke
UI test automation of MVC apps with Microsoft Edge WebDriver
Introduction to Docker
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Microsoft Virtual Academy
Azure Container Service
Securing ASP.NET in an Azure Environment
Azure App Service Web App for Containers
Containers on Azure Peter Lasne Sr. Software Development Engineer
Presentation transcript:

Microservices, Docker, .NET, Windows, Linux, Azure. Oh, My! ARC326 Richard Banks

About me… TL;DR Version I’m Richard (Banks). @rbanks54 richard.banks@readify.net

We’ll cover… The Docker basics Windows and Linux Containers Dockerising existing .NET code Docker & Microservices Deploying Containers & Azure Container Service

Docker in Under 5 Minutes

Terminology Image – a read only template for a container. Container – a runnable instance of an image. Host –runs the Docker engine. Repository – stores Docker images. Registry – for sharing images, backed by repository(s). Bundle* – A distributable collection of images. Stack* – A running instance of a bundle.

Microsoft Ignite 2016 7/17/2018 4:43 PM Concepts realignment Containers are immutable infrastructure. Application & Environment are a single, deployable unit. You no longer promote binaries to production. You promote your container images. © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

You don’t upgrade applications in containers. You replace them.

Simpler DevOps Devs can control the environment for their apps. “Works on my machine” now means “works on all machines”. IT Pros don’t have to worry about privilege elevation, running installers, or conflicting apps on the same machine. They can adopt a “cattle not pets” approach.

Developer’s Flow Install the Docker engine locally. Write your app using your favourite tools. Create a container image for your app. Run it and test it locally. Push it to an image repository.

ITPro/Ops Flow Deploy Docker hosts and clusters. Deploy an image repository Configure and run containers on hosts using images from the repository. Monitor containers for health.

Windows or Linux?

With great choice comes great confusion Docker supports both Windows and Linux containers. Q: So what do I use? Docker on Linux is the more mature choice. Docker on Windows is (rapidly) improving. *Containers must run on hosts of the same O/S type.

Decision Matrix for .NET Applications Keep using .NET Framework when: You already use .NET Framework and/or have strong dependencies on Windows You want to avoid the cost of porting to .NET Core. You use 3rd party libs not available in .NET Core. You need .NET features not available in .NET Core

Decision Matrix for .NET Applications You should use .NET Core when: You have cross-platform needs or desires. Your architecture is based on microservices. You need best-in-class high performance and hyper-scale. (via https://blogs.msdn.microsoft.com/cesardelatorre/2016/11/16/docker-containers-should-i-use-net-core-or-net-framework-2/)

Decision Matrix for Ops Teams Do I run Windows or Linux hosts? Does your team have sufficient knowledge of Linux? Would you be happy running containers via a service instead (e.g. Azure Container Service)? Are you organisationally constrained in platform choice? Can you support both platforms?

Dockerising existing .NET code

I have an existing .NET app How do I run Docker locally? Do I use a Windows or Linux container? How do I create an image for it? How do I run it? Debug it?

Creating Images Images are layered snapshots of a file system. Steps: Start with a base image (the first layer) Add your changes (each change is a new layer) Tag your final layer. Wallah!

Let’s Dockerise NerdDinner

What we need for the NerdDinner image Start with a Windows Server Core base image Add IIS Add ASP.NET and .NET Framework --- Microsoft has done these for us already (microsoft/aspnet)

What we need for the NerdDinner image Add SQL 2012 Express Local DB Add Application Code Configure the IIS App Pool & expose a port Run a container using the image

Open port 8081 & configure IIS app pool Add NerdDinner code Install SQL 2012 Express Add ASP.NET and .NET Framework Install IIS Windows Server Core

Dockerfiles A dockerfile scripts the steps needed to build an image. They make building fresh images an automated, repeatable and painless process. You can manually configure a running container and then snapshot it to create an image. Not recommended.

Demo https://blog.sixeyed.com/dockerizing-nerd-dinner-part-1-running-a-legacy-asp-net-app-in-a-windows-container/

So what about Linux?

Considerations Do you want to port to .NET core or Mono? Are you starting from scratch? Do you want to use any Linux based images from hub.* or store.docker.com (e.g. redis, elasticsearch, rabbitmq)? Linux containers are much easier to work with for now.

Let’s use Docker’s voting sample app https://github.com/docker/example-voting-app

Demo

Now for the Ops Side

Deployment with containers Single container & single host Devs commit code Build server creates and tags a new docker image Push the image to a repository

Continued… Single container & single host Ops pulls the image from the repo on to a host Starts a container using the image, supplying config settings via command line or environment variables, if needed.

You can host your own container registry Or you can use one provided by Azure

What happens when it’s more complex? What if we have multiple hosts? What if we want to distribute load across the hosts? How do we manage storage? Can we manage container placement?

What happens if it’s more complex? Can we autoscale container instances? Can we auto restart a container if it stops? Can we replace containers without downtime? Can we upgrade the docker engine without downtime?

A note on Stateful Applications Docker’s VOLUME command lets us map a folder on the host into the container. But what happens if the container needs to be moved to a new host? What happens if multiple containers need to share the storage?

Docker Volumes Data Volumes exist outside the container file system. Volumes still map to files on the hosts file system. You’ll need to place volumes on network shares or use tools like flocker to support host independent storage.

Enter orchestration tools 3 popular choices Docker Swarm (and Docker Datacentre) Kubernetes DC/OS (aka mesos, mesosphere, marathon) Azure and AWS container services offer one or more of these orchestration engines for use.

Swarm A peer-to-peer cluster of hosts, coordinating their efforts. Use docker swarm to manage the cluster. The swarm itself appears like a normal Docker host to clients (e.g. docker cli commands) Hosts in the swarm can use different O/Ses Yes, windows hosts & linux hosts can be in the same swarm.

Swarm pros/cons Supports up to 1200 nodes and is provided by Docker, making it the “default” option. Lacks features like autoscaling, health checks, balancing, host migrations and management dashboards*

Swarms and Azure You can deploy a swarm via Azure Container Service You can also deploy one using a template from Docker.

Demo

Kubernetes Part of the Linux Foundation, contributed by Google. Similar concept to Swarm, but with more features and more support from dashboard providers. Use Minikube (https://github.com/kubernetes/minikube) to run a single-node cluster locally

DC/OS Open sourced by Apache (Mesosphere is the Enterprise DC/OS toolkit). Similar feature set to Kubernetes, with a focus to support a wider range of workloads. Azure Container Services supports all 3 options for orchestration. Experiment with them to find the one best suited to your needs. https://docs.microsoft.com/en-us/azure/container-service/container-service-intro

Recap The Docker basics The Developer & IT Pro perspectives Dockerising existing .NET code Running heterogenous code Windows & Linux Containers Container orchestration

Fin.

Continue your Ignite learning path 7/17/2018 4:43 PM Continue your Ignite learning path Visit Channel 9 to access a wide range of Microsoft training and event recordings https://channel9.msdn.com/ Head to the TechNet Eval Centre to download trials of the latest Microsoft products http://Microsoft.com/en-us/evalcenter/ Visit Microsoft Virtual Academy for free online training visit https://www.microsoftvirtualacademy.com © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Win a Spark After Dark drone pilot pass by completing your session evaluation ASAP  #MSAUIGNITE

Thank you Chat with me in the Speaker Lounge Find me @rbanks54 7/17/2018 4:43 PM Thank you Chat with me in the Speaker Lounge Find me @rbanks54 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.