# Kubernetes as webserver

**URL:** <https://discuss.kubernetes.io/t/kubernetes-as-webserver/9809>\
**Category:** General Discussions\
**Created:** [February 20, 2020, 10:41pm UTC](https://discuss.kubernetes.io/t/kubernetes-as-webserver/9809 "2020-02-20T22:41:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Wright](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/michael_wright/32/4636_2.png) [@Michael\_Wright](https://discuss.kubernetes.io/u/Michael_Wright)\
**Post date:** [February 20, 2020, 10:41pm UTC](https://discuss.kubernetes.io/t/kubernetes-as-webserver/9809/1 "2020-02-20T22:41:10Z")

</div>

Hiya

I’m wanting to use kubernetes as a webserver. I created a [asp.net](http://asp.net) application just saying Hello-World. I dockerised it and published it to Kubbernetes. The container started up and then backed off saying terminated completed exit code 0. So it looks like its ok, but didnt get chance to browse to webpage to view.

Is this the same with all [asp.net](http://asp.net) apps, how do I create a website that I can browse to?

I see some people are using Nginx , but I want to use a kubernetes loadbalancer.

I see many articles on creating [asp.net](http://asp.net) applications for kubernetes, but do they startup and shut down the same?

I want a webserver like IIS or Apache on kubernetes I can access and view pages.

I want to do this for [asp.net](http://asp.net) and maybe php, what are my options?

Have I not created a website and instead just an app that executes and then finishes?

Can someone help?

cheers Mike

---

<div class="post-metadata">

**Author:** ![RyanG](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/ryang/32/4679_2.png) [@RyanG](https://discuss.kubernetes.io/u/RyanG)\
**Post date:** [February 21, 2020, 9:15pm UTC](https://discuss.kubernetes.io/t/kubernetes-as-webserver/9809/2 "2020-02-21T21:15:02Z")

</div>

Hi @Michael_Wright I was thinking of doing the same, but with nginx as a LoadBalancer. I am still learning k8, so I haven’t gotten very far with this idea of mine. But, if the container is starting and terminating without any real error, could you add a sleep command to the container to keep it alive enough for you to browse to it?

---

<div class="post-metadata">

**Author:** ![Michael\_Wright](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/michael_wright/32/4636_2.png) [@Michael\_Wright](https://discuss.kubernetes.io/u/Michael_Wright)\
**Post date:** [February 22, 2020, 1:26am UTC](https://discuss.kubernetes.io/t/kubernetes-as-webserver/9809/3 "2020-02-22T01:26:09Z")

</div>

Hiya

Yes after further research thats the thing todo. My code is [asp.net](http://asp.net) core which includes its own webserver called kestral. Any app that supports [asp.net](http://asp.net) core supports kestral. I’m using kubernetes loadbalancer configured from the yaml. Kestral is not recommended to be exposed to internet hence why you use nginx as reverse http proxy. Yes a sleep command should do it.
