<p>How do I enable a port on Google Kubernetes Engine to accept websocket connections? Is there a way of doing so other than using an ingress controller? </p>

<p>Web sockets are supported by Google's global load balancer, so you can use a k8s <code>Service</code> of type <code>LoadBalancer</code> to expose such a service beyond your cluster.</p>

<p>Do be aware that load balancers created and managed outside Kubernetes in this way will have a default connection duration of 30 seconds, which interferes with web socket operation and will cause the connection to be closed frequently. This is almost useless for web sockets to be used effectively.</p>

<p>Until <a href="https://github.com/kubernetes/ingress-gce/issues/28" rel="nofollow noreferrer">this issue</a> is resolved, you will either need to modify this timeout parameter manually, or (recommended) consider using an in-cluster ingress controller (e.g. nginx) which affords you more control.</p>
