This post is the first in a series on deploying ASP.NET Core applications to Kubernetes. In this series I’ll cover a variety of topics and things I’ve learned in deploying applications to Kubernetes. I’m not an expert on Kubernetes by any means, so I’m not going to go deep into a lot of the technical aspects, or describe setting up a Kubernetes cluster. Instead I’m going to focus on the app-developer’s side, taking an application and deploying it to an existing cluster.

Important note: I started writing this blog series about a year ago, but it’s been delayed for various reasons (ahem, procrastination). Since then Project Tye has arisen as a promising new way to deploy ASP.NET Core apps to Kubernetes. I won’t touch on Project Tye in this series, though I’m sure I’ll blog about it soon!

This series does not focus on using Docker with ASP.NET Core in general. Steve Gordon has an excellent blog series on Docker for .NET developers, as well as multiple talks and videos on the subject. I also have many other posts on my blog about using Docker with ASP.NET CoreScott Hanselman has also a recent 101 introduction to containers. Note that although production-level support for Windows has been around for a while I’m only going to be considering Linux hosts for this series.

Another important point is that I don’t consider myself a Kubernetes expert by any means! The approaches I describe in this series are very much taken from my own experience of deploying ASP.NET Core applications to a Kubernetes cluster. If there’s anything that you don’t agree with or looks incorrect, please do let me know in the comments! 🙂

In this post I describe some of the fundamental concepts that you’ll need to be familiar with to deploy ASP.NET Core applications to Kubernetes.

What is Kubernetes and do I need it?

Kubernetes is an open-source platform for orchestrating containers (typically Docker containers). It manages the lifecycle and networking of containers that are scheduled to run, so you don’t have to worry if your app crashes or becomes unresponsive - Kubernetes will automatically tear it down and start a new container.

The question of whether you need to use Kubernetes is an interesting one. There definitely seems to be a push towards it from all angles these days, but you have to realise it adds a lot of complexity. If you’re building a monolithic app, Kubernetes is unlikely to bring you value. Even if you’re heading towards smaller services, it’s not necessary to immediately jump on the band wagon. The question is: is service orchestration (the lifetime management and connection between multiple containers) currently a problem for you, or is it likely to be soon? If the answer is yes, then Kubernetes might be a good call. If not, then it probably isn’t.

#asp.net core #kubernetes #docker #devops

Deploying ASP.NET Core applications to Kubernetes
1.65 GEEK