/kube-crazy-web-api

:hammer: A demo project to run a simple .NET Core Web API in Kubernetes

Primary LanguageC#

Crazy Web API

🔨 A demo project to run a simple .NET Core Web API in Kubernetes

Deploying to MiniKube

  1. Point docker client to the minikube docker server
$ eval $(minikube docker-env)
  1. Building the docker image
$ docker-compose build
  1. Test locally using docker-compose
$ docker-compose up
  1. Deploy the pod, replica or the service
$ kubectl apply -f <path-to-config.yml>
  1. Check it in the Kube dashboard
$ minikube dashboard

Handy commands

Get the minikube ip

$ minikube ip

List a resource in Kubernetes

$ kubectl get pod --namespace=<your-namespace>

In general it is

$ kubectl get <resource> --namespace=<your-namespace>

Delete a resource in Kubernetes

$ kubectl delete <resource> --namespace=<your-namespace>

View the Kube dashboard

$ minikube dashboard

View list of available contexts (conneted clusters)

$ kubectl config get-contexts