workspaces-images icon indicating copy to clipboard operation
workspaces-images copied to clipboard

502 error occurs when kasmweb service is connected with dns url through nginx-ingress-controller in k8s environment.

Open yoongeon1206 opened this issue 1 year ago • 3 comments

Hi,

I have verified kasmvnc in my local environment and think it will be useful for developers. To show kasmvnc to development team members, I created a helm chart to deploy to K8s.

We are trying to deploy the kasmweb Docker image (ubuntu-focal-dind:1.15.0) on Kubernetes and attempting to connect to DNS through nginx-ingress-controller. However, even though all DNS connections are made properly, the Kasm VNC screen is not visible.

  1. ( OK ) ubuntu-focal-dind:1.15.0 runs well without problems when run locally with the docker command.
  2. ( Not work ) When deployed to k8s and connected to DNS through nginx-ingress-controller, error 502 occurs. (port: 6901)
  3. ( OK ) When deployed on k8s and connected through port-forwarding, the VNC screen is displayed.

In above case 2, When connecting to other services, it connects without problem. I confirmed that only the kasmweb service was not connected with DNS on K8S. Is there any settings or env option that we need to connect to DNS in KASMWEB VNC service? or do we need to purchase a license to connect? Has anyone had the same issue as me or can help?

it seems to have to be updated something in dockerfile.

I simply share how i set up kasmvnc on k8s as follows.


Deployment

spec:
  containers:
  - name: kasmweb
    image: kasmweb/ubuntu-focal-dind:1.13.0
    ports:
    - containerPort: 6901

Service

ports:

  • protocol: TCP port: 6901 targetPort: 6901

Ingress

spec: rules:

  • host: develop.xxxxxxx.com http: paths:
    • path: / pathType: Prefix backend: service: name: kasm-service port: number: 6901

yoongeon1206 avatar Jul 22 '24 14:07 yoongeon1206

I have the same problem, since kasmweb forces HTTPS and BasicAuth on port 6901, it seems to need additional configuration.

MSandro avatar Sep 02 '24 10:09 MSandro

i also have the same problem.

orshih6 avatar Sep 30 '24 06:09 orshih6

I can help some...you need to terminate the SSL connection with nginx...so try something like this:

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" nginx.ingress.kubernetes.io/proxy-buffering: "off" nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" nginx.ingress.kubernetes.io/server-snippets: | location / { proxy_set_header Upgrade $http_upgrade; proxy_http_version 1.1; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header Connection "upgrade"; proxy_pass_header Authorization; proxy_cache_bypass $http_upgrade; }

I am running into it ignoring my Authorization header still...which is a bit of a mystery. Anyone have thoughts?

jjschwarz avatar Mar 04 '25 15:03 jjschwarz