Create ASP.NET Core 2.2 as Docker Container in Kubernetes

Rebai Hamida
2 min readMar 8, 2019

--

Introduction

Monoliths are broken down into smaller independently running components called microservices. Microservices are decoupled from each other and therefore they can be developed, deployed, updated and scaled individually.

Each microservice exposes its functionality or services via an interface, typically a REST API that is a standalone process.

Each microservice can be packaged as a container and each service instance can be deployed as a container that is a simple way to be portable across many environments.

Kubernetes

“Kubernetes is an open-source system used to automate deployment, scaling, and management of containerized applications.”

Containers facilitate Microservices Architecture But we need an orchestrator

Orchestrating Windows containers with Kubernetes

Orchestrating Windows containers with Kubernetes

Azure Kubernetes Service (AKS)

“ Azure Kubernetes Service (AKS) simplifies the deployment and operations of Kubernetes and enables you to dynamically scale your application infrastructure with confidence and agility”

AKS

Run your .NET Core 2 project as Docker Container in Kubernetes

1.Create a .NET Core 2 WebAPI project

2.Publish the .NET Core 2 WebAPI project

3.Create a Docker image of the .NET Core 2 WebAPI project

4.Push the Docker image to the Azure Container Registry

5.Execute a Deployment file to instruct Kubernetes to host the Docker Container

Create ASP.NET Core Web API in Visual Studio 2019

--

--

Rebai Hamida

Senior Cloud Application Architect, Microsoft MVP in Developer Technologies, MCT, Technical writer, Speaker