This document would share an experience on setting up kuburnate and then config your dotnetcore into your clustes. Then, it will also help to automate your deployment using kuberbetes cluster instead of visual studio publish tools.
This experiment case is contain; a) private cloud for kubernetes deployment, and b) automate deployment of your dotnet core services through a basic CI/CD based on Jenkins.
Requirement
Quick outline
Dotnet Core service on Linux
Installing dotnet core on Ubuntu 16.04 :
We can now copy our application into directory and then run dotnet run
inside directory.
Then open browser and hit localhost. (if you specified any port for your project, you have to add port after localhost: https://localhost:6600
)
Dockerize application
Since you are able to run your application via command, now it is time to dockerize it and create container for application and its dependent services. If you do not have docker installed, please follow the steps:
You might create a dockerhub repository and push your dotnet docker image over there for easy pull and run. Therefore, go to https://hub.docker.com and create an account. After logging in to Docker Hub click on the “Create Repository” button and create a new public repository. That is where we will be pushing our docker images.
Now, try to run dotnet publish to make sure your project can be compile properly before moving to docker container.
Now, we tring to package everything under bin/Release/netcoreapp2.0/publish/.
We create a Dockerfile
on the root of our project with the following contents:
Building the container and testing that it works: