DEV Community

Alexandr K
Alexandr K

Posted on • Edited on

How to deploy Ember app to kubernetes

As part of my unfinished project observerio I were working on my first ember dashboard and when I finished to work on prototype, decided to deploy it as pod in kubernetes cluster in digitalocean. Why kubernetes probably it's saving a lot of time if you are solo developer and don't have enough money to support the non profitable idea.

On the first deploy I found that it was pretty easy to build released version of ember app but on open the dashboard in browser I found that my routing is not working properly. After googling the solution someone suggested to change nginx settings on serve ember app.

Docker.released used by pod:

FROM alpine:3.6

COPY dist/ /app

WORKDIR /app

CMD ["tail", "-f", "/dev/null"]

Enter fullscreen mode Exit fullscreen mode

How to change nginx settings? I started to think about it. I didn't know internal stuff in k8s and the next step for me was to explore a bit the containers from running processes in kubernetes cluster. In ingress pod I found the nginx template that used on serving my ember pod.

nginx.tmpl

To make sure that I would have the same template as installed ingress container, I copied nginx.tmpl from the container and placed there(line: 458):

{{ if and (eq $path "/") (eq $server.Hostname "observer.rubyforce.co") }}
            try_files $uri $uri/ /index.html?/$request_uri;
{{ end }}
Enter fullscreen mode Exit fullscreen mode

Then changed ingress controller to use the new template via config map, example of Deployment

Probably it could be helpful for someone as well.

Thanks for reading!

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay