locked
How to deploy DotNet Project to Kubernetes with Visual Studio? RRS feed

  • Question

  • User-2098916251 posted

    When I use visual studio and add container orchestration support to my project, I get a number of options when I try to deploy to github:

    • Self contained & Portable (but you have to pick a target platform like Win x86)
    • Framework specific

    So assuming I'm deploying to Docker Desktop Kubernetes where the Docker VM is running linux, what happens when I deploy several projects with the framework specific option?

    1. Can the Kubernetes pods share a common copy of the DotNet Runtime and save disk and memory space?
    2. Will the required DotNet runtimes be installed automagically in the Kubernetes VMs (or pods) as required? If not, how does this happen?
    3. What happens if I select "Self contained and portable"? Will each project contain redundant copies of the DotNet framework that will be deployed redundantly on each pod?

    Thanks

    Siegfried

    Friday, July 17, 2020 10:40 PM

All replies

  • User-474980206 posted

    Kubernetes is a container orchestration tool. it support running the container form an image. it has no knowledge of what is in the image.

    for Kubernetes to run a AspNetCore core application via a docker container, you must build a docker image that has all the files (os, runtime, application, etc). 

       https://kubernetes.io/docs/concepts/containers/images/

    for Kubernetes you need to build a final docker image with your application installed, for it to run. typically during build, you'd pull an image with asp.net core runtime installed, so you don't need self contained. typically you would have a build step that copies the application.

    its also common to compose a build image that compile the code, then this image is run to build the final image, but this is advanced.

      https://docs.docker.com/compose/

    you might find it easier to start with just a docker compose and run, then move on to kubernetes

    note: you will need to learn docker build and compose. then Kubernetes compose syntax.

    Saturday, July 18, 2020 3:56 PM