philjhale / FirstKubernetesApp

A project to remind me how to create a .NET Core Docker image and deploy it using Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First Kubernetes App

A repository that will remind me how to create a .NET Core app, build a Docker image from it and deploy that image to Kubernetes.

Prerequisites

All

  • .NET Core SDK 2.1

Mac

  • Download and install Docker for Mac
  • Preferences -> Kubernetes -> Enable Kubernetes

Windows

  • You're on your own. Probably Docker and Minikube

Steps

Build a docker image.

docker build -t k8sfirstapp .

Run the image. This maps port 80 in the container to 8080.

docker run -p 8080:80 k8sfirstapp

Check it works by viewing in the browser. http://localhost:8080/api/random

Create the Kubernetes deployment and expose the app using a LoadBalancer service.

kubectl apply -f k8s-spec.yaml

The API should be accessible in the browser. Fingers crossed. http://localhost:4000/api/random

About

A project to remind me how to create a .NET Core Docker image and deploy it using Kubernetes


Languages

Language:C# 84.9%Language:Dockerfile 15.1%