code-server
code-server copied to clipboard
[Bug]: Kubernetes Helm Deployment with Ingress not working
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
- 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"
- 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. - Enter the password and Submit.
- 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 -----------------
- Port-Forward the Kubernetes Pod to Localhost:
kubectl port-forward [POD_NAME] 8080
- 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
Same problem here
Is there any way I can reproduce this locally?
Here is what I did:
- Install and launch minikube.
- minikube addons enable ingress (not sure this was necessary).
- Clone and cd into code-server.
- Edit ingress in ci/helm-chart/values.yaml to match the ingress
posted above except I set
enabled
totrue
. - Run
helm upgrade --install code-server ci/helm-chart
. - Edit
/etc/hosts
and point mydomain.com to the address returned bykubectl get ingress
. - Visit domain.com and log in.
For me after logging in it rendered the editor as expected.
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
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 What was the fix? Can you post the working configuration?
Closing this for now due to a lack of reproduction, but if one comes up we can reopen.