question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble running code-server on Digital Ocean kubernetes

See original GitHub issue
  • code-server version: v2
  • OS Version: Kubernetes DO 1.16.6-do.0

Description

I’m having trouble running code-server on Digital Ocean kubernetes. The problem seems to be with websokets. In the Javasript console I get this error: ERR [remote-connection] [Management] [ee9c0…] [initial] [p-lao.tk:80] socketFactory.connect () failed. Error: Error: WebSocket close with status code 1006

ERR Assertion Failed: argument is undefined or null: Error: Assertion Failed: argument is undefined or null

Please help me solve this error.

First of all, Thanks

My YAML File

apiVersion: v1
kind: Namespace
metadata:
  name: code-server
---
apiVersion: v1
kind: Service
metadata:
 name: code-server
 namespace: code-server
spec:
 ports:
 - name: code-server-main
   port: 80
   targetPort: 8080
   name: https
   protocol: TCP
 selector:
   app: code-server
 type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: code-server
  name: code-server
  namespace: code-server
spec:
  selector:
    matchLabels:
      app: code-server
  replicas: 1
  template:
    metadata:
      labels:
        app: code-server
    spec:
      containers:
      - image: codercom/code-server:v2
        imagePullPolicy: Always
        name: code-server
        env:
        - name: PASSWORD
          value: "password"
        ports:
        - containerPort: 8080
          name: https
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress
  namespace: code-server
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: p-lao.tk
    http:
      paths:
      - path: /
        backend:
          serviceName: code-server
          servicePort: 80

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alelebacommented, Feb 28, 2020

I have solved the problem. In case someone has the same problem. In my Ingress.yaml I had to add an annotation to allow connections to websockets. The annotation I add to ingress.yaml:

annotations:
    nginx.org/websocket-services: "serviceName"

My YAML Ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress
  namespace: code-server
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.org/websocket-services: "code-server"
spec:
  rules:
  - host: p-lao.tk
    http:
      paths:
      - path: /
        backend:
          serviceName: code-server
          servicePort: 80
0reactions
alelebacommented, Feb 28, 2020

My YAML Exposes Ingress from a Load Balancer

apiVersion: v1
kind: Service
metadata:
  name: nginx-ingress
  namespace: nginx-ingress
spec:
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      name: http
    - protocol: TCP
      port: 443
      targetPort: 443
      name: https
  selector:
    app: nginx-ingress
Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble running code-server on Digital Ocean kubernetes
I'm having trouble running code-server on Digital Ocean kubernetes. The problem seems to be with websokets. In the Javasript console I get ...
Read more >
How To Set Up the code-server Cloud IDE ... - DigitalOcean
If you would like to run code-server on your DigitalOcean Kubernetes cluster check out our tutorial on How To Set Up the code-server...
Read more >
How To Set Up the code-server Cloud IDE Platform on ...
In this tutorial, you will set up the code-server cloud IDE platform on your DigitalOcean Kubernetes cluster and expose it at your domain, ......
Read more >
How To Set Up the code-server Cloud IDE ... - DigitalOcean
As I was following through the tutorial: “How To Set Up the code-server Cloud IDE Platform on Ubuntu 20.04”.
Read more >
code-server failing to start. Code exited Error 127 - DigitalOcean
Hi All,. I've been following this instruction from Digital Ocean how to set up a code-server in a droplet. Everytime I start the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found