code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: Kubernetes Helm Deployment with Ingress not working

Open ddezoysa opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

Web Browser: Chrome Local OS: EKS v1.22 Amazon EKS optimized Amazon Linux AMI Container OS: Debian Container Architecture: linux/amd64 code-server --version: 4.13.0

Steps to Reproduce

  1. Installed Code Server in AWS EKS v1.22 with Nginx Ingress:
image:
  repository: codercom/code-server
  tag: '4.13.0-debian'
  pullPolicy: Always

ingress:
  enabled: false
  hosts:
   - host: mydomain.com
     paths:
       - /
  ingressClassName: "nginx"
  1. Afterwards https://mydomain.com/login shows the login page. As the login page get loaded without any issues, there are not issues in the ingress.
  2. Enter the password and Submit.
  3. After submitting the correct password, browser redirected to https://mydomain.com. Page content was as below.
Not found.

Ingress routes the traffic to the Code-Server Kubernetes Pod and Pod logs are as below:

[2023-06-07T18:53:59.504Z] debug redirecting from / to ./login
[2023-06-07T18:53:59.505Z] debug redirecting from / to ./login

----------------- Additional Testing -----------------

  1. Port-Forward the Kubernetes Pod to Localhost:
kubectl port-forward [POD_NAME] 8080
  1. Try to access the code-server with http://localhost:8080 which shows the login page. After submitting the correct password, VSCode UI get loaded in the browser without any issues.

Expected

Expected to view VSCode UI after login

Actual

After submitting the correct password, browser redirected to https://mydomain.com. Page content was as below.

Not found.

Logs

Nginx Ingress routes the traffic to the Code-Server Kubernetes Pod and Pod logs are as below:

[2023-06-07T18:53:59.504Z] debug redirecting from / to ./login
[2023-06-07T18:53:59.505Z] debug redirecting from / to ./login

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

No response

ddezoysa avatar Jun 07 '23 19:06 ddezoysa

Same problem here

enmanuelmoreira avatar Jul 08 '23 00:07 enmanuelmoreira

Is there any way I can reproduce this locally?

Here is what I did:

  1. Install and launch minikube.
  2. minikube addons enable ingress (not sure this was necessary).
  3. Clone and cd into code-server.
  4. Edit ingress in ci/helm-chart/values.yaml to match the ingress posted above except I set enabled to true.
  5. Run helm upgrade --install code-server ci/helm-chart.
  6. Edit /etc/hosts and point mydomain.com to the address returned by kubectl get ingress.
  7. Visit domain.com and log in.

For me after logging in it rendered the editor as expected.

code-asher avatar Jul 13 '23 22:07 code-asher

I am seeing the same issue with k3s and envoy as proxy , if I enable auth, I get a 401 when I hit the route, so I know I am hitting the code-server app , but if I disable auth, I get a "Not found." 404, could be something with the proxy configuration but envoy isn't the same config as nginx, I'm trying to get a look at the headers exchanged to see if something is missing that is required.

I couldn't find this exact error string 'Not found.' with just that punctuation and capitalization in this codebase, so may be coming from a dependent package.

I am installing using helm but I have my own chart, I just point at the code-server images. I don't use the code-server helm packages

iondiode avatar Sep 03 '23 23:09 iondiode

I am seeing the same issue with k3s and envoy as proxy , if I enable auth, I get a 401 when I hit the route, so I know I am hitting the code-server app , but if I disable auth, I get a "Not found." 404, could be something with the proxy configuration but envoy isn't the same config as nginx, I'm trying to get a look at the headers exchanged to see if something is missing that is required.

I couldn't find this exact error string 'Not found.' with just that punctuation and capitalization in this codebase, so may be coming from a dependent package.

I am installing using helm but I have my own chart, I just point at the code-server images. I don't use the code-server helm packages

Nevermind, it was a configuration issue on my side! Once I had logs from the request I could see that the url was not being stripped, seems to work for me now, barring web-sockets, which hopefully I can fix.

iondiode avatar Sep 04 '23 02:09 iondiode

@iondiode What was the fix? Can you post the working configuration?

ddezoysa avatar Nov 29 '23 17:11 ddezoysa

Closing this for now due to a lack of reproduction, but if one comes up we can reopen.

code-asher avatar Jul 12 '24 23:07 code-asher