12-factor tip: Set up ingress for your websocket app

In this post, we will learn which charm is used to set up ingress for your websocket needs.

The default ingress charm nginx ingress integrator does not support the websocket protocol. If you have a websocket application that you would like to charm with the 12-factor app support, you need to use Traefik for your ingress needs.

Deploy and integrate with Traefik using just two commands:

$ juju deploy traefik-k8s --trust

$ juju integrate traefik-k8s my-websocket-app

And that’s it!

You can use the show-proxied-endpoints action to see your application’s address:

$ juju run traefik-k8s/0 show-proxied-endpoints

Running operation 10 with 1 task

- task 11 on unit-traefik-k8s-0

Waiting for task 11...

proxied-endpoints: '{"traefik-k8s": {"url": "http://10.64.140.43"},"my-websocket-app": {"url": "http://10.64.140.43/model-my-websocket-app"}}'
1 Like